-
Notifications
You must be signed in to change notification settings - Fork 700
feat(exporter): Implement OTLP JSON exporters for HTTP transport #4470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(exporter): Implement OTLP JSON exporters for HTTP transport #4470
Conversation
Add new packages for JSON-based OTLP exporters as alternatives to the existing Protobuf-based exporters: - opentelemetry-exporter-otlp-json-common: Common JSON encoding functionality - opentelemetry-exporter-otlp-json-http: HTTP transport implementation These exporters enable compatibility with services requiring JSON format instead of Protobuf. Implementation includes full support for traces, metrics, and logs with comprehensive test coverage following project guidelines. Closes open-telemetry#1003
Replace 'too-many-positional-arguments' with the correct pylint message ID 'too-many-arguments' and fix type ignore comments placement for imports without stubs.
Replace string representation of integers with actual integer values in the OTLP JSON exporters to comply with the OTLP specification. This ensures integer attributes are properly encoded as {intValue: 123} instead of {intValue: 123} for better compatibility with OTLP receivers.
Can you add encodie without base64 for trace/span ids so this can be written to a file ? |
OTLP JSON file needs a regular id with hex encoding, not base64. |
According to the specification the ids must be hex string and not base64 The traceId and spanId byte arrays are represented as case-insensitive hex-encoded strings; they are not base64-encoded as is defined in the standard Protobuf JSON Mapping. Hex encoding is used for traceId and spanId fields in all OTLP Protobuf messages, e.g., the Span, Link, LogRecord, etc. messages. For example, the traceId field in a Span can be represented like this: { “traceId”: “5B8EFFF798038103D269B633813FC60C”, … } |
looking forward to this being resolved! it really helps in a proxy scenario where you want to use plain lua or have a python interpreter but you can't add grpc to it. |
Description
This PR adds JSON-based OTLP exporters to complement the existing Protobuf-based exporters. Many services and backends support the JSON format for OTLP data, and this implementation provides a standards-compliant way to export telemetry data in JSON format over HTTP.
The implementation follows the OpenTelemetry Protocol specification for JSON encoding and includes support for all telemetry signals (traces, metrics, and logs). The code structure mirrors the existing Protobuf exporters for consistency and ease of maintenance.
Fixes #1003
Type of change
How Has This Been Tested?
Does This PR Require a Contrib Repo Change?
Checklist: