opentelemetry-exporter-otlp-proto-grpc: fix incorrect default port for gRPC internal metrics - #5668
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation correctly covers scheme-less endpoints and transport-specific default ports with corresponding tests.
Pull request overview
Fixes OTLP exporter self-metrics endpoint attributes and relocates shared metrics utilities for reuse.
Changes:
- Corrects gRPC address parsing and default port reporting.
- Moves exporter metrics utilities into the transport-neutral OTLP common package.
- Updates dependencies, tests, and changelog.
File summaries
| File | Description |
|---|---|
uv.lock |
Adds the OTLP common dependency. |
exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py |
Uses relocated metrics utilities. |
exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py |
Uses relocated metrics utilities. |
exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_log_exporter/__init__.py |
Uses relocated metrics utilities. |
exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements.oldest.txt |
Updates generated test dependencies. |
exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements.latest.txt |
Updates generated test dependencies. |
exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements.in |
Adds OTLP common test dependency. |
exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py |
Passes the effective gRPC endpoint to metrics. |
exporter/opentelemetry-exporter-otlp-proto-grpc/pyproject.toml |
Adds the runtime OTLP common dependency. |
exporter/opentelemetry-exporter-otlp-proto-common/tests/test_exporter_metrics.py |
Removes tests from the former location. |
exporter/opentelemetry-exporter-otlp-common/tests/test_exporter_metrics.py |
Adds relocated and expanded endpoint tests. |
exporter/opentelemetry-exporter-otlp-common/src/opentelemetry/exporter/otlp/common/_exporter_metrics.py |
Implements endpoint parsing and transport-specific ports. |
docs/getting_started/tests/requirements.txt |
Includes the new direct dependency. |
.changelog/5668.fixed |
Records the gRPC self-metrics fix. |
Review details
- Files reviewed: 13/14 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Pull request dashboard statusMerged · refreshed 2026-09-22 07:23 UTC Status above doesn't look right?
|
lzchen
approved these changes
Sep 17, 2026
emdneto
approved these changes
Sep 21, 2026
xrmx
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix incorrect default port for OTLP gRPC exporter self-metrics
Internal SDK self-metrics recorded the wrong
server.portforOTLP/gRPC exporters and dropped
server.address/server.portentirely forscheme-less
host:portendpoints (e.g.otlp.example.com:4317).These changes also move the location of the exporter metrics utilities from the
opentelemetry-exporter-otlp-proto-commonpackage to theopentelemetry-exporter-otlp-commonpackage for future work for adding exporter self-metrics to the OTLP JSON exporter.Fixes #5651
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Contrib Repo Change?
Checklist: