Commit dd17781
feat(otlp): add gRPC protocol support for trace ingestion (#1105)
## Summary
- Add gRPC support for OTLP trace ingestion on port 4317, complementing
the existing HTTP endpoint on port 4318
- Implement `TraceService` trait using tonic for gRPC server
- Refactor `OtlpProcessor` to accept `ExportTraceServiceRequest`
directly (avoids re-encoding for gRPC)
- Wire up existing config:
`DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_GRPC_ENDPOINT` and
`DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_GRPC_MAX_RECV_MSG_SIZE_MIB`
## Motivation
Users were configuring gRPC OTLP endpoints
(`DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_GRPC_ENDPOINT`) but the feature was
not implemented, resulting in silent failures. This PR enables gRPC
support. This was for an old ticket, but we should go ahead and add
this, especially since OTLP is getting more popular.
## Changes
| File | Change |
|------|--------|
| `bottlecap/Cargo.toml` | Add tonic with transport/server features |
| `bottlecap/src/otlp/grpc_agent.rs` | NEW - gRPC server implementing
TraceService |
| `bottlecap/src/otlp/processor.rs` | Refactor to accept
ExportTraceServiceRequest directly |
| `bottlecap/src/otlp/mod.rs` | Update enablement logic for HTTP/gRPC |
| `bottlecap/src/bin/bottlecap/main.rs` | Start both HTTP and gRPC
servers |
## Binary Size Impact
Measured from CI layer size checks (arm64):
| Metric | Main | PR | Difference |
|--------|------|-----|------------|
| Zipped | 5,074 KB | 5,164 KB | **+90 KB** |
| Unzipped | 11,183 KB | 11,376 KB | **+193 KB** |
This is a ~1.7% increase, well under historical concerns (OTLP was
removed from Go agent for adding ~1.15MB).
## Test plan
- [x] New integration tests for gRPC protocol (4 tests)
- [x] All existing OTLP tests continue to pass
- [x] `cargo fmt`, `cargo clippy`, `cargo test` pass
- [x] All CI checks passed (47 checks including integration suites)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent a69ae63 commit dd17781
File tree
11 files changed
+537
-48
lines changed- bottlecap
- src
- bin/bottlecap
- otlp
- integration-tests
- lambda/otlp-node
- lib/stacks
- tests
11 files changed
+537
-48
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
1354 | 1357 | | |
1355 | 1358 | | |
1356 | 1359 | | |
1357 | | - | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
1358 | 1364 | | |
1359 | 1365 | | |
| 1366 | + | |
1360 | 1367 | | |
1361 | | - | |
1362 | | - | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
| 1368 | + | |
1369 | 1369 | | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
1375 | 1403 | | |
1376 | 1404 | | |
1377 | 1405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 78 | | |
84 | 79 | | |
85 | 80 | | |
| |||
312 | 307 | | |
313 | 308 | | |
314 | 309 | | |
315 | | - | |
316 | 310 | | |
317 | 311 | | |
318 | 312 | | |
| |||
322 | 316 | | |
323 | 317 | | |
324 | 318 | | |
325 | | - | |
326 | 319 | | |
327 | 320 | | |
328 | 321 | | |
| |||
332 | 325 | | |
333 | 326 | | |
334 | 327 | | |
335 | | - | |
336 | 328 | | |
337 | 329 | | |
338 | 330 | | |
| |||
342 | 334 | | |
343 | 335 | | |
344 | 336 | | |
345 | | - | |
346 | 337 | | |
347 | 338 | | |
348 | 339 | | |
| |||
352 | 343 | | |
353 | 344 | | |
354 | 345 | | |
355 | | - | |
356 | 346 | | |
357 | 347 | | |
358 | 348 | | |
| |||
0 commit comments