Repository navigation
Report Fluentd drops on a configurable interval with stream and queue state - #8904
Draft
cjen1-msft wants to merge 8 commits into
Draft
cjen1-msft wants to merge 8 commits into
cjen1-msft wants to merge 8 commits into
Conversation
Replace count-based drop reporting (every 65536 drops) with a time-based report per sink, configured by observability.fluentd[].drop_report_interval (default 1min). Producers still only increment an atomic counter; the consumer reads the clock only when there are unreported drops. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Format periodic Fluentd drop reports as structured key=value fields: endpoint, tags, state, queued_records, queued_bytes, dropped, and window. Expose SPSCQueue::queued_bytes() using an atomic pushed_bytes counter ordered before tail release so the consumer reads queued byte usage without extra producer synchronization. Add integration tests covering disconnected, quiet-interval, connected, and byte-limit drop reports, plus config validation in cft_trace_e2e.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 807be547a28b492dadfae87eaa6d38e4
…shutdown guard, and strict TimeString parsing - Replace SPSCQueue::queued_bytes() with consumer-only SPSCQueue::usage() that reads records and bytes from a single published tail snapshot (and restores non-atomic pushed_bytes on the producer hot path). - Format endpoint via ccf::make_net_address() for bracketed IPv6 literals, encode tags as a compact escaped JSON array, and retain microsecond precision in DropReporter::format_duration(). - Validate Transport endpoints before constructing DropReporter (and clamp both ends in DropReporter); reject trailing garbage, multiplier overflow, and > INT64_MAX microseconds in unit_strings.h. - Skip report_drops() after finish_if_done() marks a transport finished, clarify shutdown drain behavior in configuration.rst, and remove the test logger registry mutation and multi-drop wakeup race. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 807be547a28b492dadfae87eaa6d38e4
…yntax in FluentdSink::validate Restore permissive prefix parsing in UnitStringConverter::convert() so historical SizeString values stored in public:ccf.gov.nodes.info (e.g. "1.5MB") continue to deserialize during recovery and ledger replay. Keep checked integer multipliers in convert_time_string() and the microseconds::max() bound in TimeString to reject only UB/wrapping overflows. Enforce strict full-string numeric parsing specifically on FluentdConfig::drop_report_interval in FluentdSink::validate(). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 807be547a28b492dadfae87eaa6d38e4
…ominators in docs Document the accepted duration units (us, ms, s, min, h; bare numbers as microseconds), exact key=value log message shape, aggregate provisioned-queue denominators, and per-collector shutdown total in configuration.rst, host_config.json, and the change note. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 807be547a28b492dadfae87eaa6d38e4
cjen1-msft
force-pushed
the
cjen1-msft-cautious-invention
branch
from
December 4, 2026 13:39
fde6f83 to
a212dbd
Compare
Keep pre-existing TimeString overflow handling out of this PR (to be addressed separately if needed). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 807be547a28b492dadfae87eaa6d38e4
Link to observability_export from host_config.json instead of duplicating report details, and tighten the configuration.rst paragraph. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 807be547a28b492dadfae87eaa6d38e4
Remove hand-rolled format_tags and format_duration helpers: serialise
tags via nlohmann::json::dump with UTF-8 replacement and format window
as seconds to two decimal places ({:.2f}s).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 807be547a28b492dadfae87eaa6d38e4
This branch has not been deployed
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.
Replace count-based Fluentd drop logging (once every 65536 dropped records) with per-collector time-based structured drop reports configured by
observability.fluentd[].drop_report_interval(default"1min").Count-based drop logging is noisy during sustained outages, silent during slow trickles, and did not identify which collector stream was dropping or its queue pressure.
Each collector now logs at most one failure-level
key=valuereport per interval from the consumer thread (endpoint,tags,state,queued_records,queued_bytes,dropped,window), keeping producer threads off the clock and free of extra synchronization.Drop-report log lines are themselves exported through
FluentdLoggerwhen a collector selectsccf.log, so a stalled collector can drop its own report (at most one self-inflicted drop per interval).Alternatives
steady_clock::now()on producer drop paths: rejected to avoid clock reads on the producer hot path; checking on the consumer thread skips the clock entirely when no new drops occurred.SPSCQueue::size()separately from an atomicpushed_bytescounter: rejected because a concurrent push between the two reads can report an impossible combination (such as 0 records and 60 bytes);SPSCQueue::usage()computes both from one publishedtailsnapshot on the consumer thread without touching the producer hot path.Safety and compatibility
observability.fluentd[].drop_report_intervalis optional (default"1min"). Zero, compound (e.g."1m30s"), and fractional (e.g."1.5s") durations are rejected fordrop_report_intervalat--checkand startup.Dropped N trace events (observed M)toFluentd exporter dropped records: endpoint=... tags=... state=... queued_records=.../... queued_bytes=.../... dropped=... window=....Log format example and operational details
Example drop report:
endpointusesccf::make_net_address(IPv6 literals are bracketed, e.g.[::1]:24224).tagsis a compact JSON-escaped array of the collector'stag-prefix-allow-list.queued_recordsandqueued_bytessum per-queue snapshots (not one global lock across queues) against total hard capacity across all provisioned queues for that collector (one per producer thread plus the shared unbound queue), excluding any single in-flight record already popped by the consumer.droppedcounts records dropped in the elapsedwindow(formatted as seconds to two decimal places, e.g.60.04s).