==============================================================
curl -X POST \
-H "Content-Type: application/json" \
-d '<sample otel trace json>' \
http://<collector_host>:<collector_http_port>/v1/traces -v
-
collector_host -> Server host on which opentelemetry collector is running.
-
collector_http_port -> Server port on which opentelemetry collector is listening at. By default http port is 4318.
curl -X POST \
-H "Content-Type: application/json" \
-d '{"resourceSpans":[{"resource":{"attributes":[{"key":"resource-attr","value":{"stringValue":"resource-attr-val- 1"}}]},"scopeSpans":[{"scope":{},"spans":[{"traceId":"","spanId":"","parentSpanId":"","name":"operationA","startTimeUnixNano":"1581452772000000321","endTimeUnixNano":"1581452773000000789","droppedAttributesCount":1,"events":[{"timeUnixNano":"1581452773000000123","name":"event-with-attr","attributes":[{"key":"span-event-attr","value":{"stringValue":"span-event-attr-val"}}],"droppedAttributesCount":2},{"timeUnixNano":"1581452773000000123","name":"event","droppedAttributesCount":2}],"droppedEventsCount":1,"status":{"message":"status-cancelled","code":2}},{"traceId":"","spanId":"","parentSpanId":"","name":"operationB","startTimeUnixNano":"1581452772000000321","endTimeUnixNano":"1581452773000000789","links":[{"traceId":"","spanId":"","attributes":[{"key":"span-link-attr","value":{"stringValue":"span-link-attr-val"}}],"droppedAttributesCount":4},{"traceId":"","spanId":"","droppedAttributesCount":1}],"droppedLinksCount":3,"status":{}}]}]}]}' \
http://localhost:4318/v1/traces -v
============================
curl -X POST \
-x http://proxy_server:proxy_port \
-H "Content-Type: application/json" \
-d '<sample otel trace json>' \
http://<collector_host>:<collector_http_port>/v1/traces -v