Skip to content
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

feat(exporter): Implement OTLP JSON exporters for HTTP transport #4470

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

andrewlwn77
Copy link

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

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Unit tests for all exporters (traces, metrics, logs)
  • Integration tests verifying proper encoding and transport
  • Compatibility tests with the OpenTelemetry Protocol specification
  • Tests for environment variable configuration
  • Tests for error handling and retry logic

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

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
@andrewlwn77 andrewlwn77 requested a review from a team as a code owner March 10, 2025 23:22
Copy link

linux-foundation-easycla bot commented Mar 10, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Replace 'too-many-positional-arguments' with the correct pylint message ID 'too-many-arguments'
and fix type ignore comments placement for imports without stubs.
@andrewlwn77 andrewlwn77 marked this pull request as draft March 11, 2025 00:16
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support JSON over HTTP in OTLP exporter
1 participant