Skip to content

Commit

Permalink
Continue processing async instruments if callback fails (#2614)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzchen committed Apr 19, 2022
1 parent bfeb4b8 commit dd56e7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.11.0-0.30b0...HEAD)

- Fix unhandled callback exceptions on async instruments
([#2614](https://github.com/open-telemetry/opentelemetry-python/pull/2614))
- Rename `DefaultCounter`, `DefaultHistogram`, `DefaultObservableCounter`,
`DefaultObservableGauge`, `DefaultObservableUpDownCounter`, `DefaultUpDownCounter`
instruments to `NoOpCounter`, `NoOpHistogram`, `NoOpObservableCounter`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def callback(self) -> Iterable[Measurement]:
)
except StopIteration:
pass
except Exception: # pylint: disable=broad-except
_logger.exception(
"Callback failed for instrument %s.", self.name
)


class Counter(_Synchronous, APICounter):
Expand Down

0 comments on commit dd56e7f

Please sign in to comment.