Repository navigation
fix(telemetry): flush usage error counter before CLI exit - #7686
Merged
Merged
Conversation
dan-petty
marked this pull request as ready for review
November 29, 2026 03:25
dan-petty-release Bot
added a commit
that referenced
this pull request
Nov 29, 2026
🤖 I have created a release *beep* *boop* --- ## [0.245.0](v0.244.0...v0.245.0) (2026-11-29) ### Features * **gh:** pass gh issue create, edit, close, and reopen through to gh ([#7687](#7687)) ([2b646a3](2b646a3)) ### Bug Fixes * **pr:** name devops gh in failed check log hint ([#7688](#7688)) ([4742cf3](4742cf3)) * **telemetry:** flush usage error counter before CLI exit ([#7686](#7686)) ([e7d1ce5](e7d1ce5)), closes [#5220](#5220) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
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.
Flush active tracer metrics inside
record_usage_errorso root-level CLI usage errors exportdevops_cli_usage_error_totalbefore Typer exits with code 2.self._meter_provider.force_flush()before reading SDK metrics inOTelTelemetryClient._flush_sdk_metricsand invokeflush_tracer()at the end ofrecord_usage_errorwithout shutting down the provider.record_usage_errordocstring andsrc/devops_cli/docs/generator.py, and regeneratedocs/TELEMETRY.md.test_usage_error_flushes_counter_before_exit_without_external_flushusingotlp.received(OtlpSignal.METRICS)(fails onorigin/mainwith[], passes on HEAD).Verification:
uv run pytest tests/telemetry/test_usage_errors.py tests/telemetry/test_telemetry.py -q(75 passed,100%diff coverage) anduv run devops ci --check.Closes #5220
Change:
openspec/changes/archive/2026-11-29-5220-usage-error-counter/