---
title: "POST /api/v1/data/traces"
method: POST
path: "/api/v1/data/traces"
tags: ["DataV1"]
---

# POST /api/v1/data/traces

`POST /api/v1/data/traces`

Tracing

## Request body

- Datav1ListTracesRequest
  - `end_time` string, date-time — End time for the search.
  - `operation` string — Operation to filter on. An empty value doesn't apply any operation filter.
  - `query_type` 'TRACE_IDS' | 'SERVICE_OPERATION'
  - `service` string — Service to filter on. An empty value doesn't apply any service filter.
  - `start_time` string, date-time — Start time for the search.
  - `tag_filters` ListTracesRequestTagFilter[] — Tag filter to apply. An empty value doesn't apply any tag filter.
    - `key` string — The key (or name) of the span tag that is inspected by this filter.
    - `numeric_value` TagFilterNumericFilter
      - `comparison` 'EQUAL' | 'NOT_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL'
      - `value` number, double — The filter value used in comparison against match candidates.
    - `value` TagFilterStringFilter
      - `in_values` string[] — Values the filter tests against when using IN or NOT_IN match type.
      - `match` 'EXACT' | 'REGEX' | 'EXACT_NEGATION' | 'REGEX_NEGATION' | 'IN' | 'NOT_IN'
      - `value` string — The value the filter compares to the target trace or span field.
  - `trace_ids` string[] — Trace IDs to search for.

## Response `200`

A successful response.

