Skip to content

Commit

Permalink
Merge branch 'main' into fix-missing-metric-ci_pipeline_run_active
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrille-leclerc authored Sep 5, 2024
2 parents e492a21 + 77b35ef commit 5bceda6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
public abstract class AbstractMonitoringAction implements Action, OtelMonitoringAction {
private final static Logger LOGGER = Logger.getLogger(AbstractMonitoringAction.class.getName());

@CheckForNull
transient SpanAndScopes spanAndScopes;


final String traceId;
final String spanId;
protected String spanName;
Expand All @@ -50,7 +50,7 @@ public AbstractMonitoringAction(Span span, List<Scope> scopes) {
this.w3cTraceContext = w3cTraceContext;
}

LOGGER.log(Level.FINE, () -> "Span " + getSpanName() + ", thread=" + spanAndScopes.scopeStartThreadName + " opened " + spanAndScopes.scopes.size() + " scopes");
LOGGER.log(Level.FINE, () -> "Span " + getSpanName() + Optional.ofNullable(spanAndScopes).map(sas -> ", thread=" + sas.scopeStartThreadName + " opened " + sas.scopes.size() + " scopes").orElse(", null spanAndScopes") );
}

public String getSpanName() {
Expand All @@ -65,7 +65,7 @@ public Map<String, String> getW3cTraceContext() {
@Override
@CheckForNull
public Span getSpan() {
return spanAndScopes.span;
return spanAndScopes == null ? null : spanAndScopes.span;
}

public String getTraceId() {
Expand Down

0 comments on commit 5bceda6

Please sign in to comment.