From 2eaf71a78689cf144ff6a54c043cbfb0e42b63ac Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 23 Oct 2025 12:01:05 +0200 Subject: [PATCH 01/16] feat(python): Document metrics --- docs/platforms/python/metrics/index.mdx | 28 +++++++++++++++ includes/metrics/default-attributes/core.mdx | 7 ++++ .../metrics/default-attributes/server.mdx | 3 ++ includes/metrics/default-attributes/user.mdx | 7 ++++ .../metrics/default-attributes/python.mdx | 7 ++++ platform-includes/metrics/options/python.mdx | 35 +++++++++++++++++++ .../metrics/requirements/python.mdx | 9 +++++ platform-includes/metrics/setup/python.mdx | 10 ++++++ platform-includes/metrics/usage/python.mdx | 26 ++++++++++++++ 9 files changed, 132 insertions(+) create mode 100644 docs/platforms/python/metrics/index.mdx create mode 100644 includes/metrics/default-attributes/core.mdx create mode 100644 includes/metrics/default-attributes/server.mdx create mode 100644 includes/metrics/default-attributes/user.mdx create mode 100644 platform-includes/metrics/default-attributes/python.mdx create mode 100644 platform-includes/metrics/options/python.mdx create mode 100644 platform-includes/metrics/requirements/python.mdx create mode 100644 platform-includes/metrics/setup/python.mdx create mode 100644 platform-includes/metrics/usage/python.mdx diff --git a/docs/platforms/python/metrics/index.mdx b/docs/platforms/python/metrics/index.mdx new file mode 100644 index 0000000000000..78089553a5254 --- /dev/null +++ b/docs/platforms/python/metrics/index.mdx @@ -0,0 +1,28 @@ +--- +title: Set Up Metrics +sidebar_title: Metrics +description: "Metrics allow you to send, view and query counts and measurements sent from your applications within Sentry." +sidebar_order: 5755 +--- + +With Sentry Metrics, you can send numeric counts and measurements from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors. + +## Requirements + + + +## Setup + + + +## Usage + + + +## Options + + + +## Default Attributes + + diff --git a/includes/metrics/default-attributes/core.mdx b/includes/metrics/default-attributes/core.mdx new file mode 100644 index 0000000000000..6d5523b05538a --- /dev/null +++ b/includes/metrics/default-attributes/core.mdx @@ -0,0 +1,7 @@ +### Core Attributes + +- `environment`: The environment set in the SDK if defined. This is sent from the SDK as `sentry.environment`. +- `release`: The release set in the SDK if defined. This is sent from the SDK as `sentry.release`. +- `trace.parent_span_id`: The span ID of the span that was active when the metric was collected (only set if there was an active span). This is sent from the SDK as `sentry.trace.parent_span_id`. +- `sdk.name`: The name of the SDK that sent the metric. This is sent from the SDK as `sentry.sdk.name`. +- `sdk.version`: The version of the SDK that sent the metric. This is sent from the SDK as `sentry.sdk.version`. diff --git a/includes/metrics/default-attributes/server.mdx b/includes/metrics/default-attributes/server.mdx new file mode 100644 index 0000000000000..537849aab220b --- /dev/null +++ b/includes/metrics/default-attributes/server.mdx @@ -0,0 +1,3 @@ +### Server Attributes + +- `server.address`: The address of the server that sent the metric. Equivalent to `server_name` that gets attached to Sentry errors. diff --git a/includes/metrics/default-attributes/user.mdx b/includes/metrics/default-attributes/user.mdx new file mode 100644 index 0000000000000..3dd200514a22a --- /dev/null +++ b/includes/metrics/default-attributes/user.mdx @@ -0,0 +1,7 @@ +### User Attributes + +If user information is available in the current scope, the following attributes are added to the metric: + +- `user.id`: The user ID. +- `user.name`: The username. +- `user.email`: The email address. diff --git a/platform-includes/metrics/default-attributes/python.mdx b/platform-includes/metrics/default-attributes/python.mdx new file mode 100644 index 0000000000000..3760c00357939 --- /dev/null +++ b/platform-includes/metrics/default-attributes/python.mdx @@ -0,0 +1,7 @@ +The Python SDK automatically sets several default attributes on all metrics to provide context and improve debugging: + + + + + + diff --git a/platform-includes/metrics/options/python.mdx b/platform-includes/metrics/options/python.mdx new file mode 100644 index 0000000000000..99db19675ab30 --- /dev/null +++ b/platform-includes/metrics/options/python.mdx @@ -0,0 +1,35 @@ +#### before_send_log + +To filter logs, or update them before they are sent to Sentry, you can use the `before_send_metric` option. + +```python +import sentry_sdk +from sentry_sdk.types import Metric, Hint +from typing import Optional + +def before_metric(metric: Metric, _hint: Hint) -> Optional[Metric]: + # Filter out all info level logs + if log["severity_text"] == "info": + return None + return log + +sentry_sdk.init( + dsn="___PUBLIC_DSN___", + _experiments={ + "enable_metrics": True, + "before_send_metric": _before_metric, + }, +) +``` + +The `before_send_metric` function receives a metric object, and should return the metric object if you want it to be sent to Sentry, or `None` if you want to discard it. + +The metric dict has the following keys: + +- `name`: (`str`) The name of the metric. +- `type`: (`str` - one of `counter`, `gauge`, `distribution`) The type of metric. +- `value`: (`float`) The numeric value of the metric. +- `unit`: (`int`) The unit of measurement for the metric value. +- `attributes`: (`dict[str, str | bool | float | int]`) Additional attributes to be sent with the log. +- `timestamp`: (`float`) Timestamp in seconds (epoch time) indicating when the metric was recorded. +- `trace_id`: (`Optional[str]`) The trace ID of the trace this metric belongs to. diff --git a/platform-includes/metrics/requirements/python.mdx b/platform-includes/metrics/requirements/python.mdx new file mode 100644 index 0000000000000..584999882274d --- /dev/null +++ b/platform-includes/metrics/requirements/python.mdx @@ -0,0 +1,9 @@ +Metrics for Python are supported in Sentry Python SDK version `-.-.-` and above. + +```bash {tabTitle:pip} +pip install "sentry-sdk" +``` + +```bash {tabTitle:uv} +uv add "sentry-sdk" +``` diff --git a/platform-includes/metrics/setup/python.mdx b/platform-includes/metrics/setup/python.mdx new file mode 100644 index 0000000000000..50c876f8ee41f --- /dev/null +++ b/platform-includes/metrics/setup/python.mdx @@ -0,0 +1,10 @@ +To enable metrics, you need to initialize the SDK with the `enable_metrics` option set to `True`. + +```python +sentry_sdk.init( + dsn="___PUBLIC_DSN___", + _experiments={ + enable_metrics=True, + }, +) +``` diff --git a/platform-includes/metrics/usage/python.mdx b/platform-includes/metrics/usage/python.mdx new file mode 100644 index 0000000000000..1773429208dd1 --- /dev/null +++ b/platform-includes/metrics/usage/python.mdx @@ -0,0 +1,26 @@ +Once the feature is enabled on the SDK and the SDK is initialized, you can send metrics using the `sentry_sdk.metrics` APIs. + +The `metrics` namespace exposes three methods that you can use to capture different types of metric information: `count`, `gauge`, and `distribution`. + +```python +from sentry_sdk import metrics + +metrics.count("test.counter", 1) +metrics.gauge("test.gauge", 42) +metrics.distribution("test.distribution", 200) +``` + +You can also pass additional attributes directly to `count`, `gauge`, and `distribution` via the `attributes` kwarg. + +```python +from sentry_sdk import metrics + +metrics.count( + "test.counter", + 1, + attributes={ + "endpoint": "/api/test", + "status": "success" + }, +) +``` From 48dc13f4acac4a0065c7992116bd6c7cd7a67b17 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 23 Oct 2025 12:03:58 +0200 Subject: [PATCH 02/16] . --- docs/platforms/python/metrics/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/python/metrics/index.mdx b/docs/platforms/python/metrics/index.mdx index 78089553a5254..fb852b3cd93ed 100644 --- a/docs/platforms/python/metrics/index.mdx +++ b/docs/platforms/python/metrics/index.mdx @@ -5,7 +5,7 @@ description: "Metrics allow you to send, view and query counts and measurements sidebar_order: 5755 --- -With Sentry Metrics, you can send numeric counts and measurements from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors. +With Sentry Metrics, you can send numeric counts and measurements from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. ## Requirements From 2438b7835afc1e640c2788158d4bcc8f590896db Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 23 Oct 2025 22:33:59 +0200 Subject: [PATCH 03/16] . --- platform-includes/metrics/default-attributes/python.mdx | 6 +++--- platform-includes/metrics/options/python.mdx | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/platform-includes/metrics/default-attributes/python.mdx b/platform-includes/metrics/default-attributes/python.mdx index 3760c00357939..f3ee0a14b486a 100644 --- a/platform-includes/metrics/default-attributes/python.mdx +++ b/platform-includes/metrics/default-attributes/python.mdx @@ -1,7 +1,7 @@ The Python SDK automatically sets several default attributes on all metrics to provide context and improve debugging: - + - + - + diff --git a/platform-includes/metrics/options/python.mdx b/platform-includes/metrics/options/python.mdx index 99db19675ab30..81e45b168959a 100644 --- a/platform-includes/metrics/options/python.mdx +++ b/platform-includes/metrics/options/python.mdx @@ -1,6 +1,6 @@ #### before_send_log -To filter logs, or update them before they are sent to Sentry, you can use the `before_send_metric` option. +To filter metrics, or update them before they are sent to Sentry, you can use the `before_send_metric` option. ```python import sentry_sdk @@ -8,10 +8,11 @@ from sentry_sdk.types import Metric, Hint from typing import Optional def before_metric(metric: Metric, _hint: Hint) -> Optional[Metric]: - # Filter out all info level logs - if log["severity_text"] == "info": + # Filter out all metrics with a certain name + if record["name"] == "test.skip": return None - return log + + return metric sentry_sdk.init( dsn="___PUBLIC_DSN___", From db3ad6b65d0972ca6a3a7663fd6ab9b5b54de334 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 23 Oct 2025 22:37:18 +0200 Subject: [PATCH 04/16] remove redirect --- src/middleware.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/middleware.ts b/src/middleware.ts index 19ed89f303fcf..6a2ceaa9d20d8 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1766,10 +1766,6 @@ const USER_DOCS_REDIRECTS: Redirect[] = [ to: '/platforms/javascript/guides/:guide/opentelemetry/', }, // START redirecting deprecated generic metrics docs to concepts - { - from: '/platforms/python/metrics/', - to: '/platforms/python/tracing/span-metrics/', - }, { from: '/platforms/ruby/metrics/', to: '/concepts/key-terms/tracing/span-metrics/', From d501e05fdd33aed87977ffccae9edc54d538f34a Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 23 Oct 2025 22:42:14 +0200 Subject: [PATCH 05/16] . --- platform-includes/metrics/setup/python.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/metrics/setup/python.mdx b/platform-includes/metrics/setup/python.mdx index 50c876f8ee41f..2f6c90d04b9a9 100644 --- a/platform-includes/metrics/setup/python.mdx +++ b/platform-includes/metrics/setup/python.mdx @@ -4,7 +4,7 @@ To enable metrics, you need to initialize the SDK with the `enable_metrics` opti sentry_sdk.init( dsn="___PUBLIC_DSN___", _experiments={ - enable_metrics=True, + enable_metrics: True, }, ) ``` From 17b3ef86c5fed1d622cbba19c685bc36795c456c Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Fri, 24 Oct 2025 08:33:36 +0200 Subject: [PATCH 06/16] remove duplicate --- docs/platforms/python/metrics/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/python/metrics/index.mdx b/docs/platforms/python/metrics/index.mdx index fb852b3cd93ed..27ca9d1b1b1c1 100644 --- a/docs/platforms/python/metrics/index.mdx +++ b/docs/platforms/python/metrics/index.mdx @@ -5,7 +5,7 @@ description: "Metrics allow you to send, view and query counts and measurements sidebar_order: 5755 --- -With Sentry Metrics, you can send numeric counts and measurements from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. +With Sentry Metrics, you can send numeric counts and measurements from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. ## Requirements From 3d6ee2dbab88ee18387ea56d5ba77230c8be6fac Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Fri, 24 Oct 2025 08:36:01 +0200 Subject: [PATCH 07/16] . --- platform-includes/metrics/options/python.mdx | 4 ++-- platform-includes/metrics/usage/python.mdx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform-includes/metrics/options/python.mdx b/platform-includes/metrics/options/python.mdx index 81e45b168959a..3b7b19da9bb44 100644 --- a/platform-includes/metrics/options/python.mdx +++ b/platform-includes/metrics/options/python.mdx @@ -1,4 +1,4 @@ -#### before_send_log +#### before_send_metric To filter metrics, or update them before they are sent to Sentry, you can use the `before_send_metric` option. @@ -31,6 +31,6 @@ The metric dict has the following keys: - `type`: (`str` - one of `counter`, `gauge`, `distribution`) The type of metric. - `value`: (`float`) The numeric value of the metric. - `unit`: (`int`) The unit of measurement for the metric value. -- `attributes`: (`dict[str, str | bool | float | int]`) Additional attributes to be sent with the log. +- `attributes`: (`dict[str, str | bool | float | int]`) Additional attributes to be sent with the metric. - `timestamp`: (`float`) Timestamp in seconds (epoch time) indicating when the metric was recorded. - `trace_id`: (`Optional[str]`) The trace ID of the trace this metric belongs to. diff --git a/platform-includes/metrics/usage/python.mdx b/platform-includes/metrics/usage/python.mdx index 1773429208dd1..d0d5cfecec382 100644 --- a/platform-includes/metrics/usage/python.mdx +++ b/platform-includes/metrics/usage/python.mdx @@ -20,7 +20,7 @@ metrics.count( 1, attributes={ "endpoint": "/api/test", - "status": "success" + "status": "success", }, ) ``` From 7e34ad24b5d64533f86459e088d29e0a1247d7e6 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 29 Oct 2025 14:36:27 +0100 Subject: [PATCH 08/16] fix snippet --- platform-includes/metrics/options/python.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/metrics/options/python.mdx b/platform-includes/metrics/options/python.mdx index 3b7b19da9bb44..675c8a1a24ae9 100644 --- a/platform-includes/metrics/options/python.mdx +++ b/platform-includes/metrics/options/python.mdx @@ -18,7 +18,7 @@ sentry_sdk.init( dsn="___PUBLIC_DSN___", _experiments={ "enable_metrics": True, - "before_send_metric": _before_metric, + "before_send_metric": before_metric, }, ) ``` From 659384b22d029a59a03fcd36efde6a199305c2ea Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 29 Oct 2025 14:38:45 +0100 Subject: [PATCH 09/16] simplify --- docs/platforms/python/metrics/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/python/metrics/index.mdx b/docs/platforms/python/metrics/index.mdx index 27ca9d1b1b1c1..e9a6b5c216a77 100644 --- a/docs/platforms/python/metrics/index.mdx +++ b/docs/platforms/python/metrics/index.mdx @@ -5,7 +5,7 @@ description: "Metrics allow you to send, view and query counts and measurements sidebar_order: 5755 --- -With Sentry Metrics, you can send numeric counts and measurements from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. +With Sentry Metrics, you can send counts, measurements, and distributions from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. ## Requirements From 6f72644d8dc399b4f25a586cfbc8d8c485b47e86 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 29 Oct 2025 14:40:28 +0100 Subject: [PATCH 10/16] update requirement --- platform-includes/metrics/requirements/python.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/metrics/requirements/python.mdx b/platform-includes/metrics/requirements/python.mdx index 584999882274d..2761e66ebf0a0 100644 --- a/platform-includes/metrics/requirements/python.mdx +++ b/platform-includes/metrics/requirements/python.mdx @@ -1,4 +1,4 @@ -Metrics for Python are supported in Sentry Python SDK version `-.-.-` and above. +Metrics for Python are supported in Sentry Python SDK version `2.43.0` and above. ```bash {tabTitle:pip} pip install "sentry-sdk" From 973daae22692fdf0466a501e0a2eb51b316a1075 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 29 Oct 2025 14:45:26 +0100 Subject: [PATCH 11/16] snippet --- platform-includes/metrics/options/python.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/metrics/options/python.mdx b/platform-includes/metrics/options/python.mdx index 675c8a1a24ae9..d0240fe82e132 100644 --- a/platform-includes/metrics/options/python.mdx +++ b/platform-includes/metrics/options/python.mdx @@ -9,7 +9,7 @@ from typing import Optional def before_metric(metric: Metric, _hint: Hint) -> Optional[Metric]: # Filter out all metrics with a certain name - if record["name"] == "test.skip": + if metric["name"] == "test.skip": return None return metric From cc376faa1aaf6de0efa118a208f57beebea0fe59 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 29 Oct 2025 14:59:14 +0100 Subject: [PATCH 12/16] improve snippets --- platform-includes/metrics/options/python.mdx | 4 ++-- platform-includes/metrics/usage/python.mdx | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/platform-includes/metrics/options/python.mdx b/platform-includes/metrics/options/python.mdx index d0240fe82e132..c4b1065a903ce 100644 --- a/platform-includes/metrics/options/python.mdx +++ b/platform-includes/metrics/options/python.mdx @@ -8,8 +8,8 @@ from sentry_sdk.types import Metric, Hint from typing import Optional def before_metric(metric: Metric, _hint: Hint) -> Optional[Metric]: - # Filter out all metrics with a certain name - if metric["name"] == "test.skip": + # Filter out all failed checkouts on the acme tenant + if metric["name"] == "checkout.failed" and metric["attributes"].get("tenant") == "acme": return None return metric diff --git a/platform-includes/metrics/usage/python.mdx b/platform-includes/metrics/usage/python.mdx index d0d5cfecec382..f295e3070b745 100644 --- a/platform-includes/metrics/usage/python.mdx +++ b/platform-includes/metrics/usage/python.mdx @@ -5,9 +5,9 @@ The `metrics` namespace exposes three methods that you can use to capture differ ```python from sentry_sdk import metrics -metrics.count("test.counter", 1) -metrics.gauge("test.gauge", 42) -metrics.distribution("test.distribution", 200) +metrics.count("checkout.failed", 1) +metrics.gauge("queue.depth", 42) +metrics.distribution("cart.amount_usd", 187.5) ``` You can also pass additional attributes directly to `count`, `gauge`, and `distribution` via the `attributes` kwarg. @@ -16,11 +16,12 @@ You can also pass additional attributes directly to `count`, `gauge`, and `distr from sentry_sdk import metrics metrics.count( - "test.counter", + "checkout.failed", 1, - attributes={ - "endpoint": "/api/test", - "status": "success", + "attributes": { + "route": "/checkout", + "tenant": "acme", + "provider": "stripe", }, ) ``` From 94a8623e1b1a999603ed7ff5b50d30aec3d5b9bf Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 29 Oct 2025 16:36:40 +0100 Subject: [PATCH 13/16] . --- docs/platforms/python/metrics/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/python/metrics/index.mdx b/docs/platforms/python/metrics/index.mdx index e9a6b5c216a77..87bd030f2774b 100644 --- a/docs/platforms/python/metrics/index.mdx +++ b/docs/platforms/python/metrics/index.mdx @@ -1,11 +1,11 @@ --- title: Set Up Metrics sidebar_title: Metrics -description: "Metrics allow you to send, view and query counts and measurements sent from your applications within Sentry." +description: "Metrics allow you to send, view and query counters, gauges and measurements sent from your applications within Sentry." sidebar_order: 5755 --- -With Sentry Metrics, you can send counts, measurements, and distributions from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. +With Sentry Metrics, you can send counters, gauges, and distributions from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. ## Requirements From 4dd0114227e3bbf82495dfad85aa4b0b850d0787 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 29 Oct 2025 16:37:16 +0100 Subject: [PATCH 14/16] . --- docs/platforms/python/metrics/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/python/metrics/index.mdx b/docs/platforms/python/metrics/index.mdx index 87bd030f2774b..0e6b15fd5c929 100644 --- a/docs/platforms/python/metrics/index.mdx +++ b/docs/platforms/python/metrics/index.mdx @@ -5,7 +5,7 @@ description: "Metrics allow you to send, view and query counters, gauges and mea sidebar_order: 5755 --- -With Sentry Metrics, you can send counters, gauges, and distributions from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. +With Sentry Metrics, you can send counters, gauges and distributions from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. ## Requirements From 7324695c208025154ab7a21093cee00db8035ac2 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 30 Oct 2025 13:07:23 +0100 Subject: [PATCH 15/16] fix kwarg --- platform-includes/metrics/usage/python.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/metrics/usage/python.mdx b/platform-includes/metrics/usage/python.mdx index f295e3070b745..2e9553cd06843 100644 --- a/platform-includes/metrics/usage/python.mdx +++ b/platform-includes/metrics/usage/python.mdx @@ -18,7 +18,7 @@ from sentry_sdk import metrics metrics.count( "checkout.failed", 1, - "attributes": { + attributes={ "route": "/checkout", "tenant": "acme", "provider": "stripe", From 9a2b6b8e5ca8cfcc2341a7b850e6c0a1c57cafbd Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 30 Oct 2025 13:17:10 +0100 Subject: [PATCH 16/16] add banner --- docs/platforms/python/metrics/index.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/platforms/python/metrics/index.mdx b/docs/platforms/python/metrics/index.mdx index 0e6b15fd5c929..f363173e3ea51 100644 --- a/docs/platforms/python/metrics/index.mdx +++ b/docs/platforms/python/metrics/index.mdx @@ -5,6 +5,12 @@ description: "Metrics allow you to send, view and query counters, gauges and mea sidebar_order: 5755 --- + + +This feature is currently in limited beta. Please reach out on [GitHub](https://github.com/getsentry/sentry-python/discussions/5042) if you have feedback or questions. Features in beta are still in-progress and may have bugs. We recognize the irony. + + + With Sentry Metrics, you can send counters, gauges and distributions from your applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. ## Requirements