Skip to main content

Query Traces

Query traces from Oodle using the HTTP API. This API supports querying traces by various filters including service, operation, duration, and custom labels with complex matchers (equals, not equals, regex, one-of).

Configuration

To query traces from Oodle via HTTP, you'll need the following values:

  • OODLE_INSTANCE: Your Oodle instance ID. Go to Settings icon -> API Keys page in your Oodle UI to find out. (Oodle UI links: ap1, us1)
  • OODLE_API_KEY: Your Oodle API key for authentication. Go to Settings icon -> API Keys in your Oodle UI to choose an appropriate key. (Oodle UI links: ap1, us1)

Steps

Query Traces Integration

You can find the required Query Traces configuration values by doing the following:

  1. Login to the Oodle UI, then navigate to Settings page
  2. Click on the Traces Query API tile
  3. Choose an appropriate API key from the list on top of the drawer

Follow the steps specified in the drawer to query Traces from Oodle via HTTP requests.

API Endpoints

Labels API

Get all available label names for traces.

Endpoint: GET /v1/api/instance/<OODLE_INSTANCE>/traces/labels

# Get all available label names
curl "https://<OODLE_INSTANCE>.api.oodle.ai/v1/api/instance/<OODLE_INSTANCE>/traces/labels?end=1748000156000000" \
-H "X-OODLE-INSTANCE: <OODLE_INSTANCE>" \
-H "X-API-KEY: <OODLE_API_KEY>"

Label Values API

Get all values for a specific label. Supports filtering by other labels.

Endpoint: GET /v1/api/instance/<OODLE_INSTANCE>/traces/labels/{label_name}/values

# Get values for a specific label (e.g., resource::service.name)
curl "https://<OODLE_INSTANCE>.api.oodle.ai/v1/api/instance/<OODLE_INSTANCE>/traces/labels/resource::service.name/values?end=1748000156000000" \
-H "X-OODLE-INSTANCE: <OODLE_INSTANCE>" \
-H "X-API-KEY: <OODLE_API_KEY>"

# With filters - get span::http.status_code values for a specific service
curl "https://<OODLE_INSTANCE>.api.oodle.ai/v1/api/instance/<OODLE_INSTANCE>/traces/labels/span::http.status_code/values?end=1748000156000000&filters=$(echo '[{"name":"resource::service.name","type":"EQ","value":"my-service"}]' | jq -sRr @uri)" \
-H "X-OODLE-INSTANCE: <OODLE_INSTANCE>" \
-H "X-API-KEY: <OODLE_API_KEY>"

Traces API

Query traces with various filters. Returns complete traces grouped by trace ID.

Endpoint: GET /v1/api/instance/<OODLE_INSTANCE>/traces/traces

# Query traces with basic filters
curl "https://<OODLE_INSTANCE>.api.oodle.ai/v1/api/instance/<OODLE_INSTANCE>/traces/traces?start=1747913756000000&end=1748000156000000&limit=20&service=my-service&operation=GET%20/api/users&minDuration=100ms" \
-H "X-OODLE-INSTANCE: <OODLE_INSTANCE>" \
-H "X-API-KEY: <OODLE_API_KEY>"

# Query traces with filters (supports EQ, NEQ, RE, NRE, ONE_OF)
curl "https://<OODLE_INSTANCE>.api.oodle.ai/v1/api/instance/<OODLE_INSTANCE>/traces/traces?start=1747913756000000&end=1748000156000000&limit=20&filters=$(echo '[{"name":"resource::service.name","type":"EQ","value":"my-service"},{"name":"span::http.status_code","type":"RE","value":"5.."}]' | jq -sRr @uri)" \
-H "X-OODLE-INSTANCE: <OODLE_INSTANCE>" \
-H "X-API-KEY: <OODLE_API_KEY>"

Trace by ID API

Get a specific trace by its ID.

Endpoint: GET /v1/api/instance/<OODLE_INSTANCE>/traces/traces/{trace_id}

