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

telemetrygen: Allow setting custom paths #24551

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

gouthamve
Copy link
Member

@gouthamve gouthamve commented Jul 25, 2023

The current description for the flag is wrong.

❯ ../../open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/telemetrygen metrics --otlp-endpoint example.com/v1/metrics  --otlp-http --otlp-insecure
2023-07-25T22:03:45.884+0200	INFO	metrics/metrics.go:56	starting HTTP exporter
Error: failed to obtain OTLP exporter: parse "http://example.com%2Fv1%2Fmetrics/v1/metrics": invalid URL escape "%2F"

I couldn't make it easily work with the existing flag because url.Parse(c.Endpoint) puts everything in path, and u.Host is unset. This is because url.Parse expects http:// or https:// which is set through a different flag.

@gouthamve gouthamve requested a review from a team July 25, 2023 20:16
@github-actions github-actions bot added the cmd/telemetrygen telemetrygen command label Jul 25, 2023
Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Please add a changelog as this is user-facing.

The current description for the flag is wrong.

```
❯ ../../open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/telemetrygen metrics --otlp-endpoint example.com/v1/metrics  --otlp-http --otlp-insecure
2023-07-25T22:03:45.884+0200	INFO	metrics/metrics.go:56	starting HTTP exporter
Error: failed to obtain OTLP exporter: parse "http://example.com%2Fv1%2Fmetrics/v1/metrics": invalid URL escape "%2F"
```

Signed-off-by: Goutham <[email protected]>
@gouthamve gouthamve force-pushed the telemetrygen-new-path branch from 36b2926 to 6ef1b74 Compare July 25, 2023 21:25
@gouthamve
Copy link
Member Author

@songy23 Done

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

LGTM, no change needed in logs because of #18867

@mx-psi mx-psi added the ready to merge Code review completed; ready to merge by maintainers label Jul 26, 2023
@mx-psi mx-psi merged commit 3db63cb into open-telemetry:main Aug 1, 2023
@github-actions github-actions bot added this to the next release milestone Aug 1, 2023
@gouthamve gouthamve deleted the telemetrygen-new-path branch August 1, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/telemetrygen telemetrygen command ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants