Skip to content

Commit

Permalink
hotfix: make startSpan-action more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
EddeCCC committed Nov 22, 2024
1 parent b367a60 commit 386b2e7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ public class SpanAction {
*/
public Optional<AutoCloseable> startSpan(MethodExecutionContext executionContext) {
String spanName = getSpanName(executionContext);
Attributes methodAttributes = SpanUtil.createMethodAttributes(executionContext);
Attributes methodAttributes;
try {
methodAttributes = SpanUtil.createMethodAttributes(executionContext);
} catch (Exception e) {
log.warn("Failed to read method attributes: {}", e.getMessage());
methodAttributes = Attributes.empty();
}

// Use the OTel span
if (SpanUtil.spanAlreadyExists(spanName)) {
Expand Down

0 comments on commit 386b2e7

Please sign in to comment.