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

Add OTLP Exporter TLS/mTLS configuration options #2009

Open
cijothomas opened this issue Apr 23, 2021 · 12 comments · Fixed by #5818 · May be fixed by #5918
Open

Add OTLP Exporter TLS/mTLS configuration options #2009

cijothomas opened this issue Apr 23, 2021 · 12 comments · Fixed by #5818 · May be fixed by #5918
Labels
enhancement New feature or request pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package

Comments

@cijothomas
Copy link
Member

cijothomas commented Apr 23, 2021

The OTLP exporter (both HTTP and gRPC) need to support the following configuration options from the spec:

  • Certificate file
  • Client key file
  • Client certificate file

See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options

@ejsmith
Copy link
Contributor

ejsmith commented Jun 24, 2022

I don't think just being able to specify the cert path is good enough. I want to control how the cert validation is done and ideally I might want to control the underlying HttpClient as well. I would think this integration would wire up to DI for the GrpcChannel to pick up the HttpClient just like the HTTP side of the otlp exporter already does.

@fhubi
Copy link

fhubi commented May 15, 2023

Hi @cijothomas and @alanwest,
Is there any progress on this?

@dhhoang
Copy link

dhhoang commented Jun 29, 2023

Hi, we also have an use case where we need to use mTLS with OTLP, and thus need to set client certificate. Right now it's not possible to do it with GRPC.
I've made a CR to make HttpClientFactory work with GRPC also: #4625 .
The only issue that I see is that this change will not have effect on netstadard2.0 (and other .NET Framework targets). This is due to the fact that netstadard2.0 for some reason used the old Grpc.Core library which does not use HttpClient. This will create a discrepancy in API functionalities between different targets, which I'm not sure is acceptable.

@alanwest alanwest changed the title OTLPExporter auth option via cert file Add OTLP Exporter TLS/mTLS configuration options Jul 27, 2023
@alanwest
Copy link
Member

I've updated the issue description to make it more clear that this issue is specifically about supporting the three TLS related OTLP configuration options that we do not yet support. Exposing the HttpClientFactory to the gRPC exporter is not part of the scope of this issue.

@matt-hensley has offered to help out with implementing these configuration options.

@dhhoang
Copy link

dhhoang commented Jul 29, 2023

I currently working on a (draft) PR: #4731
Some things I'm still trying to figure out:

  • How to build custom trust store with HttpClient to verify server Certificate file
  • How to load PEM file (with different key algo) in .NET Framework.

@dhhoang
Copy link

dhhoang commented Jul 30, 2023

Old .NET (netstandard2.0) lacks the PEM-support APIs. Parsing and loading PEM certificates and keys is quite tricky.
The only (easy) solution I've managed to find is to use BouncyCastle https://github.com/bcgit/bc-csharp. I've updated to PR with this method.
I'm wondering if we have any constraints for using in dependency libraries?

@varkey98
Copy link

Curious about the status of this issue, saw that above pr is closed. Do we support exporting over tls now?

@varkey98
Copy link

If no one is working on this, can I work on this? I'd like to take this issue up

@Toasterson
Copy link

We have a production use case that would benefit from #4731 What is needed to revive that PR and not have it die in bureaucracy again? @varkey98 looks like you can take it. I see no other initiative that got as far as #4731 or anybody willing to pick it up.

@sandy2008
Copy link
Contributor

Hi! Me and @sokoide are going to create PRs accordingly.

@Kielek
Copy link
Contributor

Kielek commented Oct 21, 2024

Reopening, as I understand we have now only infrastructure for the real implementation?

@Kielek Kielek reopened this Oct 21, 2024
@sandy2008
Copy link
Contributor

@Kielek Yep, I am working on the 2nd PR to add mTLS :)

@sandy2008 sandy2008 linked a pull request Oct 23, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package
Projects
None yet
9 participants