traces_sampler example doesn't match the actual context provided
メンテナーはふだん 2 日以内に返信
@solnic がすでに取り組んでいます。
2025年11月21日 から。
評価
この issue はまだ評価されていません。
説明
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
- 主要言語
- Elixir
- スター
- 693
- フォーク
- 218
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getsentry/sentry-elixir のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
getsentry/sentry-elixir#1233 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 10/100
getsentry/sentry-elixir#1232 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Better oban error grouping再び着手できるかも @solnic が 435 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンElixir Errors Improvement
getsentry/sentry-elixir#936 · コメント 1 件 · リアクション 2 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Custom fingerprint added to GenServer call crashes by client再び着手できるかも @solnic が 442 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンBug Elixir Errors
getsentry/sentry-elixir#933 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Sentry Concurrency Limits再び着手できるかも @solnic が 316 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンElixir Improvement
getsentry/sentry-elixir#932 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
getsentry/sentry-elixir の issue をすべて見る
似ている issue
-
moderation phoenix/webdev
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
beyond-all-reason/teiserver#1694 ·
メンテナーはふだん 1 日以内に返信
-
api csv
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
blockscout/blockscout#14966 ·
メンテナーはふだん 1 日以内に返信
-
Assigns view shows list and tuple elements in sorted order instead of their real order対応中かも @RaphaelFakhri が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
software-mansion/live-debugger#1011 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
edgehog-device-manager/edgehog#1711 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
hexlet-codebattle/codebattle#2362 ·