-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support OpenTelemetry End User attributes added as Span attributes
- Loading branch information
1 parent
fb12a4d
commit b4a152e
Showing
22 changed files
with
1,245 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...src/main/java/io/quarkus/opentelemetry/runtime/tracing/security/EndUserSpanProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.quarkus.opentelemetry.runtime.tracing.security; | ||
|
||
import jakarta.enterprise.context.Dependent; | ||
|
||
import io.opentelemetry.context.Context; | ||
import io.opentelemetry.sdk.trace.ReadWriteSpan; | ||
import io.opentelemetry.sdk.trace.ReadableSpan; | ||
import io.opentelemetry.sdk.trace.SpanProcessor; | ||
|
||
/** | ||
* Main purpose of this processor is to cover adding of the End User attributes to user-created Spans. | ||
*/ | ||
@Dependent | ||
public class EndUserSpanProcessor implements SpanProcessor { | ||
|
||
@Override | ||
public void onStart(Context context, ReadWriteSpan span) { | ||
SecurityEventUtil.addEndUserAttributes(span); | ||
} | ||
|
||
@Override | ||
public boolean isStartRequired() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void onEnd(ReadableSpan readableSpan) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean isEndRequired() { | ||
return false; | ||
} | ||
} |
Oops, something went wrong.