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

[otlpexporter] Validate the configuration explicitly #9523

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

atoulme
Copy link
Contributor

@atoulme atoulme commented Feb 7, 2024

Description:
Use Config.Validate to validate the presence of the gRPC endpoint instead of making an assertion at creation time.

@atoulme atoulme requested review from a team and bogdandrutu February 7, 2024 23:31
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9553bfe) 90.34% compared to head (8c84861) 90.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9523      +/-   ##
==========================================
+ Coverage   90.34%   90.40%   +0.05%     
==========================================
  Files         346      347       +1     
  Lines       18194    18187       -7     
==========================================
+ Hits        16438    16442       +4     
+ Misses       1422     1414       -8     
+ Partials      334      331       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@atoulme atoulme force-pushed the otlp_validate branch 2 times, most recently from 31a68ff to 6ea578c Compare February 8, 2024 00:13
@atoulme atoulme added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Feb 8, 2024
@atoulme
Copy link
Contributor Author

atoulme commented Feb 8, 2024

Leaning towards no changelog since it feels like this is not a functional change, but please weigh in.

@bogdandrutu bogdandrutu merged commit de6287d into open-telemetry:main Feb 9, 2024
47 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 9, 2024
jpkrohling added a commit to jpkrohling/opentelemetry-collector-contrib that referenced this pull request Feb 22, 2024
As part of open-telemetry/opentelemetry-collector#9523, the OTLP Exporter configuration used by the load balancing exporter is being validates automatically. However, the endpoint is the only thing users should NOT set, as it will be set at a later point in time by the load balancer.

This PR sets a placeholder value for the endpoint so that the validation passes.

Fixes open-telemetry#31371

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
jpkrohling added a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Feb 22, 2024
As part of
open-telemetry/opentelemetry-collector#9523, the
OTLP Exporter configuration used by the load balancing exporter is being
validates automatically. However, the endpoint is the only thing users
should NOT set, as it will be set at a later point in time by the load
balancer.

This PR sets a placeholder value for the endpoint so that the validation
passes.

Fixes #31371

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

---------

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
jpkrohling added a commit to jpkrohling/opentelemetry-collector-contrib that referenced this pull request Feb 26, 2024
…1381)

As part of
open-telemetry/opentelemetry-collector#9523, the
OTLP Exporter configuration used by the load balancing exporter is being
validates automatically. However, the endpoint is the only thing users
should NOT set, as it will be set at a later point in time by the load
balancer.

This PR sets a placeholder value for the endpoint so that the validation
passes.

Fixes open-telemetry#31371

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

---------

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
TylerHelmuth pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Feb 28, 2024
… unit test (#31425)

**Description:** 
As described in the otel-collector [issue
9505](open-telemetry/opentelemetry-collector#9505),
the otlpexporter does not function correctly if no port is defined. To
resolve this, the otlp config validation has been updated to fail fast
when the endpoint within an otlp config does not have a port specified.

The loadbalancingexporter config has the otlp exporter config as a
dependency, however, the loadbalancing exporter does not define a port
on the otlpexporter config in two places:
- default config from factory
- testdata contents

This is currently a blocker to the contrib tests for the
[PR](open-telemetry/opentelemetry-collector#9632)
to resolve issue 9505

Relates to:
open-telemetry/opentelemetry-collector#9523

#31371

#31381


**Link to tracking Issue:** 
otel-collector-contrib: [issue
31426](#31426)
Arises from otel-collector [issue
9505](open-telemetry/opentelemetry-collector#9505)

**Testing:** Used `replace` to test loadbalancingexporter changes pass
tests successfully when using the otlpexporter changes from
[PR](open-telemetry/opentelemetry-collector#9632)
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
…1381)

As part of
open-telemetry/opentelemetry-collector#9523, the
OTLP Exporter configuration used by the load balancing exporter is being
validates automatically. However, the endpoint is the only thing users
should NOT set, as it will be set at a later point in time by the load
balancer.

This PR sets a placeholder value for the endpoint so that the validation
passes.

Fixes open-telemetry#31371

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

---------

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
… unit test (open-telemetry#31425)

**Description:** 
As described in the otel-collector [issue
9505](open-telemetry/opentelemetry-collector#9505),
the otlpexporter does not function correctly if no port is defined. To
resolve this, the otlp config validation has been updated to fail fast
when the endpoint within an otlp config does not have a port specified.

The loadbalancingexporter config has the otlp exporter config as a
dependency, however, the loadbalancing exporter does not define a port
on the otlpexporter config in two places:
- default config from factory
- testdata contents

This is currently a blocker to the contrib tests for the
[PR](open-telemetry/opentelemetry-collector#9632)
to resolve issue 9505

Relates to:
open-telemetry/opentelemetry-collector#9523

open-telemetry#31371

open-telemetry#31381


**Link to tracking Issue:** 
otel-collector-contrib: [issue
31426](open-telemetry#31426)
Arises from otel-collector [issue
9505](open-telemetry/opentelemetry-collector#9505)

**Testing:** Used `replace` to test loadbalancingexporter changes pass
tests successfully when using the otlpexporter changes from
[PR](open-telemetry/opentelemetry-collector#9632)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants