Title: Better new integration guide in CONTRIBUTING.md · Issue #5177 · getsentry/sentry-python · GitHub
Open Graph Title: Better new integration guide in CONTRIBUTING.md · Issue #5177 · getsentry/sentry-python
X Title: Better new integration guide in CONTRIBUTING.md · Issue #5177 · getsentry/sentry-python
Description: Write a better guide on how to write a new SDK integration. Mention: relying on get_current_span() is brittle, carry the reference to the actual span around if possible scope isolation ... From @constantinius (#5177 (comment)): get_start...
Open Graph Description: Write a better guide on how to write a new SDK integration. Mention: relying on get_current_span() is brittle, carry the reference to the actual span around if possible scope isolation ... From @co...
X Description: Write a better guide on how to write a new SDK integration. Mention: relying on get_current_span() is brittle, carry the reference to the actual span around if possible scope isolation ... From @co...
Opengraph URL: https://github.com/getsentry/sentry-python/issues/5177
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Better new integration guide in CONTRIBUTING.md","articleBody":"Write a better guide on how to write a new SDK integration. Mention:\n\n- relying on `get_current_span()` is brittle, carry the reference to the actual span around if possible\n- scope isolation\n- ...\n\nFrom @constantinius (https://github.com/getsentry/sentry-python/issues/5177#issuecomment-3606430736):\n\n- `get_start_span_function()`: transaction vs spans discussion (might be absolved by span-first in the future). For invoke agent spans we tend to use transactions, when we are not already in a transaction. So use `sentry_sdk.ai.utils.get_start_span_function` for `invoke_agent` spans\n- Storing context: If there is a context object, we tend to store our Sentry specific context (current span, agent name etc) there. Otherwise, we use ContextVars, but that requires delicate handling (copying lists if we have a step)\n- Nested integrations: there's the concept of higher level and lower level integrations (e.g: OpenAI Agents vs OpenAI), which may result in double-reporting of (usually) chat spans, unless explicitly handled. We have the concept of exclusive integrations now.\n- many of the span attributes can be used on invoke_agent or chat or other spans (token usage, system/model, agent name especially). It makes sense to have some common facilities to allow for DRY code.\n- We should really come up with a list of necessary span attributes and what is the common way to express e.g a system prompt (is it part of the request messages? or shall we use the `system.message` one)\n","author":{"url":"https://github.com/sentrivana","@type":"Person","name":"sentrivana"},"datePublished":"2025-12-01T10:28:26Z","url":"https://github.com/getsentry/sentry-python/issues/5177"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f8a91fc4-fe68-89f0-b300-bed7b2adf499 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 955E:BBAAA:7BF7D6:A5AEA5:6B00DA88 |
| html-safe-nonce | 67e712fa7887db1e22bba37ff16cc841ec4f549cb48727e97fcdabb5cabcb936 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTVFOkJCQUFBOjdCRjdENjpBNUFFQTU6NkIwMERBODgiLCJ2aXNpdG9yX2lkIjoiNTgwMjQ5Nzk0OTY1MzA2NDMyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 02ce63f9f2cd56f659ed316508c9ac7328a8a416c79ab1c60f459e9d20f636a3 |
| hovercard-subject-tag | issue:3680327060 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/5177/issue_layout |
| twitter:image | https://opengraph.githubassets.com/db7b7be16971ed10e30a20f51c8da6615e6d9a25e05eeab985a330c4874add18/getsentry/sentry-python/issues/5177 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/db7b7be16971ed10e30a20f51c8da6615e6d9a25e05eeab985a330c4874add18/getsentry/sentry-python/issues/5177 |
| og:image:alt | Write a better guide on how to write a new SDK integration. Mention: relying on get_current_span() is brittle, carry the reference to the actual span around if possible scope isolation ... From @co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sentrivana |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 137814779 |
| octolytics-dimension-repository_nwo | getsentry/sentry-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137814779 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width