-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathScopeEvent.java
More file actions
40 lines (33 loc) · 912 Bytes
/
ScopeEvent.java
File metadata and controls
40 lines (33 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.contrib.jfrevent;
import io.opentelemetry.api.trace.SpanContext;
import jdk.jfr.Category;
import jdk.jfr.Description;
import jdk.jfr.Event;
import jdk.jfr.Label;
import jdk.jfr.Name;
@Name("io.opentelemetry.context.Scope")
@Label("Scope")
@Category("Open Telemetry Tracing")
@Description(
"Open Telemetry trace event corresponding to the span currently "
+ "in scope/active on this thread.")
class ScopeEvent extends Event {
@Contextual private final String traceId;
private final String spanId;
ScopeEvent(SpanContext spanContext) {
this.traceId = spanContext.getTraceId();
this.spanId = spanContext.getSpanId();
}
@Label("Trace Id")
public String getTraceId() {
return traceId;
}
@Label("Span Id")
public String getSpanId() {
return spanId;
}
}