Skip to content

Commit 0126b1f

Browse files
authored
docs(dev-docs): Add metrics telemetry specs (#15178)
1 parent 7b80e82 commit 0126b1f

File tree

8 files changed

+611
-6
lines changed

8 files changed

+611
-6
lines changed

develop-docs/sdk/data-model/envelope-items.mdx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,48 @@ _None_
461461

462462
For Version 2 of the spans protocol, see <Link to="/sdk/telemetry/spans/span-protocol">Span Protocol</Link>.
463463

464+
### Trace Metric
465+
466+
Item type `"trace_metric"` contains an array of metric payloads encoded as JSON. This allows for multiple metric payloads to be sent in a single envelope item.
467+
468+
Only a single trace_metric container is allowed per envelope. The `item_count` field in the envelope item header must match the amount of metrics sent. A `content_type` field in the envelope item header must be set to `application/vnd.sentry.items.trace-metric+json`. Both the `item_count` and `content_type` fields are required.
469+
470+
It's okay to mix metrics from different traces into the same `trace_metric` envelope item, but if you do, you MUST NOT attach a DSC (dynamic sampling context) to the envelope header.
471+
472+
See the <Link to="/sdk/telemetry/metrics">Metrics</Link> documentation for the payload
473+
details. For an example `trace_metric` envelope, see [Appendix A of the Metrics documentation](/sdk/telemetry/metrics#appendix-a-example-trace_metric-envelope).
474+
475+
Example:
476+
477+
```json
478+
{
479+
"type": "trace_metric",
480+
"item_count": 5,
481+
"content_type": "application/vnd.sentry.items.trace-metric+json"
482+
}
483+
{
484+
"items": [{..metric..}, {..metric..}, {..metric..}, {..metric..}, {..metric..}]
485+
}
486+
```
487+
488+
**Constraints:**
489+
490+
_None_
491+
492+
**Envelope Headers:**
493+
494+
_None_
495+
496+
**Additional Item Headers:**
497+
498+
`item_count`
499+
500+
: **integer, required.** The number of metric entries in the envelope.
501+
502+
`content_type`
503+
504+
: **string, required.** The content type of the metric entries. Must be `application/vnd.sentry.items.trace-metric+json`.
505+
464506
### Reserved Types
465507

466508
Reserved types may not be written by any implementation. They are reserved for

develop-docs/sdk/telemetry/feedbacks.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Feedbacks
3-
sidebar_order: 4
3+
sidebar_order: 5
44
---
55

66
This document is meant for Sentry SDK developers and maintainers of the Feedback ingestion pipeline.

0 commit comments

Comments
 (0)