Skip to content

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented Jul 28, 2025

Adding a 3.x version of the Span Metrics page. The contents are identical except for changing 2.x-style set_data() to 3.x-style set_attribute().

Since the 3.x page is a brand new file, it shows up all green on the diff. This is the actual difference between the old page and the new index__v3.x.mdx page:

--- index.mdx   2025-07-21 14:06:41
+++ index__v3.x.mdx     2025-07-28 09:44:24
@@ -23,11 +23,11 @@
 span = sentry_sdk.get_current_span()
 if span:
     # Add individual metrics
-    span.set_data("database.rows_affected", 42)
-    span.set_data("cache.hit_rate", 0.85)
-    span.set_data("memory.heap_used", 1024000)
-    span.set_data("queue.length", 15)
-    span.set_data("processing.duration_ms", 127)
+    span.set_attribute("database.rows_affected", 42)
+    span.set_attribute("cache.hit_rate", 0.85)
+    span.set_attribute("memory.heap_used", 1024000)
+    span.set_attribute("queue.length", 15)
+    span.set_attribute("processing.duration_ms", 127)
 
 ### Best Practices for Span Data
@@ -48,11 +48,11 @@
     name="Database Query Metrics"
 ) as span:
     # Set metrics after creating the span
-    span.set_data("db.query_type", "SELECT")
-    span.set_data("db.table", "users")
-    span.set_data("db.execution_time_ms", 45)
-    span.set_data("db.rows_returned", 100)
-    span.set_data("db.connection_pool_size", 5)
+    span.set_attribute("db.query_type", "SELECT")
+    span.set_attribute("db.table", "users")
+    span.set_attribute("db.execution_time_ms", 45)
+    span.set_attribute("db.rows_returned", 100)
+    span.set_attribute("db.connection_pool_size", 5)
     # Your database operation here
     pass

Direct link to preview: https://sentry-docs-git-ivana-pythonupdate-span-metrics-page-for-3x.sentry.dev/platforms/python/tracing/span-metrics__v3.x

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

LEGAL BOILERPLATE

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

EXTRA RESOURCES

Copy link

vercel bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 8:05am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
develop-docs ⬜️ Ignored (Inspect) Jul 28, 2025 8:05am

Copy link

codecov bot commented Jul 28, 2025

Bundle Report

Changes will increase total bundle size by 594 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 9.85MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.26MB 600 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.75MB -0.0%
../instrumentation.js -3 bytes 1.08MB -0.0%
9523.js -3 bytes 1.05MB -0.0%
../app/[[...path]]/page.js.nft.json 203 bytes 730.34kB 0.03%
../app/platform-redirect/page.js.nft.json 203 bytes 730.25kB 0.03%
../app/sitemap.xml/route.js.nft.json 203 bytes 727.73kB 0.03%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 879.71kB -0.0%
static/chunks/1831-*.js -3 bytes 422.23kB -0.0%
static/LW1xRpTNNDSD7U6dY4gk9/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/LW1xRpTNNDSD7U6dY4gk9/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/H1tARDcgjhLM9ELQMxuxs/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/H1tARDcgjhLM9ELQMxuxs/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

@sentrivana sentrivana marked this pull request as ready for review July 28, 2025 08:55
@sentrivana sentrivana requested review from a team July 28, 2025 08:55
@sentrivana sentrivana merged commit 75ed094 into master Jul 29, 2025
13 checks passed
@sentrivana sentrivana deleted the ivana/python/update-span-metrics-page-for-3.x branch July 29, 2025 09:12
lucas-zimerman pushed a commit that referenced this pull request Jul 29, 2025
Adding a 3.x version of the Span Metrics page. The contents are
identical except for changing 2.x-style `set_data()` to 3.x-style
`set_attribute()`.

Since the 3.x page is a brand new file, it shows up all green on the
diff. This is the actual difference between the old page and the new
`index__v3.x.mdx` page:

```diff
--- index.mdx   2025-07-21 14:06:41
+++ index__v3.x.mdx     2025-07-28 09:44:24
@@ -23,11 +23,11 @@
 span = sentry_sdk.get_current_span()
 if span:
     # Add individual metrics
-    span.set_data("database.rows_affected", 42)
-    span.set_data("cache.hit_rate", 0.85)
-    span.set_data("memory.heap_used", 1024000)
-    span.set_data("queue.length", 15)
-    span.set_data("processing.duration_ms", 127)
+    span.set_attribute("database.rows_affected", 42)
+    span.set_attribute("cache.hit_rate", 0.85)
+    span.set_attribute("memory.heap_used", 1024000)
+    span.set_attribute("queue.length", 15)
+    span.set_attribute("processing.duration_ms", 127)
 
 ### Best Practices for Span Data
@@ -48,11 +48,11 @@
     name="Database Query Metrics"
 ) as span:
     # Set metrics after creating the span
-    span.set_data("db.query_type", "SELECT")
-    span.set_data("db.table", "users")
-    span.set_data("db.execution_time_ms", 45)
-    span.set_data("db.rows_returned", 100)
-    span.set_data("db.connection_pool_size", 5)
+    span.set_attribute("db.query_type", "SELECT")
+    span.set_attribute("db.table", "users")
+    span.set_attribute("db.execution_time_ms", 45)
+    span.set_attribute("db.rows_returned", 100)
+    span.set_attribute("db.connection_pool_size", 5)
     # Your database operation here
     pass
```
@github-actions github-actions bot locked and limited conversation to collaborators Aug 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants