diff --git a/specification/resources/insights/examples/curl/insights_post_spansSearch.yml b/specification/resources/insights/examples/curl/insights_post_spansSearch.yml index 66c20f1c1..478e128e4 100644 --- a/specification/resources/insights/examples/curl/insights_post_spansSearch.yml +++ b/specification/resources/insights/examples/curl/insights_post_spansSearch.yml @@ -4,29 +4,28 @@ source: |- -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ -H "Content-Type: application/json" \ -d '{ - "timeRange": { + "time_range": { "from": {"relative": "1h"}, "to": {"relative": "now"} }, "filter": { - "type": "and", - "expressions": [ - { - "type": "condition", - "field": {"name": "service.name"}, - "operator": "eq", - "value": {"type": "string", "value": "api-gateway"} - }, - { - "type": "condition", - "field": {"name": "statusCode"}, - "operator": "eq", - "value": {"type": "string", "value": "Error"} - } - ] + "and": { + "expressions": [ + {"condition": { + "field": {"name": "service.name"}, + "operator": "FILTER_OPERATOR_EQ", + "value": {"string_value": "api-gateway"} + }}, + {"condition": { + "field": {"name": "status_code"}, + "operator": "FILTER_OPERATOR_EQ", + "value": {"string_value": "Error"} + }} + ] + } }, - "orderBy": [ - {"field": {"name": "startTime"}, "direction": "desc"} + "order_by": [ + {"field": {"name": "start_time"}, "direction": "desc"} ], "pagination": {"limit": 100} }' \ diff --git a/specification/resources/insights/examples/curl/insights_post_tracesSearch.yml b/specification/resources/insights/examples/curl/insights_post_tracesSearch.yml index 54d80abb3..bad995bc0 100644 --- a/specification/resources/insights/examples/curl/insights_post_tracesSearch.yml +++ b/specification/resources/insights/examples/curl/insights_post_tracesSearch.yml @@ -4,18 +4,19 @@ source: |- -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ -H "Content-Type: application/json" \ -d '{ - "timeRange": { + "time_range": { "from": {"relative": "24h"}, "to": {"relative": "now"} }, "filter": { - "type": "and", - "expressions": [ - {"type": "condition", "field": {"name": "service.name"}, "operator": "eq", "value": "checkout-api"}, - {"type": "text_search", "query": "timeout"} - ] + "and": { + "expressions": [ + {"condition": {"field": {"name": "service.name"}, "operator": "FILTER_OPERATOR_EQ", "value": {"string_value": "checkout-api"}}}, + {"text_search": {"query": "timeout"}} + ] + } }, - "orderBy": [{"field": {"name": "durationNs"}, "direction": "desc"}], + "order_by": [{"field": {"name": "duration_ns"}, "direction": "desc"}], "pagination": {"limit": 50} }' \ "https://api.digitalocean.com/v2/insights/query/nyc3/traces/search" diff --git a/specification/resources/insights/insights_get_trace.yml b/specification/resources/insights/insights_get_trace.yml index 106adfa28..493154287 100644 --- a/specification/resources/insights/insights_get_trace.yml +++ b/specification/resources/insights/insights_get_trace.yml @@ -29,8 +29,9 @@ description: >- the regional traces backend cannot be reached, the response is `502` with a `text/plain` body. - JSON field names are camelCase (`traceId`, `spanId`, `startTime`, `endTime`, - `durationNs`, `serviceName`, `statusCode`, `parentSpanId`). + JSON field names use snake_case (`trace_id`, `span_id`, `start_time`, + `end_time`, `duration_ns`, `service_name`, `status_code`, + `parent_span_id`). tags: - Insights diff --git a/specification/resources/insights/insights_post_spansSearch.yml b/specification/resources/insights/insights_post_spansSearch.yml index 9d6b3d60c..682c299ee 100644 --- a/specification/resources/insights/insights_post_spansSearch.yml +++ b/specification/resources/insights/insights_post_spansSearch.yml @@ -8,8 +8,8 @@ description: >- time range, optional filter, ordering, and pagination. The time range must not exceed 7 days. `pagination.limit` defaults to 100 and - must be between 1 and 1000. Results are ordered by `startTime` descending by - default. Cursor-based pagination is not yet supported; `pagination.hasMore` + must be between 1 and 1000. Results are ordered by `start_time` descending by + default. Cursor-based pagination is not yet supported; `pagination.has_more` indicates whether additional spans matched beyond the returned page. tags: diff --git a/specification/resources/insights/insights_post_tracesSearch.yml b/specification/resources/insights/insights_post_tracesSearch.yml index a1f8b753a..435de525f 100644 --- a/specification/resources/insights/insights_post_tracesSearch.yml +++ b/specification/resources/insights/insights_post_tracesSearch.yml @@ -12,10 +12,10 @@ description: >- `filter`. The time range must not exceed 7 days (`168h`). `pagination.limit` defaults to 100 (also used when `limit` is `0`) and must be between 0 and 1000. Results are ordered by `started` descending unless - `orderBy` is set. + `order_by` is set. - JSON field names are camelCase (`timeRange`, `orderBy`, `hasMore`, - `traceId`). Unknown request properties, invalid filters, and out-of-range + JSON field names use snake_case (`time_range`, `order_by`, `has_more`, + `trace_id`). Unknown request properties, invalid filters, and out-of-range values are rejected with `400`. Each request searches a single region; there is no multi-region search. @@ -48,7 +48,7 @@ requestBody: recent: summary: Most recent traces in the last 15 minutes value: - timeRange: + time_range: from: relative: 15m to: @@ -58,56 +58,62 @@ requestBody: filtered: summary: Traces from one service whose spans mention "timeout" value: - timeRange: + time_range: from: relative: 24h to: relative: now filter: - type: and - expressions: - - type: condition - field: - name: service.name - operator: eq - value: checkout-api - - type: text_search - query: timeout + and: + expressions: + - condition: + field: + name: service.name + operator: FILTER_OPERATOR_EQ + value: + string_value: checkout-api + - text_search: + query: timeout pagination: limit: 100 attributeIn: summary: Traces with error spans from either of two hosts value: - timeRange: + time_range: from: absolute: "2026-10-09T00:00:00Z" to: absolute: "2026-10-09T06:00:00Z" filter: - type: and - expressions: - - field: - name: statusCode - operator: eq - value: Error - - field: - name: host.name - scope: resource - operator: in - value: - - web-01 - - web-02 + and: + expressions: + - condition: + field: + name: status_code + operator: FILTER_OPERATOR_EQ + value: + string_value: Error + - condition: + field: + name: host.name + scope: FIELD_SCOPE_RESOURCE + operator: FILTER_OPERATOR_IN + value: + string_array_value: + values: + - web-01 + - web-02 ordered: summary: Slowest traces first, ties broken by oldest start value: - timeRange: + time_range: from: relative: 1h to: relative: now - orderBy: + order_by: - field: - name: durationNs + name: duration_ns direction: desc - field: name: started diff --git a/specification/resources/insights/models/span_record.yml b/specification/resources/insights/models/span_record.yml index 4bccc3a51..746dcc084 100644 --- a/specification/resources/insights/models/span_record.yml +++ b/specification/resources/insights/models/span_record.yml @@ -1,29 +1,29 @@ type: object description: A single span returned by a spans search. properties: - traceId: + trace_id: type: string description: The trace identifier the span belongs to. example: "4bf92f3577b34da6a3ce929d0e0e4736" - spanId: + span_id: type: string description: The span identifier. example: "00f067aa0ba902b7" - parentSpanId: + parent_span_id: type: string description: The parent span identifier. Omitted for root spans. example: "00f067aa0ba902b6" - startTime: + start_time: type: string format: date-time description: The span start time. example: "2026-09-30T00:00:00Z" - endTime: + end_time: type: string format: date-time description: The span end time. example: "2026-09-30T00:00:01Z" - durationNs: + duration_ns: type: integer format: int64 description: The span duration in nanoseconds. @@ -36,15 +36,15 @@ properties: type: string description: The span kind. example: "Server" - statusCode: + status_code: type: string description: The span status code. example: "Ok" - statusMessage: + status_message: type: string description: The span status message. Omitted when empty. example: "connection reset by peer" - serviceName: + service_name: type: string description: The name of the service that emitted the span. example: "api-gateway" diff --git a/specification/resources/insights/models/spans_filter_condition.yml b/specification/resources/insights/models/spans_filter_condition.yml new file mode 100644 index 000000000..6cda540b1 --- /dev/null +++ b/specification/resources/insights/models/spans_filter_condition.yml @@ -0,0 +1,40 @@ +type: object +description: A single field comparison in a spans filter expression. +required: + - field + - operator +oneOf: + - properties: + operator: + type: string + enum: + - FILTER_OPERATOR_EXISTS + example: FILTER_OPERATOR_EXISTS + - required: + - value + properties: + operator: + type: string + enum: + - FILTER_OPERATOR_EQ + - FILTER_OPERATOR_NEQ + - FILTER_OPERATOR_IN + - FILTER_OPERATOR_GTE + - FILTER_OPERATOR_LTE + example: FILTER_OPERATOR_EQ +properties: + field: + $ref: 'spans_filter_field.yml' + operator: + type: string + description: The comparison operator. + enum: + - FILTER_OPERATOR_EQ + - FILTER_OPERATOR_NEQ + - FILTER_OPERATOR_IN + - FILTER_OPERATOR_EXISTS + - FILTER_OPERATOR_GTE + - FILTER_OPERATOR_LTE + example: FILTER_OPERATOR_EQ + value: + $ref: 'spans_filter_value.yml' diff --git a/specification/resources/insights/models/spans_filter_expression.yml b/specification/resources/insights/models/spans_filter_expression.yml index a2f13ee4f..4735dc45f 100644 --- a/specification/resources/insights/models/spans_filter_expression.yml +++ b/specification/resources/insights/models/spans_filter_expression.yml @@ -1,45 +1,58 @@ type: object description: >- - A boolean filter tree for spans search. Set `type` to select the node kind: - `condition` compares a single field, `and`/`or`/`not` combine child - expressions, and `text_search` matches a substring across the span name, - service name, and status message. -required: - - type -properties: - type: - type: string - description: The node kind. - enum: + A boolean filter tree for spans queries. Exactly one node is set per + message. Trees may be nested at most 16 levels deep and contain at most 256 + nodes in total. +oneOf: + - required: - condition + - required: - and + - required: - or + - required: - not + - required: - text_search - example: condition - field: - $ref: 'spans_filter_field.yml' - operator: - type: string - description: The comparison operator for a `condition` node. - enum: - - eq - - neq - - gt - - gte - - lt - - lte - - in - - exists - example: eq - value: - $ref: 'spans_filter_value.yml' - expressions: - type: array - description: Child expressions for `and`, `or`, and `not` nodes. - items: - $ref: 'spans_filter_expression.yml' - query: - type: string - description: The substring to match for a `text_search` node. - example: "timeout" +properties: + condition: + $ref: 'spans_filter_condition.yml' + and: + type: object + required: + - expressions + properties: + expressions: + type: array + minItems: 1 + maxItems: 32 + items: + $ref: 'spans_filter_expression.yml' + or: + type: object + required: + - expressions + properties: + expressions: + type: array + minItems: 1 + maxItems: 32 + items: + $ref: 'spans_filter_expression.yml' + not: + $ref: 'spans_filter_expression.yml' + text_search: + type: object + description: A substring search across the span name, service name, and status message. + required: + - query + properties: + query: + type: string + minLength: 1 + maxLength: 256 + pattern: '\S' + description: >- + The search string. Leading and trailing whitespace is trimmed, and + the remaining string must not be empty. + example: "timeout" diff --git a/specification/resources/insights/models/spans_filter_field.yml b/specification/resources/insights/models/spans_filter_field.yml index 252dc32a8..2e03ab0cd 100644 --- a/specification/resources/insights/models/spans_filter_field.yml +++ b/specification/resources/insights/models/spans_filter_field.yml @@ -6,18 +6,27 @@ properties: name: type: string description: >- - The field name. Well-known span fields include `traceId`, `spanId`, - `parentSpanId`, `startTime`, `endTime`, `durationNs`, `name`, - `serviceName`, `kind`, `statusCode`, and `statusMessage`. Any other value + The field name. Well-known span fields include `trace_id`, `span_id`, + `parent_span_id`, `start_time`, `end_time`, `duration_ns`, `name`, + `service_name`, `kind`, `status_code`, and `status_message`. Any other value is treated as a span or resource attribute key. example: service.name scope: type: string description: >- - Optional attribute scope. Use `resource` to match a resource attribute or - `attributes` to match a span attribute. Omit for well-known fields or to - search both attribute maps. + Optional attribute scope, matched case-insensitively. Use + `FIELD_SCOPE_RESOURCE` to match a resource attribute or + `FIELD_SCOPE_ATTRIBUTES` to match a span attribute. The aliases + `resource` and `resource.attributes` are accepted for resource + attributes; `attribute`, `attributes`, and `span.attributes` are + accepted for span attributes. Omit for well-known fields or to search + both attribute maps. enum: + - FIELD_SCOPE_RESOURCE + - FIELD_SCOPE_ATTRIBUTES - resource + - resource.attributes + - attribute - attributes - example: attributes + - span.attributes + example: FIELD_SCOPE_ATTRIBUTES diff --git a/specification/resources/insights/models/spans_filter_value.yml b/specification/resources/insights/models/spans_filter_value.yml index 9266faf4f..67e551707 100644 --- a/specification/resources/insights/models/spans_filter_value.yml +++ b/specification/resources/insights/models/spans_filter_value.yml @@ -1,37 +1,46 @@ -description: >- - A filter comparison value. Provide either a bare JSON scalar or string array, - or a typed wrapper of the form `{ "type": "string", "value": "..." }`. -example: - type: string - value: "api-gateway" +type: object +description: A typed literal or list value for a spans filter condition. Exactly one kind is set per message. oneOf: - - type: string - - type: number - - type: boolean - - type: array - items: - type: string - - type: object - description: A typed value wrapper. + - required: + - string_value + - required: + - number_value + - required: + - string_array_value + - required: + - number_array_value +properties: + string_value: + type: string + example: "api-gateway" + number_value: + type: number + example: 42 + string_array_value: + type: object required: - - value + - values properties: - type: - type: string - description: The value type. - enum: - - string - - number - - bool - - string_array - example: string - value: - description: The scalar or array value, matching `type`. - example: "api-gateway" - oneOf: - - type: string - - type: number - - type: boolean - - type: array - items: - type: string + values: + type: array + minItems: 1 + maxItems: 100 + items: + type: string + example: + - "api-gateway" + - "checkout" + number_array_value: + type: object + required: + - values + properties: + values: + type: array + minItems: 1 + maxItems: 100 + items: + type: number + example: + - 42 + - 84 diff --git a/specification/resources/insights/models/spans_order_by.yml b/specification/resources/insights/models/spans_order_by.yml index c22657f61..0d905fd46 100644 --- a/specification/resources/insights/models/spans_order_by.yml +++ b/specification/resources/insights/models/spans_order_by.yml @@ -7,7 +7,9 @@ properties: $ref: 'spans_filter_field.yml' direction: type: string - description: The sort direction. Defaults to `desc` when omitted. + description: >- + The sort direction, matched case-insensitively. Omit to use the server + default. enum: - asc - desc diff --git a/specification/resources/insights/models/spans_pagination_response.yml b/specification/resources/insights/models/spans_pagination_response.yml index c42b905c8..f32e52d2f 100644 --- a/specification/resources/insights/models/spans_pagination_response.yml +++ b/specification/resources/insights/models/spans_pagination_response.yml @@ -1,7 +1,7 @@ type: object description: Pagination metadata for a spans search response. properties: - hasMore: + has_more: type: boolean description: >- Whether more spans matched than were returned in this page. Cursor-based diff --git a/specification/resources/insights/models/spans_search_request.yml b/specification/resources/insights/models/spans_search_request.yml index 818c9b8cf..1a41fdb4a 100644 --- a/specification/resources/insights/models/spans_search_request.yml +++ b/specification/resources/insights/models/spans_search_request.yml @@ -1,16 +1,16 @@ type: object description: Request body for searching spans. required: - - timeRange + - time_range properties: - timeRange: + time_range: $ref: 'spans_time_range.yml' filter: $ref: 'spans_filter_expression.yml' - orderBy: + order_by: type: array description: >- - Sort clauses applied to the result set. Defaults to `startTime` + Sort clauses applied to the result set. Defaults to `start_time` descending when omitted. items: $ref: 'spans_order_by.yml' diff --git a/specification/resources/insights/models/traces_field_ref.yml b/specification/resources/insights/models/traces_field_ref.yml index 6064c4d10..73c5b637e 100644 --- a/specification/resources/insights/models/traces_field_ref.yml +++ b/specification/resources/insights/models/traces_field_ref.yml @@ -1,5 +1,5 @@ type: object -description: A reference to a span field, used in filters and `orderBy`. +description: A reference to a span field, used in filters and `order_by`. additionalProperties: false required: - name @@ -8,34 +8,35 @@ properties: type: string description: >- The field name. Without `scope`, these names (case-insensitive) resolve - to built-in span columns: `traceId` (`trace.id`, `trace_id`), `spanId` - (`span.id`, `span_id`), `parentSpanId` (`parent.span.id`, - `parent_span_id`), `startTime` (`start_time`, `timestamp`), `endTime` - (`end_time`), `durationNs` (`duration`, in nanoseconds), `name` - (`span.name`), `kind` (`span.kind`), `statusCode` (`status.code`, - `status_code`), `statusMessage` (`status.message`, `status_message`), - and `serviceName` (`service.name`, `service_name`). Any other name is + to built-in span columns: `trace_id`, `span_id`, `parent_span_id`, + `start_time`, `end_time`, `duration_ns`, `name` + (`span.name`), `kind` (`span.kind`), `status_code` (`status.code`, + `status_code`), `status_message`, + and `service_name` (`service.name`). Any other name is looked up as a span attribute, falling back to a resource attribute. With `scope` set, `name` is always treated as an attribute key. Attribute keys may contain only letters, digits, and `.`, `_`, `-`, `/`, `:`, `@`. - In traces `orderBy`, `name` must be a trace-level sort field instead; - see the `orderBy` field description. + In traces `order_by`, `name` must be a trace-level sort field instead; + see the `order_by` field description. example: service.name scope: type: string description: >- - Restricts the lookup to one attribute map (case-insensitive). - `resource` (or `resource.attributes`) reads resource attributes; - `attribute` (or `attributes`, `span.attributes`) reads span attributes. - Omit to use the built-in column mapping described for `name`. Ignored - in traces `orderBy`. + Restricts the lookup to one attribute map and is matched + case-insensitively. `FIELD_SCOPE_RESOURCE` reads resource attributes + and accepts `resource` or `resource.attributes` as aliases. + `FIELD_SCOPE_ATTRIBUTES` reads span attributes and accepts `attribute`, + `attributes`, or `span.attributes` as aliases. Omit to use the built-in + column mapping described for `name`. Ignored in traces `order_by`. enum: + - FIELD_SCOPE_RESOURCE + - FIELD_SCOPE_ATTRIBUTES - resource - resource.attributes - attribute - attributes - span.attributes - example: resource + example: FIELD_SCOPE_RESOURCE diff --git a/specification/resources/insights/models/traces_filter_condition.yml b/specification/resources/insights/models/traces_filter_condition.yml new file mode 100644 index 000000000..6a039a7cb --- /dev/null +++ b/specification/resources/insights/models/traces_filter_condition.yml @@ -0,0 +1,40 @@ +type: object +description: A single field comparison in a traces filter expression. +required: + - field + - operator +oneOf: + - properties: + operator: + type: string + enum: + - FILTER_OPERATOR_EXISTS + example: FILTER_OPERATOR_EXISTS + - required: + - value + properties: + operator: + type: string + enum: + - FILTER_OPERATOR_EQ + - FILTER_OPERATOR_NEQ + - FILTER_OPERATOR_IN + - FILTER_OPERATOR_GTE + - FILTER_OPERATOR_LTE + example: FILTER_OPERATOR_EQ +properties: + field: + $ref: 'traces_field_ref.yml' + operator: + type: string + description: The comparison operator. + enum: + - FILTER_OPERATOR_EQ + - FILTER_OPERATOR_NEQ + - FILTER_OPERATOR_IN + - FILTER_OPERATOR_EXISTS + - FILTER_OPERATOR_GTE + - FILTER_OPERATOR_LTE + example: FILTER_OPERATOR_EQ + value: + $ref: 'traces_filter_value.yml' diff --git a/specification/resources/insights/models/traces_filter_expression.yml b/specification/resources/insights/models/traces_filter_expression.yml index 7bee5ec8a..33d97312d 100644 --- a/specification/resources/insights/models/traces_filter_expression.yml +++ b/specification/resources/insights/models/traces_filter_expression.yml @@ -1,82 +1,58 @@ type: object description: >- - A node in a traces filter tree. Every node is the same flat object; `type` - selects which other properties apply: - - - `condition` (default when `type` is omitted): compares `field` to `value` - using `operator`. - - - `and` / `or`: combines the nodes in `expressions` (1 to 32 children). - - - `not`: negates the single node in `expressions` (exactly one child). - - - `text_search`: case-insensitive substring match of `query` against the - span name, service name, and span status message. - - - A trace matches when at least one of its spans in the time range matches - the filter. Trees may be nested at most 16 levels deep and contain at most - 256 nodes in total. Unknown properties are rejected. -additionalProperties: false -properties: - type: - type: string - description: The node type. Matching is case-insensitive. - enum: + A boolean filter tree for traces queries. Exactly one node is set per + message. Trees may be nested at most 16 levels deep and contain at most 256 + nodes in total. +oneOf: + - required: - condition + - required: - and + - required: - or + - required: - not + - required: - text_search - default: condition - example: condition - expressions: - type: array - description: >- - Child nodes for `and`, `or`, and `not`. `and` and `or` accept 1 to 32 - children; `not` requires exactly one. - minItems: 1 - maxItems: 32 - items: - $ref: 'traces_filter_expression.yml' - field: - $ref: 'traces_field_ref.yml' - operator: - type: string - description: >- - The comparison operator for a `condition` node. Matching is - case-insensitive, and the symbol forms `=`, `!=`, `>`, `>=`, `<`, and - `<=` are accepted as aliases for `eq`, `neq`, `gt`, `gte`, `lt`, and - `lte`. `exists` matches spans where the field is present and non-empty - and ignores `value`. `in` requires an array `value` with 1 to 100 - entries. `neq` on string fields also matches spans where the field is - absent. - enum: - - eq - - neq - - in - - exists - - gt - - gte - - lt - - lte - example: eq - value: - $ref: 'traces_filter_value.yml' - query: - type: string - description: >- - The search string for a `text_search` node. Leading and trailing - whitespace is trimmed; the trimmed string must be non-empty. - maxLength: 256 - example: checkout -example: - type: and - expressions: - - type: condition - field: - name: service.name - operator: eq - value: checkout-api - - type: text_search - query: timeout +properties: + condition: + $ref: 'traces_filter_condition.yml' + and: + type: object + required: + - expressions + properties: + expressions: + type: array + minItems: 1 + maxItems: 32 + items: + $ref: 'traces_filter_expression.yml' + or: + type: object + required: + - expressions + properties: + expressions: + type: array + minItems: 1 + maxItems: 32 + items: + $ref: 'traces_filter_expression.yml' + not: + $ref: 'traces_filter_expression.yml' + text_search: + type: object + description: A substring search across span names, service names, and status messages. + required: + - query + properties: + query: + type: string + minLength: 1 + maxLength: 256 + pattern: '\S' + description: >- + The search string. Leading and trailing whitespace is trimmed, and + the remaining string must not be empty. + example: "timeout" diff --git a/specification/resources/insights/models/traces_filter_value.yml b/specification/resources/insights/models/traces_filter_value.yml index d03942efd..39c4759d9 100644 --- a/specification/resources/insights/models/traces_filter_value.yml +++ b/specification/resources/insights/models/traces_filter_value.yml @@ -1,68 +1,27 @@ -description: >- - The comparison value for a filter `condition`. Pass either a bare JSON - literal (string, number, boolean, or array for `in`) or a typed object - `{"type": "...", "value": ...}`. String values are coerced to the field's - type: numeric fields such as `durationNs` parse the string as a number, and - time fields such as `startTime` accept the same absolute formats as - `timeRange` (RFC3339 or Unix seconds/milliseconds/microseconds/nanoseconds). -example: checkout-api +type: object +description: A typed literal or list value for a traces filter condition. Exactly one kind is set per message. oneOf: - - type: string - description: A bare string literal. - example: checkout-api - - type: number - description: A bare number literal. + - required: + - string_value + - required: + - number_value + - required: + - string_array_value + - required: + - number_array_value +properties: + string_value: + type: string + example: "checkout-api" + number_value: + type: number example: 500000000 - - type: boolean - description: A bare boolean literal. - example: true - - type: array - description: A bare array of values, used with the `in` operator. - minItems: 1 - maxItems: 100 - items: - oneOf: - - type: string - - type: number - - type: boolean - example: - - checkout-api - - payments-api - - type: object - description: >- - A typed scalar value. `type` is case-insensitive; `int`, `integer`, and - `float` are accepted as aliases for `number`, and `boolean` for `bool`. - additionalProperties: false + string_array_value: + type: object required: - - type - - value + - values properties: - type: - type: string - enum: - - string - - number - - bool - example: number - value: - oneOf: - - type: string - - type: number - - type: boolean - example: 500000000 - - type: object - description: A typed string list, used with the `in` operator. - additionalProperties: false - required: - - type - - value - properties: - type: - type: string - enum: - - string_array - example: string_array - value: + values: type: array minItems: 1 maxItems: 100 @@ -71,3 +30,17 @@ oneOf: example: - checkout-api - payments-api + number_array_value: + type: object + required: + - values + properties: + values: + type: array + minItems: 1 + maxItems: 100 + items: + type: number + example: + - 42 + - 84 diff --git a/specification/resources/insights/models/traces_order_by.yml b/specification/resources/insights/models/traces_order_by.yml index f6cce3541..d0b2e3a37 100644 --- a/specification/resources/insights/models/traces_order_by.yml +++ b/specification/resources/insights/models/traces_order_by.yml @@ -1,10 +1,8 @@ type: object description: >- A sort clause for traces search results. Supported `field.name` values - (case-insensitive) are `started` (aliases `startTime`, `start_time`, - `timestamp`), `durationNs` (`duration`), `serviceName` (`service.name`, - `service_name`), `traceId` (`trace.id`, `trace_id`), `errorCount` - (`error_count`), `spanCount` (`span_count`), and `status`. Any other name + are `started`, `duration_ns`, `service_name`, `trace_id`, `error_count`, + `span_count`, and `status`. Any other name returns `400`. @@ -20,9 +18,10 @@ properties: $ref: 'traces_field_ref.yml' direction: type: string - description: The sort direction (case-insensitive). Defaults to `desc`. + description: >- + The sort direction, matched case-insensitively. Omit to use the server + default. enum: - asc - desc - default: desc example: desc diff --git a/specification/resources/insights/models/traces_pagination_request.yml b/specification/resources/insights/models/traces_pagination_request.yml index f668b142d..dc2b7203a 100644 --- a/specification/resources/insights/models/traces_pagination_request.yml +++ b/specification/resources/insights/models/traces_pagination_request.yml @@ -1,7 +1,7 @@ type: object description: >- Limits the size of a traces search result set. There is no cursor; use - `pagination.hasMore` in the response to tell whether more traces matched, + `pagination.has_more` in the response to tell whether more traces matched, and narrow the time range or filter to see them. additionalProperties: false properties: diff --git a/specification/resources/insights/models/traces_pagination_response.yml b/specification/resources/insights/models/traces_pagination_response.yml index a41c12440..9ecc2a928 100644 --- a/specification/resources/insights/models/traces_pagination_response.yml +++ b/specification/resources/insights/models/traces_pagination_response.yml @@ -1,9 +1,9 @@ type: object description: Pagination response. required: - - hasMore + - has_more properties: - hasMore: + has_more: type: boolean description: Whether more results matched the query than were returned. example: false diff --git a/specification/resources/insights/models/traces_search_request.yml b/specification/resources/insights/models/traces_search_request.yml index dcd38069b..6d7fad9ab 100644 --- a/specification/resources/insights/models/traces_search_request.yml +++ b/specification/resources/insights/models/traces_search_request.yml @@ -2,13 +2,13 @@ type: object description: Request body for searching traces. Unknown properties are rejected. additionalProperties: false required: - - timeRange + - time_range properties: - timeRange: + time_range: $ref: 'traces_time_range.yml' filter: $ref: 'traces_filter_expression.yml' - orderBy: + order_by: type: array description: Sort clauses applied in order. Defaults to `started` descending. items: diff --git a/specification/resources/insights/models/traces_span_record.yml b/specification/resources/insights/models/traces_span_record.yml index 523061224..5d6924689 100644 --- a/specification/resources/insights/models/traces_span_record.yml +++ b/specification/resources/insights/models/traces_span_record.yml @@ -1,32 +1,32 @@ type: object description: A single span belonging to a trace. required: - - traceId - - spanId + - trace_id + - span_id properties: - traceId: + trace_id: type: string description: The trace this span belongs to. example: "7b0b4e56abab38362b24e5498eb9ec64" - spanId: + span_id: type: string description: The span identifier. example: "e7867486e45cda47" - parentSpanId: + parent_span_id: type: string description: The parent span identifier. Omitted for the root span. example: "a2fb4a1d1a96d312" - startTime: + start_time: type: string format: date-time description: The span start time. example: "2026-10-09T06:44:37Z" - endTime: + end_time: type: string format: date-time description: The span end time. example: "2026-10-09T06:44:39Z" - durationNs: + duration_ns: type: integer format: int64 description: Span duration in nanoseconds. @@ -41,17 +41,17 @@ properties: The OpenTelemetry span kind as a string, for example `Server`, `Client`, or `Internal`. example: "Server" - statusCode: + status_code: type: string description: >- The OpenTelemetry span status code as a string: `Unset`, `Ok`, or `Error`. example: "Error" - statusMessage: + status_message: type: string description: The status description. Omitted when empty. example: "upstream timeout" - serviceName: + service_name: type: string description: >- The service that emitted the span. Omitted when the span has no diff --git a/specification/resources/insights/models/traces_trace_response.yml b/specification/resources/insights/models/traces_trace_response.yml index 3f8744e78..98115cb05 100644 --- a/specification/resources/insights/models/traces_trace_response.yml +++ b/specification/resources/insights/models/traces_trace_response.yml @@ -1,7 +1,7 @@ type: object description: A single trace and all of its spans. properties: - traceId: + trace_id: type: string description: The trace identifier. example: "7b0b4e56abab38362b24e5498eb9ec64" diff --git a/specification/resources/insights/models/traces_trace_summary.yml b/specification/resources/insights/models/traces_trace_summary.yml index 5d7ffbe82..dea5fbd66 100644 --- a/specification/resources/insights/models/traces_trace_summary.yml +++ b/specification/resources/insights/models/traces_trace_summary.yml @@ -1,12 +1,12 @@ type: object description: >- A single trace returned by a traces search. One row per trace, aggregated - from its spans. Every field except `traceId` is omitted when it holds its - zero value (for example, `errorCount` is absent when no spans errored). + from its spans. Every field except `trace_id` is omitted when it holds its + zero value (for example, `error_count` is absent when no spans errored). required: - - traceId + - trace_id properties: - traceId: + trace_id: type: string description: The trace identifier. example: "bef35030c4024f42fb88041fea062e97" @@ -15,23 +15,23 @@ properties: format: date-time description: The start time of the earliest span in the trace, in RFC 3339 format. example: "2026-10-09T09:21:39.99Z" - serviceName: + service_name: type: string description: >- The service that emitted the root span. Omitted when the root span has no service.name resource attribute. example: "checkout-api" - durationNs: + duration_ns: type: integer format: int64 description: Wall-clock duration of the trace in nanoseconds. example: 10000000 - spanCount: + span_count: type: integer format: int32 description: The number of spans in the trace. example: 1 - errorCount: + error_count: type: integer format: int32 description: >- @@ -47,7 +47,7 @@ properties: - Ok - Error example: "Ok" - spanNames: + span_names: type: array description: The distinct span names present in the trace. items: diff --git a/specification/resources/insights/responses/traces_bad_request.yml b/specification/resources/insights/responses/traces_bad_request.yml index e3f7d1f55..dc7647c07 100644 --- a/specification/resources/insights/responses/traces_bad_request.yml +++ b/specification/resources/insights/responses/traces_bad_request.yml @@ -21,16 +21,16 @@ content: value: pagination.limit exceeds maximum of 1000 search_time_range_too_long: summary: Search time range longer than 7 days - value: timeRange exceeds maximum of 168h0m0s + value: time_range exceeds maximum of 168h0m0s trace_window_too_long: summary: Trace lookup window longer than 7 days value: time range exceeds maximum of 168h0m0s invalid_order_direction: - summary: Unsupported orderBy direction - value: invalid orderBy direction "SORT_DIRECTION_ASC" + summary: Unsupported order_by direction + value: invalid order_by direction "sideways" from_after_to: summary: Time range start after end - value: timeRange.from must be before or equal to timeRange.to + value: time_range.from must be before or equal to time_range.to unknown_property: summary: Unknown or malformed request body property value: invalid request body diff --git a/specification/resources/insights/responses/traces_search.yml b/specification/resources/insights/responses/traces_search.yml index 6991e7d4d..437cbd5ce 100644 --- a/specification/resources/insights/responses/traces_search.yml +++ b/specification/resources/insights/responses/traces_search.yml @@ -14,13 +14,13 @@ content: $ref: '../models/traces_search_response.yml' example: data: - - traceId: "bef35030c4024f42fb88041fea062e97" + - trace_id: "bef35030c4024f42fb88041fea062e97" started: "2026-10-09T09:21:39.99Z" - serviceName: "checkout-api" - durationNs: 10000000 + service_name: "checkout-api" + duration_ns: 10000000 status: "Ok" - spanCount: 1 - spanNames: + span_count: 1 + span_names: - "checkout-api-root" pagination: - hasMore: false + has_more: false