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: wire up InsecureSkipVerify #35735

Merged
merged 5 commits into from
Oct 14, 2024

Conversation

axw
Copy link
Contributor

@axw axw commented Oct 11, 2024

Description

Thread the InsecureSkipVerify config through properly, so the relevant tls.Config struct field is set. Previously, The --otlp-insecure-skip-verify flag wasn't effective.

I feel like we'd be better off using https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/exporters/autoexport and configuring these things with environment variables, instead of defining flags. I will open an issue for that.

Link to tracking issue

None

Testing

I have added a test that shows the HTTP exporter honours the Insecure, InsecureSkipVerify, and CaFile config fields.

I have not done the same for gRPC due to lack of time - this can be done as a followup. OTOH the logic for HTTP & gRPC exporter options shares more now, so the HTTP path tests a fair bit of what gRPC will do anyway.

The flag wasn't being used.
@axw axw requested review from mx-psi, codeboten and a team as code owners October 11, 2024 07:56
@github-actions github-actions bot added the cmd/telemetrygen telemetrygen command label Oct 11, 2024
@@ -82,7 +67,6 @@ func GetTLSCredentialsForHTTPExporter(caFile string, cAuth ClientAuth) (*tls.Con
if err != nil {
return nil, err
}
tlsCfg.ClientAuth = tls.RequireAndVerifyClientCert
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note the reviewer: this change is an incidental cleanup. ClientAuth is irrelevant here, it's only relevant for TLS servers.

@mx-psi mx-psi merged commit 5221a7a into open-telemetry:main Oct 14, 2024
158 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 14, 2024
jmichalek132 added a commit to jmichalek132/opentelemetry-collector-contrib that referenced this pull request Oct 14, 2024
Signed-off-by: Juraj Michalek <juraj.michalek132@gmail.com>

Fix codeowners (open-telemetry#35754)

Fix the allowlist to match memberships.

telemetrygen: wire up InsecureSkipVerify (open-telemetry#35735)

Thread the InsecureSkipVerify config through properly, so the relevant
`tls.Config` struct field is set. Previously, The
`--otlp-insecure-skip-verify` flag wasn't effective.

I feel like we'd be better off using
https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/exporters/autoexport
and configuring these things with environment variables, instead of
defining flags. I will open an issue for that.

None

I have added a test that shows the HTTP exporter honours the Insecure,
InsecureSkipVerify, and CaFile config fields.

I have not done the same for gRPC due to lack of time - this can be done
as a followup. OTOH the logic for HTTP & gRPC exporter options shares
more now, so the HTTP path tests a fair bit of what gRPC will do anyway.
sbylica-splunk pushed a commit to sbylica-splunk/opentelemetry-collector-contrib that referenced this pull request Dec 17, 2024
#### Description

Thread the InsecureSkipVerify config through properly, so the relevant
`tls.Config` struct field is set. Previously, The
`--otlp-insecure-skip-verify` flag wasn't effective.

I feel like we'd be better off using
https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/exporters/autoexport
and configuring these things with environment variables, instead of
defining flags. I will open an issue for that.

#### Link to tracking issue

None

#### Testing

I have added a test that shows the HTTP exporter honours the Insecure,
InsecureSkipVerify, and CaFile config fields.

I have not done the same for gRPC due to lack of time - this can be done
as a followup. OTOH the logic for HTTP & gRPC exporter options shares
more now, so the HTTP path tests a fair bit of what gRPC will do anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/telemetrygen telemetrygen command
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants