Skip to content

opentelemetry-exporter-otlp-proto-grpc: fix incorrect default port for gRPC internal metrics - #5668

Merged
xrmx merged 3 commits into
open-telemetry:mainfrom
herin049:fix/5651
Sep 22, 2026
Merged

xrmx merged 3 commits into
open-telemetry:mainfrom
herin049:fix/5651

Conversation

@herin049

@herin049 herin049 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Description

Fix incorrect default port for OTLP gRPC exporter self-metrics

Internal SDK self-metrics recorded the wrong server.port for
OTLP/gRPC exporters and dropped server.address/server.port entirely for
scheme-less host:port endpoints (e.g. otlp.example.com:4317).

These changes also move the location of the exporter metrics utilities from the opentelemetry-exporter-otlp-proto-common package to the opentelemetry-exporter-otlp-common package 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.

  • 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?

uv run tox -e py314-test-opentelemetry-exporter-otlp-proto-grpc-latest

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 September 17, 2026 01:53
@herin049 herin049 changed the title opentelemetry-exporter-otlp-grpc: fix incorrect default port for gRPC internal metrics opentelemetry-exporter-otlp-proto-grpc: fix incorrect default port for gRPC internal metrics Sep 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 17, 2026

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-09-22 07:23 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Sep 17, 2026
@xrmx
xrmx added this pull request to the merge queue Sep 22, 2026
Merged via the queue into open-telemetry:main with commit 5f851d2 Sep 22, 2026
577 checks passed
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Python PR digest Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

OTLP gRPC internal metrics report a server.port the exporter does not use, and none at all for a scheme-less endpoint

5 participants