-
-
Notifications
You must be signed in to change notification settings - Fork 462
Closed
Labels
BugIssue typeIssue type
Description
Description
The metric and span for a call to the metrics timing method might not have the same duration. Starting and finishing the span and measuring the duration in the aggregator for the callback use two distinct calls to get the current time. Therefore, it's highly likely that the duration of the span and the metric don't match in some cases.
sentry-java/sentry/src/main/java/io/sentry/metrics/MetricsApi.java
Lines 431 to 443 in fde534e
| final @Nullable ISpan span = aggregator.startSpanForMetric("metric.timing", key); | |
| if (span != null && tags != null) { | |
| for (final @NotNull Map.Entry<String, String> entry : tags.entrySet()) { | |
| span.setTag(entry.getKey(), entry.getValue()); | |
| } | |
| } | |
| try { | |
| aggregator | |
| .getMetricsAggregator() | |
| .timing(key, callback, durationUnit, enrichedTags, localMetricsAggregator); | |
| } finally { | |
| if (span != null) { | |
| span.finish(); |
Metadata
Metadata
Assignees
Labels
BugIssue typeIssue type
Projects
Status
Done