Repository navigation
Conversation
…parse JdkHttpSender and UpstreamGrpcSenderProvider's fallback channel rely on java.net.URI to parse the endpoint host, which returns null for valid DNS names whose last label starts with a digit (JDK-8188305). EndpointUtil accepts these since open-telemetry#8746, so they previously failed with an opaque error on first export or a NullPointerException. Throw a clear error at sender construction instead. Part of open-telemetry#8745
Pull request dashboard statusWaiting on the author · refreshed 2026-11-13 06:54 UTC Two things need attention:
Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8856 +/- ##
============================================
- Coverage 91.44% 90.44% -1.01%
- Complexity 10667 11173 +506
============================================
Files 1007 1032 +25
Lines 28686 30455 +1769
Branches 3676 3975 +299
============================================
+ Hits 26233 27545 +1312
- Misses 1657 1935 +278
- Partials 796 975 +179 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| // grpc-java parses host names with java.net.URI, which returns null for some valid DNS names | ||
| // (JDK-8188305) that EndpointUtil accepts, so fail with a clear message. | ||
| if (endpoint.getHost() == null) { |
There was a problem hiding this comment.
Nit: since you filed grpc/grpc-java#13075 upstream, consider referencing it in this comment (alongside JDK-8188305) so a future maintainer knows this check can be relaxed once grpc-java fixes host validation on their side.
|
Hi @hitkall — just a friendly reminder that this pull request is waiting on you. The dashboard status comment has the open items and is kept current.
|
|
This PR has been labeled as stale due to lack of activity and needing author feedback. It will be automatically closed if there is no further activity over the next 7 days. |
…emetry/exporter/sender/grpc/managedchannel/internal/1-UpstreamGrpcSenderProvider.java
Resolves #8745, following the approach agreed in #8745 (comment).
Since #8746,
EndpointUtilaccepts valid RFC 1123 hosts thatjava.net.URIcan't parse, such asotlp.1234-k8s-namespace(JDK-8188305). The default OkHttp senders handle these, but two senders can't:JdkHttpSender:HttpRequest.Builder#urirejects a URI with no host, so the first export failed withunsupported URI.UpstreamGrpcSenderProvider(fallback channel only):ManagedChannelBuilder.forAddress(null, -1)threwNullPointerException: target. grpc-java validates hosts withURItoo, so passing the host fromURLdoesn't help. I reported that upstream in Hostnames whose last label starts with a digit are rejected (java.net.URI, JDK-8188305) grpc/grpc-java#13075.Both providers now throw an
IllegalArgumentExceptionwhen the sender is created. The message names the endpoint and suggests the OkHttp sender or a fully qualified host name. The gRPC check applies only when noManagedChannelis set explicitly, because an explicit channel doesn't use the endpoint.Tests
JdkHttpSenderProviderTest: throws for unparseable hosts, and succeeds forlocalhostand a*.svc.cluster.localname.UpstreamGrpcSenderProviderTest: the fallback channel throws, and an explicitly set channel still succeeds.🤖 Generated with Claude Code