Skip to content
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

Handle exception from observable instruments #2457

Conversation

cijothomas
Copy link
Member

If any instrument callback threw, we'd lose the entire Metrics. This PR addresses the issue.
The entire EventSource logging require a revisit later.

@cijothomas cijothomas requested a review from a team October 6, 2021 19:30
Assert.NotNull(metricPoint.Keys);
Assert.NotNull(metricPoint.Values);

metric = exportedItems[1];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even if no MetricPoints are there, we still emit the Metric. This is something to be fixed along with #2360

@codecov
Copy link

codecov bot commented Oct 6, 2021

Codecov Report

Merging #2457 (88ec3ee) into main (3d16cd8) will decrease coverage by 0.75%.
The diff coverage is 91.66%.

❗ Current head 88ec3ee differs from pull request most recent head b85952a. Consider uploading reports for the commit b85952a to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2457      +/-   ##
==========================================
- Coverage   80.06%   79.30%   -0.76%     
==========================================
  Files         251      251              
  Lines        8281     8288       +7     
==========================================
- Hits         6630     6573      -57     
- Misses       1651     1715      +64     
Impacted Files Coverage Δ
...nTelemetry/Internal/OpenTelemetrySdkEventSource.cs 74.28% <80.00%> (+2.71%) ⬆️
src/OpenTelemetry/Metrics/AggregatorStore.cs 85.60% <100.00%> (+0.10%) ⬆️
src/OpenTelemetry/Metrics/MeterProviderSdk.cs 91.47% <100.00%> (+0.15%) ⬆️
...lemetry/Metrics/AggregationTemporalityAttribute.cs 0.00% <0.00%> (-100.00%) ⬇️
.../PrometheusExporterApplicationBuilderExtensions.cs 0.00% <0.00%> (-85.72%) ⬇️
...rometheusExporterMeterProviderBuilderExtensions.cs 0.00% <0.00%> (-83.34%) ⬇️
...eus/Implementation/PrometheusExporterMiddleware.cs 0.00% <0.00%> (-81.49%) ⬇️
...elemetry.Exporter.Prometheus/PrometheusExporter.cs 50.00% <0.00%> (-29.17%) ⬇️
...us/Implementation/PrometheusExporterEventSource.cs 0.00% <0.00%> (-18.75%) ⬇️
...c/OpenTelemetry/Metrics/MeterProviderExtensions.cs 14.28% <0.00%> (-14.29%) ⬇️
... and 9 more

@cijothomas cijothomas merged commit dd6b11b into open-telemetry:main Oct 6, 2021
@cijothomas cijothomas deleted the cijothomas/observablecallbackerrorhandleing branch October 6, 2021 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants