Skip to content

Add ability to customize span names for TraceLayer #470

Answered by jplatte
horseinthesky asked this question in Q&A
Discussion options

You must be logged in to vote

I mean that the GET /api/devices string from your previous screenshot is not the tracing span's .metadata()?.name(). And indeed I think I found how it works: If there is a field named otel.name on the span, that's used in the Name column. Try writing something like this for make_span_with:

let name = format!("{whatever} {you} {want}");
info_span!(
    "request",
    otel.name = name,
    extra_field = value,
)

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@horseinthesky
Comment options

@jplatte
Comment options

jplatte Feb 29, 2024
Collaborator

@horseinthesky
Comment options

@jplatte
Comment options

jplatte Feb 29, 2024
Collaborator

Answer selected by horseinthesky
@horseinthesky
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #469 on February 17, 2024 13:50.