Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send traces to OpenTelemetry collector

I am currently trying to send data to an OpenTelemetry OTLP collector. I cannot use any provided libraries because the application is written in Smalltalk. I have the span and trace data already. What I am missing is a way to get that data from my application to the collector. My idea was to just simply send the data as a JSON String, but I’m not able to find any examples.

Can somebody provide a example request?

like image 264
Apollo Avatar asked Jan 23 '26 16:01

Apollo


1 Answers

Minimal curl example:

curl -H "Content-Type: application/json" \
 -d @trace.json \
  <collector-base-url>/v1/traces

Correct Content-Type header and /v1/traces path. Of course OTEL collector may have enabled some auth, then also auth must be provided in the request (basic auth, api key, ...).

Keep in mind: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md#otlphttp

JSON format is Experimental

JSON format is working fine with recent OTEL collector versions, based on my personal experience. But it is still experimental format only. Serious stable implementation will need OTLP/HTTP Protobuf payloads encoded in binary format.

like image 144
Jan Garaj Avatar answered Jan 26 '26 23:01

Jan Garaj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!