Support OTLP export over "http/json" for traces, metrics, and logs#12018
Support OTLP export over "http/json" for traces, metrics, and logs#12018mcculls wants to merge 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
573483d to
ae7ca71
Compare
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This pull request adds first-class support for exporting OTLP signals over the http/json protocol across traces, metrics, and logs within dd-trace-core, aligning the agent’s OTLP export capabilities with the existing http/protobuf and grpc options.
Changes:
- Added JSON OTLP encoders/collectors for traces, metrics, logs, plus shared JSON helpers.
- Wired
HTTP_JSONintoOtlpWriter(traces) and intoOtlpMetricsService/OtlpLogsService(metrics/logs). - Refactored shared OTLP constants/mappings (trace flags, span kind mapping, resource attributes, metrics temporality) to be reused across proto/JSON paths.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| dd-trace-core/src/test/java/datadog/trace/core/otlp/trace/OtlpTraceProtoTest.java | Updates trace-flag constant reference to shared OtlpTraceFlags. |
| dd-trace-core/src/test/java/datadog/trace/core/otlp/trace/OtlpTraceJsonCollectorTest.java | Adds coverage for trace OTLP JSON encoding (hex ids, keys, kind, status). |
| dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsServiceTest.java | Verifies metrics service selects JSON collector + HTTP endpoint under http/json. |
| dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsJsonCollectorTest.java | Adds coverage for metrics OTLP JSON encoding (temporality, timestamps, histograms). |
| dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsServiceTest.java | Verifies logs service selects JSON collector + HTTP endpoint under http/json. |
| dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsProtoTest.java | Updates trace-flag constant reference to shared OtlpTraceFlags. |
| dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsJsonCollectorTest.java | Adds coverage for logs OTLP JSON encoding (ids, flags, timestamps, eventName). |
| dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpResourceJsonTest.java | Adds coverage for JSON resource fragment generation from Config. |
| dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpCommonJsonTest.java | Adds coverage for common JSON encoding primitives (ids, attributes, arrays). |
| dd-trace-core/src/test/java/datadog/trace/common/writer/OtlpWriterCombinedTest.java | Adds an end-to-end assertion that HTTP_JSON sends Content-Type: application/json. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceProto.java | Refactors span kind + trace flags to shared helpers/constants. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceJsonCollector.java | New trace JSON collector producing OTLP trace.proto JSON payloads. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceJson.java | New trace JSON writer for spans and span links in OTLP JSON shape. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpSpanKind.java | New shared span-kind mapping for proto + JSON encoders. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsTemporality.java | Extracts temporality selection to a shared helper used by proto/JSON. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsService.java | Enables HTTP_JSON protocol and adds package-private accessors for testing. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsProto.java | Switches to shared temporality constants (logic moved out). |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsJsonCollector.java | New metrics JSON collector producing OTLP metrics.proto JSON payloads. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsJson.java | New metrics JSON writer (metric headers + data point values). |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsService.java | Enables HTTP_JSON protocol and adds package-private accessors for testing. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProtoCollector.java | Removes duplicated protobuf content-type constant (centralized elsewhere). |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProto.java | Updates trace-flag constant reference to shared OtlpTraceFlags. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsJsonCollector.java | New logs JSON collector producing OTLP logs.proto JSON payloads. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsJson.java | New logs JSON writer for log-record JSON fields and flags. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpTraceFlags.java | New shared trace/logs flags constants to avoid duplication. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceProto.java | Refactors resource attribute enumeration into shared helper. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceJson.java | New resource JSON fragment generator for OTLP JSON payloads. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceAttributes.java | New shared resource-attribute enumeration used by proto + JSON. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpProtoBuffer.java | Centralizes protobuf content type via OtlpPayload. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpPayload.java | Adds shared content-type constants for protobuf + JSON payloads. |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpHttpSender.java | Exposes url() accessor (used by tests). |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpCommonJson.java | New common OTLP JSON helpers (ids, scope/schema, attributes). |
| dd-trace-core/src/main/java/datadog/trace/core/otlp/common/LazyJsonArray.java | New helper for lazily-opened JSON arrays used by JSON collectors. |
| dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpWriter.java | Chooses trace collector based on protocol (HTTP_JSON vs proto). |
| dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpPayloadDispatcher.java | Removes implicit default proto collector; collector now injected explicitly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae7ca71920
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
b8387d8 to
bcd2ba9
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
bcd2ba9 to
55d0509
Compare
55d0509 to
4447563
Compare
12ec75d to
b08029a
Compare
Adds JSON siblings of existing hand-rolled protobuf OTLP encoders (OtlpCommonJson, OtlpResourceJson, OtlpTraceJson/Collector, OtlpMetricsJson/Collector, OtlpLogsJson/Collector) and wires the previously unused/silently-disabled HTTP_JSON protocol into OtlpWriter, OtlpMetricsService, and OtlpLogsService. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
b08029a to
27286d6
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in Use ⏳ Merge Commit: 4e13091 |
|
/merge |
|
View all feedbacks in Devflow UI.
PR already in the queue with status in_progress |
What Does This Do
Support OTLP export over "http/json" for traces, metrics, and logs.
Adds JSON siblings of existing hand-rolled protobuf OTLP encoders (OtlpCommonJson, OtlpResourceJson, OtlpTraceJson/Collector, OtlpMetricsJson/Collector, OtlpLogsJson/Collector) and wires the previously unused/silently-disabled HTTP_JSON protocol into OtlpWriter, OtlpMetricsService, and OtlpLogsService.
Motivation
Adds support for OTLP over
http/jsonto the existinghttp/protobufandgrpcsupport.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]