# Get a specific trace by ID
curl "https://<OODLE_INSTANCE>.api.oodle.ai/v1/api/instance/<OODLE_INSTANCE>/traces/traces/<TRACE_ID>?start=1747913756000000&end=1748000156000000" \
-H "X-OODLE-INSTANCE: <OODLE_INSTANCE>" \
-H "X-API-KEY: <OODLE_API_KEY>"

Query Parameters Reference

ParameterTypeRequiredDescription
startintegerYes (for traces)Start timestamp in microseconds
endintegerYes (for traces), Optional (for labels)End timestamp in microseconds
servicestringNoFilter by service name (exact match)
operationstringNoFilter by operation/span name (exact match)
minDurationstringNoMinimum span duration (e.g., 100ms, 1s, 500us)
maxDurationstringNoMaximum span duration
limitintegerNoMaximum number of results to return
filtersJSONNoJSON array of matchers (see Filter Types below)

Time Formats

Timestamps must be provided in microseconds (Unix epoch):

  • 1 second = 1,000,000 microseconds
  • Example: January 1, 2025 00:00:00 UTC = 1735689600000000

Duration Formats

Duration parameters accept human-readable formats:

  • 100ms - 100 milliseconds
  • 1s - 1 second
  • 500us - 500 microseconds

Filter Types

The filters parameter accepts a JSON array of matcher objects with the following structure:

[{ "name": "label_name", "type": "EQ", "value": "value" }]
TypeDescription
EQEquals: exact match
NEQNot equals: exclude matching values
RERegex: match using regular expression (e.g., "5.." for 5xx status codes)
NRENot regex: exclude values matching the regex
ONE_OFOne of: match any value in the list (use multiValue instead of value)
note

Filter types are case-insensitive. "eq", "EQ", and "Eq" are all valid.

Combining Filters (AND/OR Logic)

All filters in the array are combined with AND logic at the top level. Nested AND/OR combinations are not supported.

AND: Multiple filters in the array

[
{"name": "resource::service.name", "type": "EQ", "value": "api"},
{"name": "span::http.status_code", "type": "RE", "value": "5.."}
]

→ resource::service.name = "api" AND span::http.status_code matches 5xx

OR within a single field: Use ONE_OF

[
{"name": "resource::deployment.environment", "type": "ONE_OF", "multiValue": ["prod", "staging"]}
]

→ resource::deployment.environment = "prod" OR resource::deployment.environment = "staging"

OR within a single field: Use Regex (RE)

[
{"name": "span::http.status_code", "type": "RE", "value": "4..|5.."}
]

→ span::http.status_code matches 4xx OR 5xx

Combined example: AND + OR

[
{"name": "resource::service.name", "type": "EQ", "value": "api"},
{"name": "resource::deployment.environment", "type": "ONE_OF", "multiValue": ["prod", "staging"]},
{"name": "span::http.status_code", "type": "RE", "value": "5.."}
]

→ resource::service.name = "api" AND (resource::deployment.environment = "prod" OR resource::deployment.environment = "staging") AND span::http.status_code matches 5xx

Response Format

Traces Response

{
"data": [
{
"traceID": "abc123def456",
"spans": [
{
"traceID": "abc123def456",
"spanID": "span123",
"operationName": "GET /api/users",
"serviceName": "api-server",
"startTime": 1747913756000000,
"duration": 150000,
"tags": [
{"key": "http.method", "value": "GET"},
{"key": "http.status_code", "value": "200"}
],
"logs": [],
"references": []
}
],
"processes": {
"p1": {
"serviceName": "api-server",
"tags": []
}
}
}
],
"total": 1,
"limit": 20,
"offset": 0,
"errors": null
}

Labels Response

{
"data": ["resource::service.name", "span::http.status_code", "resource::deployment.environment"],
"total": 3,
"errors": null
}

Available Endpoints

EndpointMethodDescription
/traces/labelsGETList available trace labels
/traces/labels/{label}/valuesGETGet values for a label
/traces/tracesGETSearch traces with filters
/traces/traces/{traceId}GETGet a specific trace by ID

Support

If you need assistance or have any questions, please reach out to us through:

  • The help chat widget available on the Support link in the sidebar
  • Email at support@oodle.ai