Skip to content

feat: Add 'opentelemetry-exporter-otlp-json-http' package#5051

Open
herin049 wants to merge 16 commits intoopen-telemetry:mainfrom
herin049:feat/exporter-otlp-json
Open

feat: Add 'opentelemetry-exporter-otlp-json-http' package#5051
herin049 wants to merge 16 commits intoopen-telemetry:mainfrom
herin049:feat/exporter-otlp-json

Conversation

@herin049
Copy link
Copy Markdown
Contributor

@herin049 herin049 commented Apr 7, 2026

Description

Follow up to #4996 and finishes the implementation of the OTLP JSON exporter.

Fixes #1003.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tests have been added to the opentelemetry-exporter-otlp-json-http and opentelemetry-exporter-otlp-json-common packages, and the existing Docker tests have been completely rewritten to test gRPC, proto-HTTP and JSON-HTTP exporters with all signal types.

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

@herin049 herin049 requested a review from a team as a code owner April 7, 2026 03:02
@herin049 herin049 moved this to Ready for review in Python PR digest Apr 7, 2026
@herin049 herin049 added the Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary label Apr 7, 2026
Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is massive at over 9k lines. I'm generally not in favour of such large PRs as you can't approve with confidence.

Saying that, I did notice a couple of things we should look at.

return MetricExportResult.FAILURE

export_request = encode_metrics(metrics_data)
deadline = time.time() + self._timeout
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeout_millis is being ignored here — the deadline is always calculated from self._timeout (set at construction time). I think we need to honour the per-call timeout and take the more restrictive of the two, something like:

  timeout_secs = min(timeout_millis / 1000, self._timeout) if timeout_millis is not None else self._timeout
  deadline = time.time() + timeout_secs

Note the unit conversion — timeout_millis is in milliseconds but self._timeout is in seconds.

"cert_file": client_certificate_file,
"key_file": client_key_file,
}
if certificate is False:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with urllib3? I think that usesca_certs not cert_file. If both certificate and client_certificate_file are provided, mTLS would break right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, line 78 should use ca_certs

@github-project-automation github-project-automation bot moved this from Ready for review to Reviewed PRs that need fixes in Python PR digest Apr 13, 2026
@herin049
Copy link
Copy Markdown
Contributor Author

This is massive at over 9k lines. I'm generally not in favour of such large PRs as you can't approve with confidence.

Saying that, I did notice a couple of things we should look at.

This PR will be dramatically smaller once the PR to add opentelemetry-exporter-otlp-json-common is merged. We can discuss breaking up the PR further if it still is too large once I rebase this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary

Projects

Status: Reviewed PRs that need fixes

Development

Successfully merging this pull request may close these issues.

Support JSON over HTTP in OTLP exporter

2 participants