POST/v1/traces

Export OpenTelemetry traces

Requires an API token with LOGS:SEND. Supports gzip compression.

Body parameters

resourceSpans:array | nulloptional
resource:object | nulloptional
schemaUrl:string | nulloptional
scopeSpans:array | nulloptional
scope:object | nulloptional
schemaUrl:string | nulloptional
spans:array | nulloptional
traceId:string
spanId:string
parentSpanId:string | nulloptional
traceState:string | nulloptional
flags:integer | nulloptional
name:string
kind:integer | nulloptional
startTimeUnixNano:any
*anonymous*:stringoptional
*anonymous*:integeroptional
endTimeUnixNano:any
*anonymous*:stringoptional
*anonymous*:integeroptional
attributes:array | nulloptional
key:string
value:anyoptional
droppedAttributesCount:integer | nulloptional
events:array | nulloptional
timeUnixNano:any
*anonymous*:stringoptional
*anonymous*:integeroptional
name:string
attributes:array | nulloptional
key:string
value:anyoptional
droppedAttributesCount:integer | nulloptional
droppedEventsCount:integer | nulloptional
links:array | nulloptional
traceId:string
spanId:string
traceState:string | nulloptional
attributes:array | nulloptional
key:string
value:anyoptional
droppedAttributesCount:integer | nulloptional
flags:integer | nulloptional
droppedLinksCount:integer | nulloptional
status:object | nulloptional

Responses

StatusMeaningDescription
200OKOTLP full success, in the request encoding
400Bad RequestInvalid OTLP export
401UnauthorizedMissing or invalid API token
403ForbiddenRequires an explicit LOGS:SEND grant
405Method Not AllowedRequires POST
413Payload Too LargeExport or record exceeds a size limit
415Unsupported Media TypeUnsupported content type or compression
429Too Many RequestsShared logs and traces ingestion allowance exceeded
503Service UnavailableIngestion unavailable or delivery not confirmed

Request

POST
/v1/traces
curl --request POST \
  --url https://api.onlineornot.com/v1/traces \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"resourceSpans":[{"resource":{"attributes":[{"key":"string","value":null}],"droppedAttributesCount":4294967295},"schemaUrl":"string","scopeSpans":[{"scope":{"attributes":[{"key":"string","value":null}],"droppedAttributesCount":4294967295,"name":"string","version":"string"},"schemaUrl":"string","spans":[{"traceId":"string","spanId":"string","parentSpanId":"string","traceState":"string","flags":4294967295,"name":"string","kind":5,"startTimeUnixNano":"string","endTimeUnixNano":"string","attributes":[{"key":"string","value":null}],"droppedAttributesCount":4294967295,"events":[{"timeUnixNano":"string","name":"string","attributes":[{"key":"string","value":null}],"droppedAttributesCount":4294967295}],"droppedEventsCount":4294967295,"links":[{"traceId":"string","spanId":"string","traceState":"string","attributes":[{"key":"string","value":null}],"droppedAttributesCount":4294967295,"flags":4294967295}],"droppedLinksCount":4294967295,"status":{"code":2,"message":"string"}}]}]}]}'

Response

{}

Response Headers

StatusHeaderTypeFormatDescription
429Retry-AfterintegerSeconds until the next billing period

GET/v1/traces

Search spans

Search spans by receipt time, optionally filtered to a trace ID. Traces and logs share the monthly ingestion allowance and 30-day retention.

Requires LOGS:READ.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Query parameters

from:string(date-time)
Inclusive server receipt time, in RFC 3339 format.
to:string(date-time)
Exclusive server receipt time, at most one hour after from.
limit:integeroptional
Default: 50
cursor:stringoptional
project_id:anyoptional
service:stringoptional
environment:stringoptional
trace_id:stringoptional
status_code:stringoptional
Accepted values: "0" | "1" | "2"

Responses

StatusMeaningDescription
200OKMatching spans and a continuation cursor
400Bad RequestInvalid or unbounded search request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
404Not FoundProject not found
500Internal Server ErrorInternal server error
503Service UnavailableTrace search unavailable

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/traces
curl --request GET \
  --url 'https://api.onlineornot.com/v1/traces?from=2019-08-24T14%3A15%3A22Z&to=2019-08-24T14%3A15%3A22Z' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "spans": [
      {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "project_id": "string",
        "received_at": "2019-08-24T14:15:22Z",
        "trace_id": "string",
        "span_id": "string",
        "parent_span_id": "string",
        "name": "string",
        "service": "string",
        "environment": "string",
        "kind": 0,
        "start_time_unix_nano": "string",
        "end_time_unix_nano": "string",
        "duration_ms": 0,
        "status_code": 0,
        "status_message": "string",
        "trace_state": "string",
        "flags": 0,
        "attributes": {
          "property1": {},
          "property2": {}
        },
        "resource": {
          "property1": {},
          "property2": {}
        },
        "scope": {
          "property1": {},
          "property2": {}
        },
        "events": [
          {}
        ],
        "links": [
          {}
        ],
        "dropped_attributes_count": 0,
        "dropped_events_count": 0,
        "dropped_links_count": 0
      }
    ],
    "next_cursor": "string",
    "scanned_bytes": 0
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?