feat(collector): log extension startup completion and duration#2413
Open
mvanhorn wants to merge 1 commit into
Open
feat(collector): log extension startup completion and duration#2413mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
Capture a start timestamp in main.go before the launch log and thread it through lifecycle.NewManager. After the collector starts successfully, emit a single info-level "OpenTelemetry Lambda extension startup complete" log carrying a startup_duration field so operators can see when the extension is ready and measure its cold-start contribution. Signed-off-by: Matt Van Horn <mvanhorn@gmail.com>
Member
|
Thanks @mvanhorn for working on this! I'm a bit swamped at the moment but will take a look as soon as possible! |
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.
Summary
The collector extension emits a
"Launching OpenTelemetry Lambda extension"info log at process start, but nothing marks that startup has finished or how long it took. This adds a single info-level"OpenTelemetry Lambda extension startup complete"log carrying astartup_durationfield, emitted once the collector has started successfully.A start timestamp is captured in
main.goimmediately before the launch log and threaded intolifecycle.NewManager(the only production caller, so the signature change is contained). Aftercollector.Startreturns successfully inmanager.Run, the completion log is emitted withzap.Duration("startup_duration", time.Since(startTime)). The duration measures from the extension's launch log through successful collector start.Why this matters
Operators consuming the info-level firehose currently cannot tell when the extension is actually ready, nor measure its contribution to cold start. In #2101, @wpessers confirmed this is a valid concern, split the original report into two sub-features, and narrowed the remaining ask to exactly this startup-duration logging. This keeps it a single info-level statement so it is visible in the default firehose, with no new log-level knob (the log-decoupling sub-feature is out of scope and already addressed separately).
Testing
Added
TestRunLogsStartupDurationinmanager_test.gousing a zap observer core:MockCollectorstart emits exactly one startup-complete log with a non-negativestartup_durationfield.collector.Startreturns an error, the startup-complete log is NOT emitted andRunreturns the error, preserving current failure behavior.go build ./...,go vet, andgo test ./internal/lifecycle/...pass in thecollectormodule.Fixes #2101