Commit 53e20b5
authored
fix(trace-stats)!: add grpc_method to aggregation key (#2151)
# What does this PR do?
Removes \`grpc_method\` / \`rpc.method\` entirely from the OTLP trace metrics pipeline.
Previously \`grpc_method\` was a sidecar on \`GroupedStats\` — present in the OTLP metric payload as an explicit attribute, but not part of the aggregation key. This PR removes it from both:
- **\`FixedAggregationKey\`** — it is no longer an aggregation dimension.
- **\`OtlpExactGroup\`** — it is no longer carried in the per-cell sidecar.
- **\`build_attributes()\`** — \`rpc.method\` is no longer emitted on OTLP histogram data points.
## Rationale
For gRPC spans, \`span.resource\` already carries the full method path (e.g. \`/package.Service/Method\`). Emitting \`rpc.method\` as a separate OTLP attribute is redundant — \`span.resource\` (mapped to \`span.name\` on the data point) is the authoritative carrier of gRPC method identity and is already an aggregation dimension.
Adding \`rpc.method\` as a separate dimension would also increase cardinality for gRPC services without providing any information not already present on the metric.
Note: \`rpc.response.status_code\` (from \`grpc.status.code\`) is **kept** as a first-class aggregation dimension — it is not redundant with any existing field.
# Motivation
Correctness and cleanliness for the OTLP trace metrics feature landed in #2067.
# Risk
**Breaking changes (major semver):**
- \`FixedAggregationKey<T>\` loses its \`grpc_method: T\` field. Callers constructing the struct by name must remove the field.
- \`OtlpExactGroup\` loses its \`grpc_method\` field.
- \`build_attributes()\` loses the \`grpc_method\` parameter.
**Blast radius is limited** because:
1. The OTLP trace metrics feature (#2067) landed on \`main\` after the v36 release (June 19). No released version is affected — this only exists in unreleased code.
2. The OTLP metrics path is opt-in: the sidecar only activates it when \`set_otlp_metrics_endpoint\` is configured. No SDK enables this today.
3. Agent \`/v0.6/stats\` protobuf wire format is unchanged — \`ClientGroupedStats\` has no \`grpc_method\` field.
**Urgency: low.** No live production systems are affected. This must land before the next release that ships the OTLP metrics feature.
# How to test the change?
```
cargo nextest run -p libdd-trace-stats -p datadog-ipc -p libdd-data-pipeline
```
Co-authored-by: munir.abdinur <munir.abdinur@datadoghq.com>1 parent c2751ef commit 53e20b5
4 files changed
Lines changed: 7 additions & 60 deletions
File tree
- datadog-ipc/src
- libdd-data-pipeline/src/otlp
- libdd-trace-stats/src/span_concentrator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | 123 | | |
125 | 124 | | |
126 | 125 | | |
| |||
146 | 145 | | |
147 | 146 | | |
148 | 147 | | |
149 | | - | |
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
| |||
347 | 345 | | |
348 | 346 | | |
349 | 347 | | |
350 | | - | |
351 | 348 | | |
352 | 349 | | |
353 | 350 | | |
354 | 351 | | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | 352 | | |
367 | 353 | | |
368 | 354 | | |
| |||
444 | 430 | | |
445 | 431 | | |
446 | 432 | | |
447 | | - | |
| 433 | + | |
448 | 434 | | |
449 | 435 | | |
450 | 436 | | |
| |||
467 | 453 | | |
468 | 454 | | |
469 | 455 | | |
470 | | - | |
471 | 456 | | |
472 | 457 | | |
473 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
153 | 152 | | |
154 | 153 | | |
155 | 154 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | 155 | | |
168 | 156 | | |
169 | 157 | | |
| |||
262 | 250 | | |
263 | 251 | | |
264 | 252 | | |
265 | | - | |
266 | 253 | | |
267 | 254 | | |
268 | 255 | | |
| |||
344 | 331 | | |
345 | 332 | | |
346 | 333 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | 334 | | |
351 | 335 | | |
352 | 336 | | |
| |||
390 | 374 | | |
391 | 375 | | |
392 | 376 | | |
393 | | - | |
394 | | - | |
395 | | - | |
| 377 | + | |
396 | 378 | | |
397 | 379 | | |
398 | 380 | | |
399 | 381 | | |
400 | | - | |
401 | 382 | | |
402 | 383 | | |
403 | 384 | | |
| |||
433 | 414 | | |
434 | 415 | | |
435 | 416 | | |
436 | | - | |
437 | 417 | | |
438 | 418 | | |
439 | 419 | | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
| 420 | + | |
444 | 421 | | |
445 | 422 | | |
446 | 423 | | |
| |||
455 | 432 | | |
456 | 433 | | |
457 | 434 | | |
458 | | - | |
459 | | - | |
| 435 | + | |
460 | 436 | | |
461 | 437 | | |
462 | 438 | | |
| |||
470 | 446 | | |
471 | 447 | | |
472 | 448 | | |
473 | | - | |
474 | 449 | | |
475 | 450 | | |
476 | 451 | | |
| |||
834 | 809 | | |
835 | 810 | | |
836 | 811 | | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | 812 | | |
850 | 813 | | |
851 | 814 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
| |||
0 commit comments