-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Metrics Stop Prematurely at Program Shutdown #15912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey @dmuth - looks legit! Thanks for the thorough report. I suspect what's happening (basically what you suggested) is all of the components attempt to finish and shutdown at the same time, and the I can envision a tiered shutdown where the "actual event streams" are finished, then the "internal event streams", and then finally cleanly shutdown - to not lose any of the telemetry. It could get complicated identifying/separating components into tiers though. |
@spencergilbert as an ad-hoc solution instead of implementing "true" tiering, I could suggest just dropping "internal_metrics" source as the last one. Not a pretty solution but should work :) Is it worth it? I don't know, honestly. |
This likely affects the |
…ternal ones (#17741) <!-- **Your PR title must conform to the conventional commit spec!** <type>(<scope>)!: <description> * `type` = chore, enhancement, feat, fix, docs * `!` = OPTIONAL: signals a breaking change * `scope` = Optional when `type` is "chore" or "docs", available scopes https://github.com/vectordotdev/vector/blob/master/.github/semantic.yml#L20 * `description` = short description of the change Examples: * enhancement(file source): Add `sort` option to sort discovered files * feat(new source): Initial `statsd` source * fix(file source): Fix a bug discovering new files * chore(external docs): Clarify `batch_size` option --> We would like to close the internal logs, metrics, and trace sources sent from Vector as late as possible during shutdown to facilitate debugging. In this PR, we wait until all other sources are shut down before shutting down internal telemetry sources. This means that shutdown may be a bit longer, but we will have better observability on the shutdown process. issue: #15912
Closed by #17741 |
A note for the community
Problem
When I run Vector from the command line with a single data source of demo data for a few seconds, then terminate the process with ctrl-C, the values for Metrics stop being updated prematurely while events are still written.
This is my first ever Issue with Vector, so if I missed something really obvious or more troubleshooting needs to be done on my end please do let me know! :-)
Configuration
Version
vector 0.23.3 (x86_64-unknown-linux-musl af8c9e1 2022-08-10)
Debug Output
Example Data
N/A
Additional Context
From a sample run (
vector -c ./internal-metrics.toml
), withinterval = 1
:Expected value for the metrics count would be 8, matching the number of events in the output file.
When I set
interval = 5
and run Vector for 6 seconds, here's what I see:Watching the execution in real-time provides a clue: when I hit ctrl-C about 6 seconds in, Vector runs for another 4 seconds or so, and the third event is written to the output file. This suggests that when ctrl-C is received, metrics immediately stop being generated, buffers are flushed/pending events are processed, and then the Vector process exits.
References
None that I could find after doing a few searches here.
Thank you for your time, and all the effort that's gone into Vector so far!
-- Doug
The text was updated successfully, but these errors were encountered: