Skip to content

Emit multiline telemetry from DaemonSet heartbeat#1672

Open
suyadav1 wants to merge 1 commit intoci_prodfrom
suyadav/multiline-telemetry
Open

Emit multiline telemetry from DaemonSet heartbeat#1672
suyadav1 wants to merge 1 commit intoci_prodfrom
suyadav/multiline-telemetry

Conversation

@suyadav1
Copy link
Copy Markdown
Contributor

@suyadav1 suyadav1 commented May 6, 2026

Problem

Multiline configuration telemetry (multilineEnabled, multilineLanguages) is silently dropped when the LOGS_AND_EVENTS_ONLY profile is enabled, so we have no visibility into multiline usage for clusters running that profile.

Root cause

The multiline dimensions are emitted from two places today, and neither runs in LOGS_AND_EVENTS_ONLY mode:

Emitter Plugin / channel Why it doesn't fire in LOGS_AND_EVENTS_ONLY
source/plugins/ruby/CAdvisorMetricsAPIClient.rb (lines 306-311) fluentd cAdvisor heartbeat → customMetrics fluentd is skipped entirely in this profile (kubernetes/linux/main.sh ~lines 1202-1211)
source/plugins/go/input/lib/cadvisor.go (lines 1068-1070) fluent-bit perf input → customEvents (cAdvisor heartbeat) only loaded when AZMON_RESOURCE_OPTIMIZATION_ENABLED=true (gated in build/common/installer/scripts/fluent-bit-conf-customizer.rb line 75)

The DaemonSet heartbeat (ContainerLogDaemonSetHeartbeatEvent) emitted from source/plugins/go/src/telemetry.go is the one telemetry path that always runs in the DS, including under LOGS_AND_EVENTS_ONLY. It already carries the logsAndEventsOnly dimension but did not include the multiline fields.

Fix

Add multilineEnabled and multilineLanguages to the DaemonSet heartbeat in telemetry.go, right next to the existing logsAndEventsOnly dimension.

azmonMultilineEnabled := os.Getenv("AZMON_MULTILINE_ENABLED")
if azmonMultilineEnabled != "" {
    telemetryDimensions["multilineEnabled"] = azmonMultilineEnabled
    azmonMultilineLanguages := os.Getenv("AZMON_MULTILINE_LANGUAGES")
    if azmonMultilineLanguages != "" {
        telemetryDimensions["multilineLanguages"] = azmonMultilineLanguages
    }
}

Precedent

Commit aa3098b14 (PR #1212, "move LOGS_AND_EVENTS_ONLY telemetry to DS") used the same approach to surface the logsAndEventsOnly dimension. The duplication between the cAdvisor heartbeat and the DS heartbeat also matches the existing nflEnabled pattern (emitted in both cadvisor.go and telemetry.go).

Why we keep the existing emit sites

  • They publish to a different App Insights table (customMetrics via the cAdvisor heartbeat vs customEvents via the DS heartbeat), so they do not double-count.
  • The Ruby and Go cAdvisor sites are mutually exclusive (one runs with fluentd, the other only when resource optimization is enabled).
  • Removing them would be a behavior change for the non-LOGS_AND_EVENTS_ONLY paths and is out of scope for this fix.

Validation

  • go build ./... from source/plugins/go/src is clean.
  • No behavior change for non-LOGS_AND_EVENTS_ONLY modes; the multiline dimensions will simply also be present on the DS heartbeat.

Follow-up (not in this PR)

A broader audit identified other log-related fields with the same gap in LOGS_AND_EVENTS_ONLY (e.g. clusterstdoutlogs, clusterstderrlogs, containerLogsRoute, metadataEnabled, etc.). Happy to fix those in a separate PR if desired.

Adds multilineEnabled and multilineLanguages dimensions to the
ContainerLogDaemonSetHeartbeatEvent in source/plugins/go/src/telemetry.go.

Previously the multiline telemetry was emitted only from the cAdvisor
heartbeat in either CAdvisorMetricsAPIClient.rb (requires fluentd) or
cadvisor.go (requires AZMON_RESOURCE_OPTIMIZATION_ENABLED=true). In
LOGS_AND_EVENTS_ONLY mode neither emitter runs, so the multiline
configuration was never reported in telemetry for that profile.

The DaemonSet heartbeat is the only telemetry path that always runs in
this mode (it already carries the logsAndEventsOnly dimension), making
it the right place to surface the multiline configuration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@suyadav1 suyadav1 requested a review from a team as a code owner May 6, 2026 18:44
@suyadav1 suyadav1 enabled auto-merge (squash) May 6, 2026 22:16
if azmonMultilineEnabled != "" {
telemetryDimensions["multilineEnabled"] = azmonMultilineEnabled
azmonMultilineLanguages := os.Getenv("AZMON_MULTILINE_LANGUAGES")
if azmonMultilineLanguages != "" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be special characters and does ingestion work for all characters? any validation needeD?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants