traces_sampler example doesn't match the actual context provided
Los mantenedores suelen responder en 2 días
@solnic ya está trabajando en esto.
Desde el 21/11/2025.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Issue Description
The docs give an example on how to adjust the sample rate depending on the context. However, it appears the example doesn't match what ultimately gets reported in the Sentry dashboard.
Reproduction Steps
Add this config from the docs and you'll see that the op is never http.server for any http requests, but instead atoms like :GET and :POST
config :sentry,
traces_sampler: fn sampling_context ->
case sampling_context.transaction_context.op do
IO.inspect(op, label: "Actual op")
"http.server" -> 0.1 # Sample 10% of HTTP requests
_ -> 0.05 # Sample 5% of other operations
end
end
Expected Behavior
Sample code should work, or docs should be updated to match what the library actually does.
Actual Behavior
100% of the traces reported by my Phoenix app show up with an op of either db or http.server on the Sentry dashboard. But the op field in the context passed to traces_sampler is always something more detailed. For example, if I issue a GET request to /health-check, this is what the context actually looks like when I inspect it.
%{
attributes: %{
"url.path": "/health-check",
"http.request.method": :GET,
"client.address": "127.0.0.1",
"network.peer.address": "127.0.0.1",
"network.peer.port": 62201,
"network.protocol.version": :"1.1",
"url.scheme": :http,
"user_agent.original": "curl/8.7.1",
"server.address": "localhost",
"server.port": 4001
},
name: :GET,
op: :GET,
trace_id: 68167592341524485616445320670865761234
}
However, in Sentry's dashboard, this shows up like this, with an op of http.server.
So if I try to filter on http.server like the example shows, it doesn't work because op doesn't become http.server until some point after the traces_sampler function runs.
The same issue for db ops. In the context, they will show up as my_app.repo.query but report as db on the dashboard.
Elixir Version
1.18.4
SDK Version
11.0.4
Integration and Its Version
No response
Sentry Config
No response
- Lenguaje dominante
- Elixir
- Estrellas
- 693
- Forks
- 218
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 21
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de getsentry/sentry-elixir
-
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
getsentry/sentry-elixir#1233 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 10/100
getsentry/sentry-elixir#1232 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Better oban error groupingQuizá libre de nuevo @solnic la tomó hace 430 días y no hay ningún pull request abierto. AbiertoElixir Errors Improvement
getsentry/sentry-elixir#936 · 1 comentario · 2 reacciones · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Custom fingerprint added to GenServer call crashes by clientQuizá libre de nuevo @solnic la tomó hace 437 días y no hay ningún pull request abierto. AbiertoBug Elixir Errors
getsentry/sentry-elixir#933 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Sentry Concurrency LimitsQuizá libre de nuevo @solnic la tomó hace 311 días y no hay ningún pull request abierto. AbiertoElixir Improvement
getsentry/sentry-elixir#932 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de getsentry/sentry-elixir
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
ci-cd
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
carverauto/serviceradar#5648 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
opentelemetry_bandit: handler is detached when a client disconnects before the request starts (get_peer_data raises :enotconn)Posiblemente ocupada @yordis la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
open-telemetry/opentelemetry-erlang-contrib#846 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100