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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With