diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8c3c60eee2..45e5d2741b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2656,7 +2656,7 @@ components: description: |- The trace ID. Accepts either a hexadecimal string of up to 32 characters (128-bit trace ID) or a decimal string of up to 39 digits. Hexadecimal IDs are case-insensitive, and shorter - values are left-padded with zeros. + values are left-padded with zeros. Values made only of digits are treated as decimal. Use the `trace_id` attribute of a span returned by the Search spans or Get a list of spans endpoints. Values in any other format, such as UUIDs, return `400 Bad Request`. A well-formed ID with no matching trace returns `404 Not Found`. @@ -3899,11 +3899,13 @@ components: type: integer traceID: description: The lower 64 bits of the trace ID, as an unsigned 64-bit integer. - example: 12345678901234567890 + example: 12376211733897805824 format: int64 type: integer traceIDFull: - description: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + description: |- + The trace ID as requested: a decimal ID is returned unchanged, and a hexadecimal ID is lowercased and + left-padded with zeros to 32 characters. example: "0000000000000000abc1230000000000" type: string type: @@ -108878,7 +108880,9 @@ components: attributes: $ref: "#/components/schemas/PrunedTraceAttributes" id: - description: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + description: |- + The trace ID as requested: a decimal ID is returned unchanged, and a hexadecimal ID is lowercased and + left-padded with zeros to 32 characters. example: "0000000000000000abc1230000000000" type: string type: @@ -134145,12 +134149,14 @@ components: example: {"@state": "success", "@version": "abc"} type: object compute: - description: The compute data. + description: |- + Map of compute ID (`c0`, `c1`, ... in request order) to the computed value, or to a list of + `{time, value}` points for a `timeseries` compute. type: object computes: additionalProperties: $ref: "#/components/schemas/SpansAggregateBucketValue" - description: A map of the metric name -> value for regular compute or list of values for a timeseries. + description: Not returned by this endpoint. Read the values from `compute` instead. type: object type: object SpansAggregateBucketType: @@ -134376,7 +134382,9 @@ components: type: string type: array trace_id: - description: Id of the trace to which the span belongs. + description: |- + ID of the trace to which the span belongs: a 32-character hexadecimal string for 128-bit trace IDs, + or a decimal string for 64-bit trace IDs. Pass it unchanged to Get a trace by ID. example: "1234567890987654321" type: string type: @@ -134387,7 +134395,8 @@ components: SpansCompute: description: |- A compute rule to compute metrics or timeseries. - All computes in a request must have the same `type`, and `timeseries` computes must use the same `interval`. + All computes in a request must have the same `type` (defaults to `total` when omitted), + and `timeseries` computes must use the same `interval`. To get both totals and timeseries, send separate requests. properties: aggregation: @@ -134831,7 +134840,16 @@ components: type: string query: default: "*" - description: The search query - following the span search syntax. + description: |- + The search query, following the + [span search syntax](https://docs.datadoghq.com/tracing/trace_explorer/query_syntax/). + Reserved fields (`service`, `env`, `version`, `resource_name`, `operation_name`, `status`, `span_id`, + `trace_id`, `type`) take no `@` prefix, and neither do tags such as `host` or primary tags such as + `datacenter`. Span attributes need one, for example `@span.kind:server` or `@http.status_code:500`. + Wrap values that contain special characters such as `:`, `{`, `}`, `(`, `)`, or spaces in double quotes, + for example `@http.route:"/api/v1/users/{id}"` or `resource_name:"GET /api/v1/users"`. + Wildcards do not work inside quotes, so to combine a wildcard with special characters, escape each one + with `\` instead, for example `resource_name:Clients\:\:*`. example: "service:web* AND @http.status_code:[200 TO 299]" type: string to: @@ -136703,7 +136721,9 @@ components: root: $ref: "#/components/schemas/SummarizedSpan" traceId: - description: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + description: |- + The trace ID as requested: a decimal ID is returned unchanged, and a hexadecimal ID is lowercased and + left-padded with zeros to 32 characters. example: "0000000000000000abc1230000000000" type: string required: @@ -147256,8 +147276,10 @@ components: attributes: $ref: "#/components/schemas/TraceAttributes" id: - description: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. - example: "0000000000000000abc1230000000000" + description: |- + The lower 64 bits of the trace ID, as a decimal string. + The full trace ID is in each span's `traceIDFull`. + example: "12376211733897805824" type: string type: $ref: "#/components/schemas/TraceType" @@ -254876,7 +254898,7 @@ paths: - attributes: by: host: my-hostname - computes: + compute: c0: 19 id: abc-123 type: bucket @@ -254890,6 +254912,12 @@ paths: $ref: "#/components/responses/BadRequestResponse" "403": $ref: "#/components/responses/ForbiddenResponse" + "408": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Request Timeout "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -254916,7 +254944,16 @@ paths: [1]: /logs/guide/collect-multiple-logs-with-pagination?tab=v2api operationId: ListSpansGet parameters: - - description: Search query following spans syntax. + - description: |- + The search query, following the + [span search syntax](https://docs.datadoghq.com/tracing/trace_explorer/query_syntax/). + Reserved fields (`service`, `env`, `version`, `resource_name`, `operation_name`, `status`, `span_id`, + `trace_id`, `type`) take no `@` prefix, and neither do tags such as `host` or primary tags such as + `datacenter`. Span attributes need one, for example `@span.kind:server` or `@http.status_code:500`. + Wrap values that contain special characters such as `:`, `{`, `}`, `(`, `)`, or spaces in double quotes, + for example `@http.route:"/api/v1/users/{id}"` or `resource_name:"GET /api/v1/users"`. + Wildcards do not work inside quotes, so to combine a wildcard with special characters, escape each one + with `\` instead, for example `resource_name:Clients\:\:*`. example: "@datacenter:us @role:db" in: query name: filter[query] @@ -265430,15 +265467,21 @@ paths: A `400 Bad Request` response means the trace ID is malformed. A `404 Not Found` response means no trace with this ID is available, such as when the trace is outside the retention period. This endpoint is rate limited to `60` requests per minute per organization. + For very large traces, use Get a pruned trace by ID, or set `include_fields` to keep only the tags you need. operationId: GetTraceByID parameters: - $ref: "#/components/parameters/TraceIDPathParameter" - description: |- - List of span fields to include in the response. When omitted, every available field is returned. + Tag keys to keep in each span's `meta` and `metrics`, for example `http.status_code` or `error.message`. + Each value is matched against tag keys by exact name, with or without a leading `@`. + Passing `meta` or `metrics` doesn't return the whole map. + Core span fields such as `service`, `resource`, `name`, `duration`, IDs, and timestamps, and the `env` tag + in `meta`, are always returned. + When omitted, all tags are returned. Values may be passed as repeated query parameters or as a single comma-separated value. example: - - service - - resource + - http.status_code + - error.message in: query name: include_fields required: false @@ -265471,10 +265514,10 @@ paths: service: web-store spanID: 9876543210987654321 startTime: 1716800000000000000 - traceID: 12345678901234567890 + traceID: 12376211733897805824 traceIDFull: 0000000000000000abc1230000000000 type: web - id: "0000000000000000abc1230000000000" + id: "12376211733897805824" type: trace schema: $ref: "#/components/schemas/TraceResponse" diff --git a/src/datadog_api_client/v2/api/apm_trace_api.py b/src/datadog_api_client/v2/api/apm_trace_api.py index b0f9930061..51a943a4e7 100644 --- a/src/datadog_api_client/v2/api/apm_trace_api.py +++ b/src/datadog_api_client/v2/api/apm_trace_api.py @@ -143,7 +143,7 @@ def get_pruned_trace_by_id( :param trace_id: The trace ID. Accepts either a hexadecimal string of up to 32 characters (128-bit trace ID) or a decimal string of up to 39 digits. Hexadecimal IDs are case-insensitive, and shorter - values are left-padded with zeros. + values are left-padded with zeros. Values made only of digits are treated as decimal. Use the ``trace_id`` attribute of a span returned by the Search spans or Get a list of spans endpoints. Values in any other format, such as UUIDs, return ``400 Bad Request``. A well-formed ID with no matching trace returns ``404 Not Found``. @@ -209,15 +209,21 @@ def get_trace_by_id( A ``400 Bad Request`` response means the trace ID is malformed. A ``404 Not Found`` response means no trace with this ID is available, such as when the trace is outside the retention period. This endpoint is rate limited to ``60`` requests per minute per organization. + For very large traces, use Get a pruned trace by ID, or set ``include_fields`` to keep only the tags you need. :param trace_id: The trace ID. Accepts either a hexadecimal string of up to 32 characters (128-bit trace ID) or a decimal string of up to 39 digits. Hexadecimal IDs are case-insensitive, and shorter - values are left-padded with zeros. + values are left-padded with zeros. Values made only of digits are treated as decimal. Use the ``trace_id`` attribute of a span returned by the Search spans or Get a list of spans endpoints. Values in any other format, such as UUIDs, return ``400 Bad Request``. A well-formed ID with no matching trace returns ``404 Not Found``. :type trace_id: str - :param include_fields: List of span fields to include in the response. When omitted, every available field is returned. + :param include_fields: Tag keys to keep in each span's ``meta`` and ``metrics`` , for example ``http.status_code`` or ``error.message``. + Each value is matched against tag keys by exact name, with or without a leading ``@``. + Passing ``meta`` or ``metrics`` doesn't return the whole map. + Core span fields such as ``service`` , ``resource`` , ``name`` , ``duration`` , IDs, and timestamps, and the ``env`` tag + in ``meta`` , are always returned. + When omitted, all tags are returned. Values may be passed as repeated query parameters or as a single comma-separated value. :type include_fields: [str], optional :rtype: TraceResponse diff --git a/src/datadog_api_client/v2/api/spans_api.py b/src/datadog_api_client/v2/api/spans_api.py index 59e73db7e2..a723b2948a 100644 --- a/src/datadog_api_client/v2/api/spans_api.py +++ b/src/datadog_api_client/v2/api/spans_api.py @@ -211,7 +211,15 @@ def list_spans_get( Use this endpoint to see your latest spans. This endpoint is rate limited to ``50`` requests per minute per organization. - :param filter_query: Search query following spans syntax. + :param filter_query: The search query, following the + `span search syntax `_. + Reserved fields ( ``service`` , ``env`` , ``version`` , ``resource_name`` , ``operation_name`` , ``status`` , ``span_id`` , + ``trace_id`` , ``type`` ) take no ``@`` prefix, and neither do tags such as ``host`` or primary tags such as + ``datacenter``. Span attributes need one, for example ``@span.kind:server`` or ``@http.status_code:500``. + Wrap values that contain special characters such as ``:`` , ``{`` , ``}`` , ``(`` , ``)`` , or spaces in double quotes, + for example ``@http.route:"/api/v1/users/{id}"`` or ``resource_name:"GET /api/v1/users"``. + Wildcards do not work inside quotes, so to combine a wildcard with special characters, escape each one + with ``\\`` instead, for example ``resource_name:Clients\:\:*``. :type filter_query: str, optional :param filter_from: Minimum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds). :type filter_from: str, optional @@ -260,7 +268,15 @@ def list_spans_get_with_pagination( Provide a paginated version of :meth:`list_spans_get`, returning all items. - :param filter_query: Search query following spans syntax. + :param filter_query: The search query, following the + `span search syntax `_. + Reserved fields ( ``service`` , ``env`` , ``version`` , ``resource_name`` , ``operation_name`` , ``status`` , ``span_id`` , + ``trace_id`` , ``type`` ) take no ``@`` prefix, and neither do tags such as ``host`` or primary tags such as + ``datacenter``. Span attributes need one, for example ``@span.kind:server`` or ``@http.status_code:500``. + Wrap values that contain special characters such as ``:`` , ``{`` , ``}`` , ``(`` , ``)`` , or spaces in double quotes, + for example ``@http.route:"/api/v1/users/{id}"`` or ``resource_name:"GET /api/v1/users"``. + Wildcards do not work inside quotes, so to combine a wildcard with special characters, escape each one + with ``\\`` instead, for example ``resource_name:Clients\:\:*``. :type filter_query: str, optional :param filter_from: Minimum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds). :type filter_from: str, optional diff --git a/src/datadog_api_client/v2/model/apm_trace_span.py b/src/datadog_api_client/v2/model/apm_trace_span.py index 4fd5a2f5ce..81d54bbf73 100644 --- a/src/datadog_api_client/v2/model/apm_trace_span.py +++ b/src/datadog_api_client/v2/model/apm_trace_span.py @@ -133,7 +133,8 @@ def __init__( :param trace_id: The lower 64 bits of the trace ID, as an unsigned 64-bit integer. :type trace_id: int - :param trace_id_full: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + :param trace_id_full: The trace ID as requested: a decimal ID is returned unchanged, and a hexadecimal ID is lowercased and + left-padded with zeros to 32 characters. :type trace_id_full: str :param type: The type of the span (for example, ``web`` , ``db`` , or ``rpc`` ). diff --git a/src/datadog_api_client/v2/model/pruned_trace_data.py b/src/datadog_api_client/v2/model/pruned_trace_data.py index 6df23971af..5c7343c577 100644 --- a/src/datadog_api_client/v2/model/pruned_trace_data.py +++ b/src/datadog_api_client/v2/model/pruned_trace_data.py @@ -41,7 +41,8 @@ def __init__(self_, attributes: PrunedTraceAttributes, id: str, type: PrunedTrac :param attributes: The attributes of a pruned trace returned by the Get pruned trace by ID endpoint. :type attributes: PrunedTraceAttributes - :param id: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + :param id: The trace ID as requested: a decimal ID is returned unchanged, and a hexadecimal ID is lowercased and + left-padded with zeros to 32 characters. :type id: str :param type: The type of the pruned trace resource. The value is always ``pruned_trace``. diff --git a/src/datadog_api_client/v2/model/spans_aggregate_bucket_attributes.py b/src/datadog_api_client/v2/model/spans_aggregate_bucket_attributes.py index b0c3118052..5be5c8177a 100644 --- a/src/datadog_api_client/v2/model/spans_aggregate_bucket_attributes.py +++ b/src/datadog_api_client/v2/model/spans_aggregate_bucket_attributes.py @@ -72,10 +72,11 @@ def __init__( :param by: The key, value pairs for each group by. :type by: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional - :param compute: The compute data. + :param compute: Map of compute ID ( ``c0`` , ``c1`` , ... in request order) to the computed value, or to a list of + ``{time, value}`` points for a ``timeseries`` compute. :type compute: dict, optional - :param computes: A map of the metric name -> value for regular compute or list of values for a timeseries. + :param computes: Not returned by this endpoint. Read the values from ``compute`` instead. :type computes: {str: (SpansAggregateBucketValue,)}, optional """ if by is not unset: diff --git a/src/datadog_api_client/v2/model/spans_attributes.py b/src/datadog_api_client/v2/model/spans_attributes.py index 61b8469e07..6dd17ce60c 100644 --- a/src/datadog_api_client/v2/model/spans_attributes.py +++ b/src/datadog_api_client/v2/model/spans_attributes.py @@ -161,7 +161,8 @@ def __init__( :param tags: Array of tags associated with your span. :type tags: [str], optional - :param trace_id: Id of the trace to which the span belongs. + :param trace_id: ID of the trace to which the span belongs: a 32-character hexadecimal string for 128-bit trace IDs, + or a decimal string for 64-bit trace IDs. Pass it unchanged to Get a trace by ID. :type trace_id: str, optional :param type: The type of the span. diff --git a/src/datadog_api_client/v2/model/spans_compute.py b/src/datadog_api_client/v2/model/spans_compute.py index d2e3dae37e..33c5a8b0e4 100644 --- a/src/datadog_api_client/v2/model/spans_compute.py +++ b/src/datadog_api_client/v2/model/spans_compute.py @@ -48,7 +48,8 @@ def __init__( ): """ A compute rule to compute metrics or timeseries. - All computes in a request must have the same ``type`` , and ``timeseries`` computes must use the same ``interval``. + All computes in a request must have the same ``type`` (defaults to ``total`` when omitted), + and ``timeseries`` computes must use the same ``interval``. To get both totals and timeseries, send separate requests. :param aggregation: An aggregation function. diff --git a/src/datadog_api_client/v2/model/spans_query_filter.py b/src/datadog_api_client/v2/model/spans_query_filter.py index 3538e10240..db964f7e88 100644 --- a/src/datadog_api_client/v2/model/spans_query_filter.py +++ b/src/datadog_api_client/v2/model/spans_query_filter.py @@ -41,7 +41,15 @@ def __init__( :param _from: The minimum time for the requested spans, supports date-time ISO8601, date math, and regular timestamps (milliseconds). :type _from: str, optional - :param query: The search query - following the span search syntax. + :param query: The search query, following the + `span search syntax `_. + Reserved fields ( ``service`` , ``env`` , ``version`` , ``resource_name`` , ``operation_name`` , ``status`` , ``span_id`` , + ``trace_id`` , ``type`` ) take no ``@`` prefix, and neither do tags such as ``host`` or primary tags such as + ``datacenter``. Span attributes need one, for example ``@span.kind:server`` or ``@http.status_code:500``. + Wrap values that contain special characters such as ``:`` , ``{`` , ``}`` , ``(`` , ``)`` , or spaces in double quotes, + for example ``@http.route:"/api/v1/users/{id}"`` or ``resource_name:"GET /api/v1/users"``. + Wildcards do not work inside quotes, so to combine a wildcard with special characters, escape each one + with ``\\`` instead, for example ``resource_name:Clients\:\:*``. :type query: str, optional :param to: The maximum time for the requested spans, supports date-time ISO8601, date math, and regular timestamps (milliseconds). diff --git a/src/datadog_api_client/v2/model/summarized_trace.py b/src/datadog_api_client/v2/model/summarized_trace.py index efa5ef7f5e..192f41d77b 100644 --- a/src/datadog_api_client/v2/model/summarized_trace.py +++ b/src/datadog_api_client/v2/model/summarized_trace.py @@ -37,7 +37,8 @@ def __init__(self_, root: SummarizedSpan, trace_id: str, **kwargs): :param root: A node in the pruned trace tree. :type root: SummarizedSpan - :param trace_id: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + :param trace_id: The trace ID as requested: a decimal ID is returned unchanged, and a hexadecimal ID is lowercased and + left-padded with zeros to 32 characters. :type trace_id: str """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/trace_data.py b/src/datadog_api_client/v2/model/trace_data.py index 977580bf83..10556a40e8 100644 --- a/src/datadog_api_client/v2/model/trace_data.py +++ b/src/datadog_api_client/v2/model/trace_data.py @@ -41,7 +41,8 @@ def __init__(self_, attributes: TraceAttributes, id: str, type: TraceType, **kwa :param attributes: The attributes of a trace returned by the Get trace by ID endpoint. :type attributes: TraceAttributes - :param id: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + :param id: The lower 64 bits of the trace ID, as a decimal string. + The full trace ID is in each span's ``traceIDFull``. :type id: str :param type: The type of the trace resource. The value is always ``trace``. diff --git a/tests/v2/features/spans.feature b/tests/v2/features/spans.feature index eabdf2baaf..c3e7ddc848 100644 --- a/tests/v2/features/spans.feature +++ b/tests/v2/features/spans.feature @@ -22,6 +22,13 @@ Feature: Spans Then the response status is 200 OK And the response "meta.status" is equal to "done" + @generated @skip @team:ddoghq/apm + Scenario: Aggregate spans returns "Request Timeout" response + Given new "AggregateSpans" request + And body with value {"data": {"attributes": {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "service:web* AND @http.status_code:[200 TO 299]", "to": "now"}, "group_by": [{"facet": "host", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "pc90", "metric": "@duration", "order": "desc", "type": "measure"}, "total": false}], "options": {"timezone": "GMT"}}, "type": "aggregate_request"}} + When the request is sent + Then the response status is 408 Request Timeout + @generated @skip @team:ddoghq/apm Scenario: Get a list of spans returns "Bad Request." response Given new "ListSpansGet" request