Repository navigation
Make processor queue capacity metrics observable - #5618
cijothomas wants to merge 6 commits into
Conversation
Assisted-by: GPT-5.6 Sol
Assisted-by: GPT-5.6 Sol
Pull request dashboard statusWaiting on the author · refreshed 2026-10-26 20:55 UTC Respond to 1 review item (e.g. link a commit, explain why not, ask a follow-up):
Status above doesn't look right?
|
|
@DylanRussell Please review. Hit the issue while working on open-telemetry/opentelemetry-demo#3932 and it worked around by re-ordering, but this PR would be a better fix. |
Shriprasad-P
left a comment
There was a problem hiding this comment.
Thanks for switching queue capacity to an observable instrument — that should fix the late MeterProvider case cleanly.
A few notes from reading _processor_metrics.py and the new test:
- Callback closure over
capacity—record_queue_capacitycapturescapacityby value from__init__. That is fine if capacity is immutable for the processor lifetime; if anything ever resizes the queue, this metric would silently stay stale. Worth a one-line comment near the callback that capacity is fixed at construction, or asserting that in the test docstring. - Double collect in the test — collecting twice is good for proxy/late-provider stability. Consider also asserting that no cumulative counter-style noisy points appear for capacity (only the single Observation), so a regression back to
add()would fail loudly. - Description length — the log-path description is one long line; matching the span-path multi-line style would keep lint/formatters happier across the file.
Otherwise the approach looks sound and the changelog entry matches the change.
|
Hi @cijothomas — just a friendly reminder that this pull request is waiting on you. The dashboard status comment has the open items and is kept current.
|
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
Description
Report span and log processor queue capacity with observable up-down counters instead of recording the capacity once with synchronous counters.
A processor can be constructed before the SDK installs the real meter provider. In that case, the one-time synchronous measurement is made against a proxy instrument and is not replayed when the provider is installed, so queue capacity is never exported. Observing the fixed capacity during collection avoids that initialization-order dependency and remains compliant with the metrics semantic conventions.
Adds regression coverage for processors created before the real meter provider is installed.