Description
Setting up an otlp exporter to connect locally like so works great:
exporter, err := otlp.NewExporter(ctx,
otlpgrpc.NewDriver(
otlpgrpc.WithEndpoint("localhost:55680"),
otlpgrpc.WithInsecure(),
),
)
Setting up the same exporter to connect to a collector running on a different host behind a proxy or load balancer like so does NOT work however:
exporter, err := otlp.NewExporter(ctx,
otlpgrpc.NewDriver(
otlpgrpc.WithEndpoint("someotherhost:8080/myotelpath"),
otlpgrpc.WithInsecure(),
),
)
The latter results in the following error:
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp: lookup tcp/8080/myotelpath: nodename nor servname provided, or not known"
It turns out, the otlp exporter does not allow a URI path to be appended to the endpoint configuration. While someotherhost:8080 is ok, someotherhost:8080/myotelpath is not ok. The underlying config object does have a URLPath field in addition to the Endpoint field, but while the endpoint config is exposed as otlpgrpc.WithEndpoint() there is no corresponding otlpgrpc.WithURLPath(). Therefore, it doesn't seem possible to reach an otlp collector behind a proxy or a load balancer currently. Are there any plans to allow this?
Description
Setting up an otlp exporter to connect locally like so works great:
Setting up the same exporter to connect to a collector running on a different host behind a proxy or load balancer like so does NOT work however:
The latter results in the following error:
It turns out, the otlp exporter does not allow a URI path to be appended to the endpoint configuration. While someotherhost:8080 is ok, someotherhost:8080/myotelpath is not ok. The underlying config object does have a URLPath field in addition to the Endpoint field, but while the endpoint config is exposed as otlpgrpc.WithEndpoint() there is no corresponding otlpgrpc.WithURLPath(). Therefore, it doesn't seem possible to reach an otlp collector behind a proxy or a load balancer currently. Are there any plans to allow this?