Emit multiline telemetry from DaemonSet heartbeat#1672
Open
Emit multiline telemetry from DaemonSet heartbeat#1672
Conversation
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>
| if azmonMultilineEnabled != "" { | ||
| telemetryDimensions["multilineEnabled"] = azmonMultilineEnabled | ||
| azmonMultilineLanguages := os.Getenv("AZMON_MULTILINE_LANGUAGES") | ||
| if azmonMultilineLanguages != "" { |
Contributor
There was a problem hiding this comment.
can this be special characters and does ingestion work for all characters? any validation needeD?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Multiline configuration telemetry (
multilineEnabled,multilineLanguages) is silently dropped when theLOGS_AND_EVENTS_ONLYprofile 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_ONLYmode:source/plugins/ruby/CAdvisorMetricsAPIClient.rb(lines 306-311)customMetricskubernetes/linux/main.sh~lines 1202-1211)source/plugins/go/input/lib/cadvisor.go(lines 1068-1070)perfinput →customEvents(cAdvisor heartbeat)AZMON_RESOURCE_OPTIMIZATION_ENABLED=true(gated inbuild/common/installer/scripts/fluent-bit-conf-customizer.rbline 75)The DaemonSet heartbeat (
ContainerLogDaemonSetHeartbeatEvent) emitted fromsource/plugins/go/src/telemetry.gois the one telemetry path that always runs in the DS, including underLOGS_AND_EVENTS_ONLY. It already carries thelogsAndEventsOnlydimension but did not include the multiline fields.Fix
Add
multilineEnabledandmultilineLanguagesto the DaemonSet heartbeat intelemetry.go, right next to the existinglogsAndEventsOnlydimension.Precedent
Commit
aa3098b14(PR #1212, "move LOGS_AND_EVENTS_ONLY telemetry to DS") used the same approach to surface thelogsAndEventsOnlydimension. The duplication between the cAdvisor heartbeat and the DS heartbeat also matches the existingnflEnabledpattern (emitted in bothcadvisor.goandtelemetry.go).Why we keep the existing emit sites
customMetricsvia the cAdvisor heartbeat vscustomEventsvia the DS heartbeat), so they do not double-count.LOGS_AND_EVENTS_ONLYpaths and is out of scope for this fix.Validation
go build ./...fromsource/plugins/go/srcis clean.LOGS_AND_EVENTS_ONLYmodes; 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.