Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cursor/rules/metrics.mdc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
alwaysApply: false
description: Metrics
description: Metrics API
---
# Java SDK Metrics
# Java SDK Metrics API

Metrics are enabled by default.

Expand Down
8 changes: 8 additions & 0 deletions sentry/src/main/java/io/sentry/SentryMetricsEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ public void setSpanId(final @Nullable SpanId spanId) {
this.spanId = spanId;
}

public @Nullable SentryId getTraceId() {
return traceId;
}

public void setTraceId(final @Nullable SentryId traceId) {
this.traceId = traceId;
}

public @NotNull Double getValue() {
return value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public class LoggerBatchProcessor implements ILoggerBatchProcessor {
private final @NotNull Queue<SentryLogEvent> queue;
private final @NotNull ISentryExecutorService executorService;
private volatile @Nullable Future<?> scheduledFlush;
private static final @NotNull AutoClosableReentrantLock scheduleLock =
new AutoClosableReentrantLock();
private final @NotNull AutoClosableReentrantLock scheduleLock = new AutoClosableReentrantLock();
private volatile boolean hasScheduled = false;

private final @NotNull ReusableCountLatch pendingCount = new ReusableCountLatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public class MetricsBatchProcessor implements IMetricsBatchProcessor {
private final @NotNull Queue<SentryMetricsEvent> queue;
private final @NotNull ISentryExecutorService executorService;
private volatile @Nullable Future<?> scheduledFlush;
private static final @NotNull AutoClosableReentrantLock scheduleLock =
new AutoClosableReentrantLock();
private final @NotNull AutoClosableReentrantLock scheduleLock = new AutoClosableReentrantLock();
private volatile boolean hasScheduled = false;
private volatile boolean isShuttingDown = false;

Expand Down