traces_sampler example doesn't match the actual context provided
I maintainer di solito rispondono entro 2 giorni
@solnic ci sta già lavorando.
Dal 21/11/2025.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Lingua principale
- Elixir
- Stelle
- 694
- Fork
- 217
- Merge medio
- 2g 6h
- PR unite (30g)
- 20
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/sentry-elixir
-
Bug Elixir Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
getsentry/sentry-elixir#1242 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
getsentry/sentry-elixir#1233 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 10/100
getsentry/sentry-elixir#1232 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Better oban error groupingForse di nuovo libera @solnic l’ha presa 428 giorni fa e non c’è nessuna pull request aperta. ApertaElixir Errors Improvement
getsentry/sentry-elixir#936 · 1 commento · 2 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Custom fingerprint added to GenServer call crashes by clientForse di nuovo libera @solnic l’ha presa 435 giorni fa e non c’è nessuna pull request aperta. ApertaBug Elixir Errors
getsentry/sentry-elixir#933 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di getsentry/sentry-elixir
Issue simili
-
ci-cd
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
carverauto/serviceradar#5648 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-telemetry/opentelemetry-erlang-contrib#846 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
electric-sql/electric#4830 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno