opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Add Warning for Endpoint Mismatch in OTLP GRPC Exporter

Open gshiva opened this issue 1 year ago • 2 comments

This commit introduces a warning message in the OTLP GRPC Exporter when there is a mismatch between the configured endpoint and the provided endpoint. This change aims to prevent silent truncation of the endpoint value, which could lead to confusion and time-consuming debugging for users trying to configure a HTTP exporter but mistakenly passing a GRPC one. This issue might be a common occurrence for newcomers, as almost all the examples use the GRPC exporter. The warning message provides clear, actionable feedback to the user, improving the overall user experience.

Addresses https://github.com/open-telemetry/opentelemetry-python/issues/3619

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #3619

Type of change

Added logger warning to grpc exporter init.

How Has This Been Tested?

Verified that the warning gets displayed when an URL with path was passed (https://otlp.endpoint.com:4317/v1/traces) and no warning was displayed when an expected grpc endpoint like (http://localhost:4317) was passed.

Does This PR Require a Contrib Repo Change?

  • [ X ] No.

Checklist:

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

gshiva avatar Jan 06 '24 20:01 gshiva

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: gshiva (20618cd9c5c429015494b45ded451ee43db006ed)
  • :white_check_mark: login: ocelotl / name: Diego Hurtado (79f0f3b95764bca74f0253962e1325ecccca083c, fbb7cc1c13fc3f10d26ce7fab3269435358974e0)

@gshiva please take a look at the comment above

ocelotl avatar Apr 04 '24 16:04 ocelotl