Skip to content

Commit 7aa6ffc

Browse files
Update develop-docs/sdk/telemetry/metrics.mdx
Co-authored-by: Alex Alderman Webb <[email protected]>
1 parent f54d558 commit 7aa6ffc

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

develop-docs/sdk/telemetry/metrics.mdx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,22 +252,27 @@ Sentry.metrics.distribution("page.load_time", 245.7, {
252252

253253
```python
254254
# Increment a counter
255-
Sentry.metrics.count('button.clicks', 1, {
256-
'attributes': {'button_id': 'submit', 'page': 'checkout'}
257-
})
255+
Sentry.metrics.count(
256+
'button.clicks',
257+
1,
258+
attributes={'button_id': 'submit', 'page': 'checkout'},
259+
)
258260

259261
# Set a gauge value
260-
Sentry.metrics.gauge('db.connection_pool.active', 42, {
261-
'unit': 'connection',
262-
'attributes': {'pool_name': 'main_db', 'database': 'postgres'}
263-
})
262+
Sentry.metrics.gauge(
263+
'db.connection_pool.active',
264+
42,
265+
unit='connection',
266+
attributes={'pool_name': 'main_db', 'database': 'postgres'},
267+
)
264268

265269
# Record a distribution
266-
Sentry.metrics.distribution('page.load_time', 245.7, {
267-
'unit': 'millisecond',
268-
'attributes': {'page': '/dashboard', 'browser': 'chrome'}
269-
})
270-
```
270+
Sentry.metrics.distribution(
271+
'page.load_time',
272+
245.7,
273+
unit='millisecond',
274+
attributes={'page': '/dashboard', 'browser': 'chrome'},
275+
)
271276

272277
#### PHP
273278

0 commit comments

Comments
 (0)