appsignal / appsignal-elixir

🟪 AppSignal for Elixir package
https://www.appsignal.com/elixir
MIT License
285 stars 82 forks source link

Add set_name_if_nil helper #943

Closed tombruijn closed 6 months ago

tombruijn commented 6 months ago

Add helper to not set the name on a span if it's already set. We can use this to only set the span name (and the root span's (action) name), to not overwrite custom (action) names set by the app.

Add the name field to the span struct to avoid having to update the extension and agent to handle this logic.

Part of #869

tombruijn commented 6 months ago

This is an implementation for an Elixir Span.set_name_if_nil helper we can use. This keeps the name in the Span struct, not sure if that can be a problem/unreliable. If we prefer to have this logic to the extension let me know and I'll move it to the extension. But it's only for this integration. We don't have any other integrations use this Span API.

tombruijn commented 6 months ago

Doesn't work. Needs to be done in the extension.