sentry-elixir
sentry-elixir copied to clipboard
Support for Traces/Transactions via Opentelemetry
⚠️ this is currently built on top of #797 - I'll rebase once it's merged
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:
-
opentelemetry_phoenix -
opentelemetry_bandit -
opentelemetry_ecto
Considerations
- Should we add new deps as sentry deps instead of having people add them manually to their mix.exs?
- Would it make sense to try to pre-configure opentelemetry automatically?
- Which other opentelemetry_* packages do we want to support initially?
- Should we support top-level ecto events that occur when ie Ecto tries to create migrations table, or checks migrations? (I think we should ignore them, FWIW)