open-telemetry / open-telemetry/opentelemetry-java

Add a custom HostnameVerifier for OTLPHttpExporter

Open
#7,796 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
Java
Stars
2.5k
Forks
1k
Avg merge
3d 17h
Merged PRs (30d)
58

Description

Is your feature request related to a problem? Please describe.
We want to ingest telemetry into an OTLP endpoint - the authentication mechanism for that endpoint is a SPIFFE implementation. SPIFFE uses mTLS and uses URIs in the X.509 certificate's SAN, not DNS names. Default hostnameVerification in the http clients requires a DNS name in SAN, which SPIFFE certificates do not have. I could not find a way to set a custom hostnameverifier for the OTLP exporter - due to this, hostnameVerification fails.

Describe the solution you'd like
A way to set custom hostnameVerification for http clients for the OTLP exporter - maybe something like setHostnameVerifier() here https://github.com/open-telemetry/opentelemetry-java/blob/main/exporters/sender/okhttp/src/main/java/io/opentelemetry/exporter/sender/okhttp/internal/OkHttpHttpSender.java#L106

Describe alternatives you've considered
We've explored running OTel collector sidecars for authentication, however that leads to increased resource usage and we would like to achieve this using the SDK if possible.

Additional context
Add any other context or screenshots about the feature request here.

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with exporters/sender/okhttp/src/main/java/io/opentelemetry/exporter/sender/okhttp/internal/OkHttpHttpSender.java at the referenced client setup point, then trace how OTLPHttpExporter configures its HTTP client. Done means callers can provide a custom HostnameVerifier so SPIFFE certificates using URI SANs can pass hostname verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.