- Datav1ListTracesResponse
  - `traces` V1TracesData[]
    - `resource_spans` V1ResourceSpans[] — An array of ResourceSpans. For data coming from a single resource this array will typically contain one element. Intermediary nodes that receive data from multiple origins typically batch the data before forwarding further and in that case this array will contain multiple elements.
      - `resource` V1Resource — Resource information.
        - `attributes` V1KeyValue[] — Set of attributes that describe the resource. Attribute keys MUST be unique (it is not allowed to have more than one attribute with the same key).
          - `key` string
          - `value` V1AnyValue — AnyValue is used to represent any type of attribute value. AnyValue may contain a primitive value such as a string or integer or it may contain an arbitrary nested object containing arrays, key-value lists and primitives.
            - `array_value` V1ArrayValue — ArrayValue is a list of AnyValue messages. We need ArrayValue as a message since oneof in AnyValue does not allow repeated fields.
              - …
            - `bool_value` boolean
            - `bytes_value` string, byte
            - `double_value` number, double
            - `int_value` string, int64
            - `kvlist_value` V1KeyValueList — KeyValueList is a list of KeyValue messages. We need KeyValueList as a message since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches are semantically equivalent.
              - …
            - `string_value` string
        - `dropped_attributes_count` integer — dropped_attributes_count is the number of dropped attributes. If the value is 0, then no attributes were dropped.
        - `entity_refs` V1EntityRef[] — Set of entities that participate in this Resource. Note: keys in the references MUST exist in attributes of this message. Status: [Development]
          - `description_keys` string[] — Descriptive (non-identifying) attribute keys of the entity. MAY change over the lifetime of the entity. MAY be empty. These attribute keys are not part of entity's identity. These keys MUST exist in the containing {message}.attributes.
          - `id_keys` string[] — Attribute Keys that identify the entity. MUST not change during the lifetime of the entity. The Id must contain at least one attribute. These keys MUST exist in the containing {message}.attributes.
          - `schema_url` string — This schema_url applies to the data in this message and to the Resource attributes referenced by id_keys and description_keys. TODO: discuss if we are happy with this somewhat complicated definition of what the schema_url applies to. This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs.
          - `type` string — Defines the type of the entity. MUST not change during the lifetime of the entity. For example: "service" or "host". This field is required and MUST not be empty for valid entities.
      - `schema_url` string — The Schema URL, if known. This is the identifier of the Schema that the resource data is recorded in. Notably, the last part of the URL path is the version number of the schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see https://opentelemetry.io/docs/specs/otel/schemas/#schema-url This schema_url applies to the data in the "resource" field. It does not apply to the data in the "scope_spans" field which have their own schema_url field.
      - `scope_spans` V1ScopeSpans[] — A list of ScopeSpans that originate from a resource.
        - `schema_url` string — The Schema URL, if known. This is the identifier of the Schema that the span data is recorded in. Notably, the last part of the URL path is the version number of the schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see https://opentelemetry.io/docs/specs/otel/schemas/#schema-url This schema_url applies to all spans and span events in the "spans" field.
        - `scope` V1InstrumentationScope — InstrumentationScope is a message representing the instrumentation scope information such as the fully qualified name and version.
          - `attributes` V1KeyValue[] — Additional attributes that describe the scope. [Optional]. Attribute keys MUST be unique (it is not allowed to have more than one attribute with the same key).
            - `key` string
            - `value` V1AnyValue — AnyValue is used to represent any type of attribute value. AnyValue may contain a primitive value such as a string or integer or it may contain an arbitrary nested object containing arrays, key-value lists and primitives.
              - …
          - `dropped_attributes_count` integer
          - `name` string — An empty instrumentation scope name means the name is unknown.
          - `version` string
        - `spans` V1Span[] — A list of Spans that originate from an instrumentation scope.
          - `attributes` V1KeyValue[] — "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" "/http/server_latency": 300 "example.com/myattribute": true "example.com/score": 10.239 The OpenTelemetry API specification further restricts the allowed value types: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute Attribute keys MUST be unique (it is not allowed to have more than one attribute with the same key).
            - `key` string
            - `value` V1AnyValue — AnyValue is used to represent any type of attribute value. AnyValue may contain a primitive value such as a string or integer or it may contain an arbitrary nested object containing arrays, key-value lists and primitives.
              - …
          - `dropped_attributes_count` integer — dropped_attributes_count is the number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0, then no attributes were dropped.
          - `dropped_events_count` integer — dropped_events_count is the number of dropped events. If the value is 0, then no events were dropped.
          - `dropped_links_count` integer — dropped_links_count is the number of dropped links after the maximum size was enforced. If this value is 0, then no links were dropped.
          - `end_time_unix_nano` string, uint64 — end_time_unix_nano is the end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running. Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. This field is semantically required and it is expected that end_time >= start_time.
          - `events` V1SpanEvent[] — events is a collection of Event items.
            - `attributes` V1KeyValue[] — attributes is a collection of attribute key/value pairs on the event. Attribute keys MUST be unique (it is not allowed to have more than one attribute with the same key).
              - …
            - `dropped_attributes_count` integer — dropped_attributes_count is the number of dropped attributes. If the value is 0, then no attributes were dropped.
            - `name` string — name of the event. This field is semantically required to be set to non-empty string.
            - `time_unix_nano` string, uint64 — time_unix_nano is the time the event occurred.
          - `flags` integer — Flags, a bit field. Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace Context specification. To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. Bits 8 and 9 represent the 3 states of whether a span's parent is remote. The states are (unknown, is not remote, is remote). To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. When creating span messages, if the message is logically forwarded from another source with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD be copied as-is. If creating from a source that does not have an equivalent flags field (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST be set to zero. Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. [Optional].
          - `kind` 'SPAN_KIND_INTERNAL' | 'SPAN_KIND_SERVER' | 'SPAN_KIND_CLIENT' | 'SPAN_KIND_PRODUCER' | 'SPAN_KIND_CONSUMER' — SpanKind is the type of span. Can be used to specify additional relationships between spans in addition to a parent/child relationship. - SPAN_KIND_INTERNAL: Indicates that the span represents an internal operation within an application, as opposed to an operation happening at the boundaries. Default value. - SPAN_KIND_SERVER: Indicates that the span covers server-side handling of an RPC or other remote network request. - SPAN_KIND_CLIENT: Indicates that the span describes a request to some remote service. - SPAN_KIND_PRODUCER: Indicates that the span describes a producer sending a message to a broker. Unlike CLIENT and SERVER, there is often no direct critical path latency relationship between producer and consumer spans. A PRODUCER span ends when the message was accepted by the broker while the logical processing of the message might span a much longer time. - SPAN_KIND_CONSUMER: Indicates that the span describes consumer receiving a message from a broker. Like the PRODUCER kind, there is often no direct critical path latency relationship between producer and consumer spans.
          - `links` SpanLink[] — links is a collection of Links, which are references from this span to a span in the same or different trace.
            - `attributes` V1KeyValue[] — attributes is a collection of attribute key/value pairs on the link. Attribute keys MUST be unique (it is not allowed to have more than one attribute with the same key).
              - …
            - `dropped_attributes_count` integer — dropped_attributes_count is the number of dropped attributes. If the value is 0, then no attributes were dropped.
            - `flags` integer — Flags, a bit field. Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace Context specification. To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. Bits 8 and 9 represent the 3 states of whether the link is remote. The states are (unknown, is not remote, is remote). To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. To read whether the link is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero. [Optional].
            - `span_id` string, byte — A unique identifier for the linked span. The ID is an 8-byte array.
            - `trace_id` string, byte — A unique identifier of a trace that this linked span is part of. The ID is a 16-byte array.
            - `trace_state` string — The trace_state associated with the link.
          - `name` string — A description of the span's operation. For example, the name can be a qualified method name or a file name and a line number where the operation is called. A best practice is to use the same display name at the same call point in an application. This makes it easier to correlate spans in different traces. This field is semantically required to be set to non-empty string. Empty value is equivalent to an unknown span name. This field is required.
          - `parent_span_id` string, byte — The `span_id` of this span's parent span. If this is a root span, then this field must be empty. The ID is an 8-byte array.
          - `span_id` string, byte — A unique identifier for a span within a trace, assigned when the span is created. The ID is an 8-byte array. An ID with all zeroes OR of length other than 8 bytes is considered invalid (empty string in OTLP/JSON is zero-length and thus is also invalid). This field is required.
          - `start_time_unix_nano` string, uint64 — start_time_unix_nano is the start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server's application handler starts running. Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. This field is semantically required and it is expected that end_time >= start_time.
          - `status` Tracev1Status — The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs.
            - `code` 'STATUS_CODE_OK' | 'STATUS_CODE_ERROR' — - STATUS_CODE_OK: The Span has been validated by an Application developer or Operator to have completed successfully. - STATUS_CODE_ERROR: The Span contains an error.
            - `message` string — A developer-facing human readable error message.
          - `trace_id` string, byte — A unique identifier for a trace. All spans from the same trace share the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR of length other than 16 bytes is considered invalid (empty string in OTLP/JSON is zero-length and thus is also invalid). This field is required.
          - `trace_state` string — trace_state conveys information about request position in multiple distributed tracing graphs. It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header See also https://github.com/w3c/distributed-tracing for more details about this field.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.dev/chronosphere/apis/data-v1-api.md) · [All operations](https://skmtc.dev/chronosphere/apis/data-v1-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/chronosphere/data-v1-api/revisions/ee91fd539ced/schema)
