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

Support secure OTLP exporter config for hotrod #4231

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

graphaelli
Copy link
Contributor

@graphaelli graphaelli commented Feb 10, 2023

Which problem is this PR solving?

hotrod currently forces all connections to insecure in

otlptracehttp.WithInsecure(),

preventing SSL connections from succeeding. For example:

$ OTEL_EXPORTER_OTLP_ENDPOINT=https://hotrod.apm.us-east4.gcp.elastic-cloud.com:443 ./hotrod all -x otlp

2023/02/10 13:00:04 traces export: failed to send to http://hotrod.apm.us-east4.gcp.elastic-cloud.com:443/v1/traces: 400 Bad Request

Short description of the changes

  • use secure connections when env var OTEL_EXPORTER_OTLP_ENDPOINT uses https scheme or OTEL_EXPORTER_OTLP_INSECURE=false

@graphaelli graphaelli requested a review from a team as a code owner February 10, 2023 18:09
@yurishkuro
Copy link
Member

except that now you broke the insecure mode, which is much more prevalent in demo setups

go run ./examples/hotrod all -x otlp

@graphaelli
Copy link
Contributor Author

It doesn't break insecure mode, it changes the default on something user must opt into anyway. The original behavior is restored with:

OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 go run ./examples/hotrod all -x otlp

or

OTEL_EXPORTER_OTLP_INSECURE=true go run ./examples/hotrod all -x otlp

The goal is to make the following work, which I suspect is the most likely way folks engage with hotrod (that is, via docker images).

docker run -it --rm -v $PWD/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt -e OTEL_EXPORTER_OTLP_ENDPOINT=my-https-endpoint jaegertracing/example-hotrod:latest all -x otlp 

That said, if that's too big of an impact I'm fine to withdraw this.

@graphaelli
Copy link
Contributor Author

graphaelli commented Feb 10, 2023

I suppose we could just look for an https:// prefix on the env var and not add the option in that case?

@graphaelli
Copy link
Contributor Author

Updated PR to use secure connections when env var OTEL_EXPORTER_OTLP_ENDPOINT uses https scheme or OTEL_EXPORTER_OTLP_INSECURE=false

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

LGTM. Please make sure all commits are signed (or squash into one, usually easier to fix DCO this way)

Signed-off-by: Gil Raphaelli <graphaelli@gmail.com>
@yurishkuro yurishkuro enabled auto-merge (squash) February 13, 2023 21:24
@codecov
Copy link

codecov bot commented Feb 13, 2023

Codecov Report

Base: 97.11% // Head: 97.10% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (527608b) compared to base (5b58370).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4231      +/-   ##
==========================================
- Coverage   97.11%   97.10%   -0.02%     
==========================================
  Files         302      302              
  Lines       17685    17685              
==========================================
- Hits        17175    17173       -2     
- Misses        411      412       +1     
- Partials       99      100       +1     
Flag Coverage Δ
unittests 97.10% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
plugin/storage/badger/spanstore/reader.go 95.49% <0.00%> (-0.72%) ⬇️
plugin/storage/integration/integration.go 76.33% <0.00%> (+0.38%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yurishkuro yurishkuro merged commit dfe73e1 into jaegertracing:main Feb 13, 2023
shubbham1215 pushed a commit to shubbham1215/jaeger that referenced this pull request Feb 22, 2023
## Which problem is this PR solving?

hotrod currently forces all connections to insecure in
https://github.com/jaegertracing/jaeger/blob/fedeb4cab75399e4672b77efe6a067a7bd148ddf/examples/hotrod/pkg/tracing/init.go#L85

preventing SSL connections from succeeding.  For example:

```
$ OTEL_EXPORTER_OTLP_ENDPOINT=https://hotrod.apm.us-east4.gcp.elastic-cloud.com:443 ./hotrod all -x otlp

2023/02/10 13:00:04 traces export: failed to send to http://hotrod.apm.us-east4.gcp.elastic-cloud.com:443/v1/traces: 400 Bad Request
```

## Short description of the changes
- use secure connections when env var `OTEL_EXPORTER_OTLP_ENDPOINT` uses
`https` scheme or `OTEL_EXPORTER_OTLP_INSECURE=false`

Signed-off-by: Gil Raphaelli <graphaelli@gmail.com>
shubbham1215 pushed a commit to shubbham1215/jaeger that referenced this pull request Mar 5, 2023
## Which problem is this PR solving?

hotrod currently forces all connections to insecure in
https://github.com/jaegertracing/jaeger/blob/fedeb4cab75399e4672b77efe6a067a7bd148ddf/examples/hotrod/pkg/tracing/init.go#L85

preventing SSL connections from succeeding.  For example:

```
$ OTEL_EXPORTER_OTLP_ENDPOINT=https://hotrod.apm.us-east4.gcp.elastic-cloud.com:443 ./hotrod all -x otlp

2023/02/10 13:00:04 traces export: failed to send to http://hotrod.apm.us-east4.gcp.elastic-cloud.com:443/v1/traces: 400 Bad Request
```

## Short description of the changes
- use secure connections when env var `OTEL_EXPORTER_OTLP_ENDPOINT` uses
`https` scheme or `OTEL_EXPORTER_OTLP_INSECURE=false`

Signed-off-by: Gil Raphaelli <graphaelli@gmail.com>
Signed-off-by: shubbham1215 <sawaikershubham@gmail.com>
@graphaelli graphaelli deleted the hotrod-client branch May 18, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants