Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
fix: improve sdk documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Dec 7, 2023
1 parent b40f636 commit f226d55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/docs/delightful-developer-metrics/sending-metrics-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ This is the recommended way to send metrics. We want to dogfood SDK methods to f

In case you are looking to use the new metrics feature directly from the Python SDK you can do it as follows.

First, you have to use at least the `1.34.0` version of the `sentry-python` SDK and add that as your dependency. For example:
First, you have to use at least the `1.38.0` version of the `sentry-python` SDK and add that as your dependency. For example:

```
sentry-sdk @ 1.34.0
sentry-sdk @ 1.38.0
```

Once the SDK is installed you have to add experimental flag into your SDK init:
Expand All @@ -25,11 +25,13 @@ Once the SDK is installed you have to add experimental flag into your SDK init:
import sentry_sdk

sentry_sdk.init(
# ...
...
_experiments={
"enable_metrics": True,
# Turns on the metrics module (required)
"enable_metrics": True,
# Enables sending of code locations for metrics (recommended)
"metric_code_locations": True,
},
# ...
)
```

Expand Down Expand Up @@ -70,6 +72,7 @@ metrics.gauge(
tags=tags,
)
```

If you want to measure how much time a specific piece of code takes, you can use:

```python
Expand Down
1 change: 1 addition & 0 deletions src/docs/delightful-developer-metrics/ui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ In order to plot your metrics, we have developed a prototype user interface, whi

The first step towards using the UI is to enable it, since right now it’s feature flagged.
These two flags need to be turned on:

- `organizations:custom-metrics` - controls ingestions and UI
- `organizations:ddm-ui` - controls UI

Expand Down

0 comments on commit f226d55

Please sign in to comment.