getsentry / sentry-elixir

The official Elixir SDK for Sentry (sentry.io)
https://sentry.io
MIT License
627 stars 185 forks source link

Support for Traces/Transactions via Opentelemetry #784

Open solnic opened 2 months ago

solnic commented 2 months ago

This adds support for Traces via Opentelemetry integration, handled by our custom Sentry.Opentelemetry.SpanProcessor which accumulates spans and turns them into hierarchical transactions that are then sent to Sentry.

For this to work the following deps must be added to an app:

{:opentelemetry, "~> 1.4"},
{:opentelemetry_api, "~> 1.3"}

Furthermore, Opentelemetry needs to be configured with our SpanProcessor:

config :opentelemetry, span_processor: {Sentry.Opentelemetry.SpanProcessor, []}

The rest will automagically work.

Supported opentelemetry packages

This initial implementation supports the following Opentelemetry packages:

Considerations

Screenshots

Screenshot 2024-09-24 at 17 54 07 Screenshot 2024-09-24 at 17 55 13 Screenshot 2024-09-24 at 19 12 50 Screenshot 2024-09-27 at 16 07 49 Screenshot 2024-09-27 at 16 07 21
whatyouhide commented 1 month ago

@solnic can you rebase this one now that #797 has been merged? Gonna make it easier to review I think 😄

solnic commented 1 month ago

@solnic can you rebase this one now that #797 has been merged? Gonna make it easier to review I think 😄

@whatyouhide done!

yordis commented 2 weeks ago

@whatyouhide are you adding support for the otel propagator map from #820 I am failing to see where it is being done