I was trying to configure my application to send data to Grafana Cloud using OpenTelemetry protocol according to instructions at Send data using OpenTelemetry Protocol (OTLP) | Grafana Cloud documentation. So I configured my application to publish to specified endpoint (https://otlp-gateway-prod-us-central-0.grafana.net/otlp) using specified protocol (http/protobuf) and specified authentication (Authorization=Basic base64(instace:key)). But for endpoint generated according to that page my application consistently gets 404 error.
Are there any hidden/missing settings which need to be turned on?
Thanks a lot for response. Iâm using OpenTelemetry Protocol Exporter with .NET code. The configuration adds exporter like this:
AddOtlpExporter(o =>
{
o.Endpoint = new Uri(cfg.Endpoint);
o.Protocol = OtlpExportProtocol.HttpProtobuf;
o.Headers = cfg.Headers;
});
}
Here cfg.Endpoint = âhttps://otlp-gateway-prod-us-central-0.grafana.net/otlpâ and cfg.Headers = âAuthorization=Basic NjE2âŚMwPQ==â.
When trying to report metrics and traces the code throws exception
System.Net.Http.HttpRequestException
HResult=0x80131500
Message=Response status code does not indicate success: 404 (Not Found).
Source=System.Net.Http
StackTrace:
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
This exception was originally thrown at this call stack:
System.Net.Http.dll!System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() Unknown No symbols loaded.
OpenTelemetry.Exporter.OpenTelemetryProtocol.dll!OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ExportClient.BaseOtlpHttpExportClient<OpenTelemetry.Proto.Collector.Trace.V1.ExportTraceServiceRequest>.SendExportRequest(OpenTelemetry.Proto.Collector.Trace.V1.ExportTraceServiceRequest request, System.Threading.CancellationToken cancellationToken) Unknown No symbols loaded.
OpenTelemetry.Exporter.OpenTelemetryProtocol.dll!OpenTelemetry.Exporter.OtlpTraceExporter.Export(OpenTelemetry.Batch<System.Diagnostics.Activity> activityBatch) Unknown No symbols loaded.
OpenTelemetry.dll!OpenTelemetry.BatchExportProcessor<System.Diagnostics.Activity>.ExporterProc() Unknown No symbols loaded.
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown No symbols loaded.
@robertlankford Thank you so much. This solved the issue for me.
After appending /v1/traces to the URL I got a â401 Unauthenticatedâ error because the library I use (opentelementry-otlp for Rust) does not yet support OTEL_EXPORTER_OTLP_HEADERS. Configuring everything in code solved that issue too, and now it works
I ended up with setting the âOTEL_EXPORTER_OTLP_ENDPOINTâ, âOTEL_EXPORTER_OTLP_HEADERSâ, âOTEL_EXPORTER_OTLP_PROTOCOLâ environment variables like they are provided by Grafana in the cloud UI for the stack. Then i created a instance of the OTLPMetricExporter without any parameters. That did work and the solution is better than setting this in the code itself.
Hello, I got this error "OpenTelemetry Javaagent failed to start
io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException: Unsupported OTLP metrics protocol: âhttp/protobufâ when trying to run my java application with opentelemetry agent connect to OTLP endpoint. Does anyone here face this issue?
This my env config:
OTEL_SERVICE_NAME=âxxxâ