Skip to content

Commit 1b09291

Browse files
feat(python): non-experimental metrics options (#15367)
Remove setup requirements since the Python SDK no longer requires an explicit opt-in when initializing the SDK. Bump the minimum SDK version to 2.44.0. Reference only non-experimental options.
1 parent b53f21d commit 1b09291

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

docs/platforms/python/metrics/index.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ With Sentry Metrics, you can send counters, gauges and distributions from your a
1717

1818
<PlatformContent includePath="metrics/requirements" />
1919

20-
## Setup
21-
22-
<PlatformContent includePath="metrics/setup" />
23-
2420
## Usage
2521

2622
<PlatformContent includePath="metrics/usage" />

platform-includes/metrics/options/python.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ def before_metric(metric: Metric, _hint: Hint) -> Optional[Metric]:
1616

1717
sentry_sdk.init(
1818
dsn="___PUBLIC_DSN___",
19-
_experiments={
20-
"enable_metrics": True,
21-
"before_send_metric": before_metric,
22-
},
19+
before_send_metric=before_metric,
2320
)
2421
```
2522

@@ -30,7 +27,8 @@ The metric dict has the following keys:
3027
- `name`: (`str`) The name of the metric.
3128
- `type`: (`str` - one of `counter`, `gauge`, `distribution`) The type of metric.
3229
- `value`: (`float`) The numeric value of the metric.
33-
- `unit`: (`int`) The unit of measurement for the metric value.
30+
- `unit`: (`Optional[str]`) The unit of measurement for the metric value.
3431
- `attributes`: (`dict[str, str | bool | float | int]`) Additional attributes to be sent with the metric.
3532
- `timestamp`: (`float`) Timestamp in seconds (epoch time) indicating when the metric was recorded.
3633
- `trace_id`: (`Optional[str]`) The trace ID of the trace this metric belongs to.
34+
- `span_id`: (`Optional[str]`) The span id of the span that was active when the metric was emitted.

platform-includes/metrics/requirements/python.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Metrics for Python are supported in Sentry Python SDK version `2.43.0` and above.
1+
Metrics for Python are supported in Sentry Python SDK version `2.44.0` and above.
22

33
```bash {tabTitle:pip}
44
pip install "sentry-sdk"

platform-includes/metrics/setup/python.mdx

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)