diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index f2d8715f87..a0bee37b64 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -9793,53 +9793,30 @@ components: - data_source - query type: object - MonitorFormulaAndFunctionDataJobsMonitorOptions: - description: Monitor configuration options for data jobs queries. - properties: - alert_on_every_failure: - description: |- - Alert separately for each failed run instead of on the count of trailing failures. - Only supported for `failed_runs` monitors with the `aastra` query dialect. It requires - a `> 0` threshold with no warning threshold, an evaluation window of at most two days, - and renotification disabled. - example: true - type: boolean - type: object MonitorFormulaAndFunctionDataJobsQueryDefinition: description: A formula and functions data jobs query. properties: job_type: description: |- The type of job being monitored. Valid values include: - `databricks.job`, `spark.application`, `airflow.dag`, `dbt.job`, `glue.job`, `adf.pipeline`. - The `aastra` dialect also accepts `airflow.job`, `dbt.model`, and `dbt.test`. + `databricks.job`, `spark.application`, `airflow.dag`, + `dbt.job`, `dbt.model`, `dbt.test`, `glue.job`. Custom job types are supported with the `custom.ol.` prefix. example: "databricks.job" type: string jobs_query: - description: |- - Filter expression used to select the jobs to monitor. Its syntax depends on `query_dialect`: - a metric tag filter such as `job_name:smoke*` for `metric`, or an Aastra entity search - such as ``search for databricks_job where `@team:data-eng` `` for `aastra`. + description: Filter expression used to select the jobs to monitor. example: "job_name:smoke*" type: string - monitor_options: - $ref: "#/components/schemas/MonitorFormulaAndFunctionDataJobsMonitorOptions" name: description: Name of the query for use in formulas. Must be `run_query`. example: "run_query" type: string query_dialect: description: |- - Query dialect for data jobs queries. Valid values are `metric` and `aastra`. + Query dialect for data jobs queries. Currently only `metric` is supported. example: "metric" type: string - run_filter: - description: |- - Optional filter on individual runs, using metrics filter syntax. - Only supported with the `aastra` query dialect. - example: "env:prod" - type: string required: - name - jobs_query @@ -9854,18 +9831,6 @@ components: type: string x-enum-varnames: - DATA_QUALITY_METRICS - MonitorFormulaAndFunctionDataQualityDetectionType: - description: |- - How a `data-jobs alert` job duration monitor detects a breach. Must match the - `.detection()` call in the monitor query. Required for job duration monitors. - enum: - - static - - anomaly - example: "anomaly" - type: string - x-enum-varnames: - - STATIC - - ANOMALY MonitorFormulaAndFunctionDataQualityDiffFunction: description: |- Function applied to the measure before it is compared against the predicted bounds. @@ -9926,8 +9891,7 @@ components: The data quality measure to query. Common values include: `bytes`, `cardinality`, `custom`, `freshness`, `max`, `mean`, `min`, `nullness`, `percent_negative`, `percent_zero`, `row_count`, `stddev`, - `sum`, `uniqueness`. `data-jobs alert` job duration monitors use `duration`. - Additional values may be supported. + `sum`, `uniqueness`. Additional values may be supported. example: "row_count" type: string MonitorFormulaAndFunctionDataQualityModelBoundsOverride: @@ -9997,14 +9961,6 @@ components: MonitorFormulaAndFunctionDataQualityMonitorOptions: description: Monitor configuration options for data quality queries. properties: - consecutive_runs: - description: |- - Number of consecutive runs that must breach before the monitor alerts. - Only supported by `data-jobs alert` job duration monitors. Defaults to `1`. - example: 1 - format: int64 - minimum: 1 - type: integer crontab_override: description: Crontab expression to override the default schedule. example: "* * * 10" @@ -10017,8 +9973,6 @@ components: description: Custom WHERE clause for the query. example: "USER_ID = 123" type: string - detection_type: - $ref: "#/components/schemas/MonitorFormulaAndFunctionDataQualityDetectionType" group_by_columns: description: Columns to group results by. example: ["col1", "col2"] @@ -10066,12 +10020,6 @@ components: description: Name of the query for use in formulas. example: "query1" type: string - run_filter: - description: |- - Optional filter on individual runs, using metrics filter syntax. - Only supported by `data-jobs alert` job duration monitors. - example: "env:prod" - type: string schema_version: description: Schema version for the data quality query. example: "0.0.1" @@ -37331,22 +37279,6 @@ paths: - `time_window` #m (between 1 and 2880), #h (between 1 and 48). - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`. - `#` an integer or decimal number used to set the threshold. - - **Data Jobs Alert Query** - - Job status example: `formula("failed_runs(run_query)").by(group_keys).last(time_window) > #` - - Job duration examples: `formula("job_duration(run_query)").detection(static).by(group_keys) > duration` - and `formula("job_duration(run_query)").detection(anomaly).by(group_keys) > 0` - - - `run_query`: The name of the single query variable in `options.variables`. Job status monitors - use a data jobs query; job duration monitors use a data quality query with the `duration` measure. - - `group_keys`: The tags to group by, such as `entity_id,name,workspace_name`. - - `time_window`: Number of minutes (#m), hours (#h), or days (#d), up to `10d`. - - `#`: The number of trailing failed runs to alert above, as a non-negative integer. - - `duration`: The duration to alert above, such as `2h`, `30m`, or a number of seconds. - - `options.thresholds.critical`: Must equal the query threshold, in seconds for job duration. - Anomaly job duration monitors omit `options.thresholds`. operationId: CreateMonitor requestBody: content: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 57865d0cfe..9e977bb939 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -930,6 +930,26 @@ components: required: true schema: type: string + GetIssueImpactFromParameter: + description: Start of the time window, in milliseconds since the Unix epoch. Must be before `filter[to]`. + example: 1794152269473 + in: query + name: filter[from] + required: true + schema: + format: int64 + type: integer + GetIssueImpactToParameter: + description: |- + End of the time window, in milliseconds since the Unix epoch. Use the issue's `last_seen` to end the window at + its latest error. + example: 1794238669473 + in: query + name: filter[to] + required: true + schema: + format: int64 + type: integer GetIssueIncludeQueryParameter: description: |- Comma-separated list of relationship objects that should be included in the response. Possible values are `assignee`, `bits_investigation`, `case`, `pull_requests`, `samples`, `team_owners`, and `watches`. @@ -10826,7 +10846,7 @@ components: - MAX AiGatewayNullableRoutingRuleTierOrdering: description: >- - How a tier orders its targets. Omission preserves the saved same-position tier on update; null resets to configured. New tiers default to configured. The weighted_affinity ordering distributes first-choice assignments by relative target weights and accepts only model targets with an explicit provider, without repeated provider and model pairs in the same tier. The `classified` ordering is allowed only in the first tier and requires a classifier, destination rubrics, and one default destination. + How a tier orders its targets. Omission preserves the saved same-position tier on update; null resets to configured. New tiers default to configured. The weighted_affinity ordering distributes first-choice assignments by relative target weights and accepts only model targets with an explicit provider, without repeated provider and model pairs in the same tier. The `classified` ordering is allowed only in the first tier and requires a classifier, destination rubrics, and one default destination. Its targets are model targets that each name one provider, not "*". Besides the default, it needs 1 to 9 destinations, each with a different rubric. Classified routing is in Preview: saving a classified tier returns 403 Forbidden unless the feature is enabled for the organization. enum: - configured - weighted_affinity @@ -12102,7 +12122,8 @@ components: example: gpt-6-luna type: string provider: - description: Decision-model provider slug. Omit together with model to preserve the saved selection. + description: >- + Decision-model provider slug. It must name a provider of type `openai`, `baseten`, or `typesafe`, the provider types that serve a decision model. Omit together with model to preserve the saved selection. example: openai type: string type: object @@ -12354,13 +12375,14 @@ components: minimum: 1 type: integer provider: - description: Provider slug. weighted_affinity requires an explicit provider and does not allow "*". + description: Provider slug. weighted_affinity and classified tiers require an explicit provider and do not allow "*". example: prod-us type: string reasoning_level: $ref: "#/components/schemas/AiGatewayRoutingReasoningLevel" rubric: - description: Destination rubric in a classified tier. Omission preserves a saved value; null clears it. Must be absent on the default destination. + description: >- + Destination rubric in a classified tier: when the decision model picks this destination. Up to 300 characters after leading and trailing spaces are trimmed, and different for each destination in the tier. Omission preserves a saved value; null clears it. Must be absent on the default destination. example: Short factual questions. maxLength: 300 nullable: true @@ -75150,6 +75172,327 @@ components: type: string x-enum-varnames: - CASE + IssueImpact: + description: The impact of an issue over the requested time window. + properties: + attributes: + $ref: "#/components/schemas/IssueImpactAttributes" + id: + description: Identifier of the issue. + example: "c1726a66-1f64-11ee-b338-da7ad0900002" + type: string + type: + $ref: "#/components/schemas/IssueImpactType" + required: + - id + - type + - attributes + type: object + IssueImpactAccount: + description: An account whose users are affected by the issue. + properties: + error_counts: + $ref: "#/components/schemas/IssueImpactErrorCounts" + id: + description: Account ID, from the `account.id` attribute. + example: "acc-7" + type: string + name: + description: Account name, if available. + example: "Acme" + type: string + significant: + description: |- + Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + example: true + type: boolean + required: + - id + - error_counts + - significant + type: object + IssueImpactAccounts: + description: Accounts whose users are affected by the issue. + properties: + distinct_count: + description: Number of distinct accounts affected by the issue in the time window. + example: 18 + format: int64 + type: integer + top: + description: Up to five accounts with the most errors, most affected first. + items: + $ref: "#/components/schemas/IssueImpactAccount" + type: array + required: + - distinct_count + - top + type: object + IssueImpactAttributes: + description: |- + The issue's errors in the time window, and the users, sessions, accounts, views, and endpoints they affect. + properties: + accounts: + $ref: "#/components/schemas/IssueImpactAccounts" + endpoints: + $ref: "#/components/schemas/IssueImpactEndpoints" + error_counts: + $ref: "#/components/schemas/IssueImpactErrorCounts" + sessions: + $ref: "#/components/schemas/IssueImpactSessions" + users: + $ref: "#/components/schemas/IssueImpactUsers" + views: + $ref: "#/components/schemas/IssueImpactViews" + required: + - error_counts + - users + - sessions + - accounts + - views + - endpoints + type: object + IssueImpactEndpoint: + description: An endpoint whose traces have the issue's errors. + properties: + error_counts: + $ref: "#/components/schemas/IssueImpactErrorCounts" + resource_name: + description: Resource name of the trace's root span. + example: "POST /orders" + type: string + service: + description: Service of the trace's root span. + example: "checkout-api" + type: string + significant: + description: |- + Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + example: true + type: boolean + required: + - service + - resource_name + - error_counts + - significant + type: object + IssueImpactEndpoints: + description: Endpoints whose traces have the issue's errors, identified by each trace's root span. + properties: + distinct_count: + description: Number of distinct endpoints affected by the issue in the time window. + example: 2 + format: int64 + type: integer + top: + description: Up to five endpoints with the most errors, most affected first. + items: + $ref: "#/components/schemas/IssueImpactEndpoint" + type: array + required: + - distinct_count + - top + type: object + IssueImpactErrorCounts: + description: |- + Number of errors reported by each source. Several sources can report the same error, such as an APM span and + a log, so the counts overlap: don't add them together. + properties: + apm: + description: Number of errors reported by APM. + example: 700 + format: int64 + type: integer + llmobs: + description: Number of errors reported by Agent Observability. + example: 0 + format: int64 + type: integer + logs: + description: Number of errors reported by Log Management. + example: 700 + format: int64 + type: integer + rum: + description: Number of errors reported by RUM. + example: 440 + format: int64 + type: integer + required: + - apm + - logs + - rum + - llmobs + type: object + IssueImpactResponse: + description: Response containing the impact of an error tracking issue. + properties: + data: + $ref: "#/components/schemas/IssueImpact" + required: + - data + type: object + IssueImpactSession: + description: A RUM session where the issue occurred. + properties: + error_counts: + $ref: "#/components/schemas/IssueImpactErrorCounts" + id: + description: Session identifier. + example: "8f1c3a52-6b1e-4a5e-9d0e-2c3b4a5d6e7f" + type: string + significant: + description: |- + Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + example: false + type: boolean + required: + - id + - error_counts + - significant + type: object + IssueImpactSessions: + description: RUM sessions where the issue occurred. + properties: + distinct_count: + description: Number of distinct sessions where the issue occurred in the time window. + example: 540 + format: int64 + type: integer + top: + description: Up to five sessions with the most errors, most affected first. + items: + $ref: "#/components/schemas/IssueImpactSession" + type: array + required: + - distinct_count + - top + type: object + IssueImpactType: + description: Type of the object. + enum: ["error_tracking_issue_impact"] + example: "error_tracking_issue_impact" + type: string + x-enum-varnames: + - ERROR_TRACKING_ISSUE_IMPACT + IssueImpactUser: + description: A user affected by the issue. + properties: + error_counts: + $ref: "#/components/schemas/IssueImpactErrorCounts" + id: + description: User ID, from the `usr.id` attribute. + example: "u-42" + type: string + name: + description: User name or email, if available. + example: "jane@example.com" + type: string + significant: + description: |- + Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + example: true + type: boolean + required: + - id + - error_counts + - significant + type: object + IssueImpactUsers: + description: Users affected by the issue. + properties: + distinct_count: + description: Number of distinct users affected by the issue in the time window. + example: 312 + format: int64 + type: integer + top: + description: Up to five users with the most errors, most affected first. + items: + $ref: "#/components/schemas/IssueImpactUser" + type: array + required: + - distinct_count + - top + type: object + IssueImpactView: + description: A RUM view where the issue occurred. + properties: + affected: + $ref: "#/components/schemas/IssueImpactViewCounts" + baseline: + $ref: "#/components/schemas/IssueImpactViewCounts" + error_counts: + $ref: "#/components/schemas/IssueImpactErrorCounts" + name: + description: View name. + example: "/checkout" + type: string + significant: + description: |- + Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + example: true + type: boolean + required: + - name + - error_counts + - significant + - affected + type: object + IssueImpactViewCounts: + description: |- + Distinct users, accounts, sessions, and view instances on a view. `affected` counts only those with the issue's + errors. `baseline` counts all users, accounts, sessions, and view instances on the view in the time window. It + is absent when RUM has no data for the view. + properties: + accounts: + description: Number of distinct accounts. + example: 12 + format: int64 + type: integer + sessions: + description: Number of distinct sessions. + example: 210 + format: int64 + type: integer + users: + description: Number of distinct users. + example: 150 + format: int64 + type: integer + views: + description: Number of distinct view instances. + example: 480 + format: int64 + type: integer + required: + - users + - accounts + - sessions + - views + type: object + IssueImpactViews: + description: RUM views where the issue occurred. + properties: + distinct_count: + description: Number of distinct view names where the issue occurred in the time window. + example: 4 + format: int64 + type: integer + top: + description: Up to five views with the most errors, most affected first. + items: + $ref: "#/components/schemas/IssueImpactView" + type: array + required: + - distinct_count + - top + type: object IssueIncluded: description: An array of related resources, returned when the `include` query parameter is used. oneOf: @@ -182239,6 +182582,80 @@ paths: summary: Update the assignee of an issue tags: - Error Tracking + /api/v2/error-tracking/issues/{issue_id}/impact: + get: + description: |- + Get an issue's impact over a time window: its error counts by source, and the users, sessions, accounts, + RUM views, and endpoints it affects most. + Returns 403 if the caller lacks the `error_tracking_read` permission or does not have access to the issue's + data. + operationId: GetIssueImpact + parameters: + - $ref: "#/components/parameters/IssueIDPathParameter" + - $ref: "#/components/parameters/GetIssueImpactFromParameter" + - $ref: "#/components/parameters/GetIssueImpactToParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + accounts: + distinct_count: 0 + top: [] + endpoints: + distinct_count: 1 + top: + - error_counts: + apm: 700 + llmobs: 0 + logs: 700 + rum: 0 + resource_name: POST /orders + service: checkout-api + significant: true + error_counts: + apm: 700 + llmobs: 0 + logs: 700 + rum: 0 + sessions: + distinct_count: 0 + top: [] + users: + distinct_count: 0 + top: [] + views: + distinct_count: 0 + top: [] + id: c1726a66-1f64-11ee-b338-da7ad0900002 + type: error_tracking_issue_impact + schema: + $ref: "#/components/schemas/IssueImpactResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - error_tracking_read + summary: Get the impact of an error tracking issue + tags: + - Error Tracking + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. /api/v2/error-tracking/issues/{issue_id}/state: put: description: Update the state of an issue by `issue_id`. Use this endpoint to move an issue between states such as `OPEN`, `RESOLVED`, or `IGNORED`. diff --git a/examples/v1/monitors/CreateMonitor_1267012748.py b/examples/v1/monitors/CreateMonitor_1267012748.py deleted file mode 100644 index cbffcecde0..0000000000 --- a/examples/v1/monitors/CreateMonitor_1267012748.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -Create a Data Jobs duration monitor returns "OK" response -""" - -from os import environ -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v1.api.monitors_api import MonitorsApi -from datadog_api_client.v1.model.monitor import Monitor -from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_data_source import ( - MonitorFormulaAndFunctionDataQualityDataSource, -) -from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_detection_type import ( - MonitorFormulaAndFunctionDataQualityDetectionType, -) -from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_monitor_options import ( - MonitorFormulaAndFunctionDataQualityMonitorOptions, -) -from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_query_definition import ( - MonitorFormulaAndFunctionDataQualityQueryDefinition, -) -from datadog_api_client.v1.model.monitor_options import MonitorOptions -from datadog_api_client.v1.model.monitor_type import MonitorType - -body = Monitor( - name="Example-Monitor", - type=MonitorType.DATA_JOBS_ALERT, - query='formula("job_duration(run_query)").detection(anomaly).by(name,workspace_name,entity_id) > 0', - message="Data jobs duration alert triggered", - tags=[ - "test:examplemonitor", - "env:ci", - ], - options=MonitorOptions( - variables=[ - MonitorFormulaAndFunctionDataQualityQueryDefinition( - name="run_query", - data_source=MonitorFormulaAndFunctionDataQualityDataSource.DATA_QUALITY_METRICS, - schema_version="0.0.1", - measure="duration", - filter="search for databricks_job", - run_filter="env:prod", - group_by=[ - "name", - "workspace_name", - "entity_id", - ], - monitor_options=MonitorFormulaAndFunctionDataQualityMonitorOptions( - detection_type=MonitorFormulaAndFunctionDataQualityDetectionType.ANOMALY, - consecutive_runs=2, - ), - ), - ], - ), -) - -configuration = Configuration() -configuration.access_token = environ["DD_BEARER_TOKEN"] -with ApiClient(configuration) as api_client: - api_instance = MonitorsApi(api_client) - response = api_instance.create_monitor(body=body) - - print(response) diff --git a/examples/v1/monitors/CreateMonitor_1302731819.py b/examples/v1/monitors/CreateMonitor_1302731819.py deleted file mode 100644 index da9748f655..0000000000 --- a/examples/v1/monitors/CreateMonitor_1302731819.py +++ /dev/null @@ -1,53 +0,0 @@ -""" -Create a Data Jobs monitor with the aastra query dialect returns "OK" response -""" - -from os import environ -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v1.api.monitors_api import MonitorsApi -from datadog_api_client.v1.model.monitor import Monitor -from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_monitor_options import ( - MonitorFormulaAndFunctionDataJobsMonitorOptions, -) -from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_query_definition import ( - MonitorFormulaAndFunctionDataJobsQueryDefinition, -) -from datadog_api_client.v1.model.monitor_options import MonitorOptions -from datadog_api_client.v1.model.monitor_thresholds import MonitorThresholds -from datadog_api_client.v1.model.monitor_type import MonitorType - -body = Monitor( - name="Example-Monitor", - type=MonitorType.DATA_JOBS_ALERT, - query='formula("failed_runs(run_query)").by(name,workspace_name,entity_id).last(1d) > 0', - message="Data jobs alert triggered", - tags=[ - "test:examplemonitor", - "env:ci", - ], - options=MonitorOptions( - thresholds=MonitorThresholds( - critical=0.0, - ), - variables=[ - MonitorFormulaAndFunctionDataJobsQueryDefinition( - name="run_query", - jobs_query="search for databricks_job", - job_type="databricks.job", - query_dialect="aastra", - run_filter="env:prod", - monitor_options=MonitorFormulaAndFunctionDataJobsMonitorOptions( - alert_on_every_failure=True, - ), - ), - ], - ), -) - -configuration = Configuration() -configuration.access_token = environ["DD_BEARER_TOKEN"] -with ApiClient(configuration) as api_client: - api_instance = MonitorsApi(api_client) - response = api_instance.create_monitor(body=body) - - print(response) diff --git a/examples/v2/error-tracking/GetIssueImpact.py b/examples/v2/error-tracking/GetIssueImpact.py new file mode 100644 index 0000000000..c5aa37379a --- /dev/null +++ b/examples/v2/error-tracking/GetIssueImpact.py @@ -0,0 +1,23 @@ +""" +Get the impact of an error tracking issue returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.error_tracking_api import ErrorTrackingApi + +# there is a valid "issue" in the system +ISSUE_ID = environ["ISSUE_ID"] + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["get_issue_impact"] = True +with ApiClient(configuration) as api_client: + api_instance = ErrorTrackingApi(api_client) + response = api_instance.get_issue_impact( + issue_id=ISSUE_ID, + filter_from=1635333071000, + filter_to=1636629071000, + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 0f851d3305..0c981e0f68 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -605,6 +605,7 @@ def __init__( "v2.trigger_deployment_gates_evaluation": False, "v2.update_deployment_gate": False, "v2.update_deployment_rule": False, + "v2.get_issue_impact": False, "v2.get_eudm_device": False, "v2.get_eudm_devices": False, "v2.clone_form": False, diff --git a/src/datadog_api_client/v1/api/monitors_api.py b/src/datadog_api_client/v1/api/monitors_api.py index 4e94af9f88..47bbf4cded 100644 --- a/src/datadog_api_client/v1/api/monitors_api.py +++ b/src/datadog_api_client/v1/api/monitors_api.py @@ -623,22 +623,6 @@ def create_monitor( * ``operator`` ``<`` , ``<=`` , ``>`` , ``>=`` , ``==`` , or ``!=``. * ``#`` an integer or decimal number used to set the threshold. - **Data Jobs Alert Query** - - Job status example: ``formula("failed_runs(run_query)").by(group_keys).last(time_window) > #`` - - Job duration examples: ``formula("job_duration(run_query)").detection(static).by(group_keys) > duration`` - and ``formula("job_duration(run_query)").detection(anomaly).by(group_keys) > 0`` - - * ``run_query`` : The name of the single query variable in ``options.variables``. Job status monitors - use a data jobs query; job duration monitors use a data quality query with the ``duration`` measure. - * ``group_keys`` : The tags to group by, such as ``entity_id,name,workspace_name``. - * ``time_window`` : Number of minutes (#m), hours (#h), or days (#d), up to ``10d``. - * ``#`` : The number of trailing failed runs to alert above, as a non-negative integer. - * ``duration`` : The duration to alert above, such as ``2h`` , ``30m`` , or a number of seconds. - * ``options.thresholds.critical`` : Must equal the query threshold, in seconds for job duration. - Anomaly job duration monitors omit ``options.thresholds``. - :param body: Create a monitor request body. :type body: Monitor :rtype: Monitor diff --git a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_jobs_monitor_options.py b/src/datadog_api_client/v1/model/monitor_formula_and_function_data_jobs_monitor_options.py deleted file mode 100644 index 44194f5a82..0000000000 --- a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_jobs_monitor_options.py +++ /dev/null @@ -1,39 +0,0 @@ -# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -# This product includes software developed at Datadog (https://www.datadoghq.com/). -# Copyright 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import Union - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -class MonitorFormulaAndFunctionDataJobsMonitorOptions(ModelNormal): - @cached_property - def openapi_types(_): - return { - "alert_on_every_failure": (bool,), - } - - attribute_map = { - "alert_on_every_failure": "alert_on_every_failure", - } - - def __init__(self_, alert_on_every_failure: Union[bool, UnsetType] = unset, **kwargs): - """ - Monitor configuration options for data jobs queries. - - :param alert_on_every_failure: Alert separately for each failed run instead of on the count of trailing failures. - Only supported for ``failed_runs`` monitors with the ``aastra`` query dialect. It requires - a ``> 0`` threshold with no warning threshold, an evaluation window of at most two days, - and renotification disabled. - :type alert_on_every_failure: bool, optional - """ - if alert_on_every_failure is not unset: - kwargs["alert_on_every_failure"] = alert_on_every_failure - super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_jobs_query_definition.py b/src/datadog_api_client/v1/model/monitor_formula_and_function_data_jobs_query_definition.py index 8b0c95eb60..cad58de6f0 100644 --- a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_jobs_query_definition.py +++ b/src/datadog_api_client/v1/model/monitor_formula_and_function_data_jobs_query_definition.py @@ -3,88 +3,49 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, - unset, - UnsetType, ) -if TYPE_CHECKING: - from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_monitor_options import ( - MonitorFormulaAndFunctionDataJobsMonitorOptions, - ) - - class MonitorFormulaAndFunctionDataJobsQueryDefinition(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_monitor_options import ( - MonitorFormulaAndFunctionDataJobsMonitorOptions, - ) - return { "job_type": (str,), "jobs_query": (str,), - "monitor_options": (MonitorFormulaAndFunctionDataJobsMonitorOptions,), "name": (str,), "query_dialect": (str,), - "run_filter": (str,), } attribute_map = { "job_type": "job_type", "jobs_query": "jobs_query", - "monitor_options": "monitor_options", "name": "name", "query_dialect": "query_dialect", - "run_filter": "run_filter", } - def __init__( - self_, - job_type: str, - jobs_query: str, - name: str, - query_dialect: str, - monitor_options: Union[MonitorFormulaAndFunctionDataJobsMonitorOptions, UnsetType] = unset, - run_filter: Union[str, UnsetType] = unset, - **kwargs, - ): + def __init__(self_, job_type: str, jobs_query: str, name: str, query_dialect: str, **kwargs): """ A formula and functions data jobs query. :param job_type: The type of job being monitored. Valid values include: - ``databricks.job`` , ``spark.application`` , ``airflow.dag`` , ``dbt.job`` , ``glue.job`` , ``adf.pipeline``. - The ``aastra`` dialect also accepts ``airflow.job`` , ``dbt.model`` , and ``dbt.test``. + ``databricks.job`` , ``spark.application`` , ``airflow.dag`` , + ``dbt.job`` , ``dbt.model`` , ``dbt.test`` , ``glue.job``. Custom job types are supported with the ``custom.ol.`` prefix. :type job_type: str - :param jobs_query: Filter expression used to select the jobs to monitor. Its syntax depends on ``query_dialect`` : - a metric tag filter such as ``job_name:smoke*`` for ``metric`` , or an Aastra entity search - such as ``search for databricks_job where `@team:data-eng` `` for ``aastra``. + :param jobs_query: Filter expression used to select the jobs to monitor. :type jobs_query: str - :param monitor_options: Monitor configuration options for data jobs queries. - :type monitor_options: MonitorFormulaAndFunctionDataJobsMonitorOptions, optional - :param name: Name of the query for use in formulas. Must be ``run_query``. :type name: str - :param query_dialect: Query dialect for data jobs queries. Valid values are ``metric`` and ``aastra``. + :param query_dialect: Query dialect for data jobs queries. Currently only ``metric`` is supported. :type query_dialect: str - - :param run_filter: Optional filter on individual runs, using metrics filter syntax. - Only supported with the ``aastra`` query dialect. - :type run_filter: str, optional """ - if monitor_options is not unset: - kwargs["monitor_options"] = monitor_options - if run_filter is not unset: - kwargs["run_filter"] = run_filter super().__init__(kwargs) self_.job_type = job_type diff --git a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_detection_type.py b/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_detection_type.py deleted file mode 100644 index bd3bb5e5d1..0000000000 --- a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_detection_type.py +++ /dev/null @@ -1,39 +0,0 @@ -# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -# This product includes software developed at Datadog (https://www.datadoghq.com/). -# Copyright 2019-Present Datadog, Inc. -from __future__ import annotations - - -from datadog_api_client.model_utils import ( - ModelSimple, - cached_property, -) - -from typing import ClassVar - - -class MonitorFormulaAndFunctionDataQualityDetectionType(ModelSimple): - """ - How a `data-jobs alert` job duration monitor detects a breach. Must match the - `.detection()` call in the monitor query. Required for job duration monitors. - - :param value: Must be one of ["static", "anomaly"]. - :type value: str - """ - - allowed_values = { - "static", - "anomaly", - } - STATIC: ClassVar["MonitorFormulaAndFunctionDataQualityDetectionType"] - ANOMALY: ClassVar["MonitorFormulaAndFunctionDataQualityDetectionType"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -MonitorFormulaAndFunctionDataQualityDetectionType.STATIC = MonitorFormulaAndFunctionDataQualityDetectionType("static") -MonitorFormulaAndFunctionDataQualityDetectionType.ANOMALY = MonitorFormulaAndFunctionDataQualityDetectionType("anomaly") diff --git a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_monitor_options.py b/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_monitor_options.py index b5a7d592c8..e457b56c12 100644 --- a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_monitor_options.py +++ b/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_monitor_options.py @@ -14,9 +14,6 @@ if TYPE_CHECKING: - from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_detection_type import ( - MonitorFormulaAndFunctionDataQualityDetectionType, - ) from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_model_configuration import ( MonitorFormulaAndFunctionDataQualityModelConfiguration, ) @@ -29,17 +26,8 @@ class MonitorFormulaAndFunctionDataQualityMonitorOptions(ModelNormal): - validations = { - "consecutive_runs": { - "inclusive_minimum": 1, - }, - } - @cached_property def openapi_types(_): - from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_detection_type import ( - MonitorFormulaAndFunctionDataQualityDetectionType, - ) from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_model_configuration import ( MonitorFormulaAndFunctionDataQualityModelConfiguration, ) @@ -51,11 +39,9 @@ def openapi_types(_): ) return { - "consecutive_runs": (int,), "crontab_override": (str,), "custom_sql": (str,), "custom_where": (str,), - "detection_type": (MonitorFormulaAndFunctionDataQualityDetectionType,), "group_by_columns": ([str],), "model_configuration": (MonitorFormulaAndFunctionDataQualityModelConfiguration,), "model_type_override": (MonitorFormulaAndFunctionDataQualityModelTypeOverride,), @@ -64,11 +50,9 @@ def openapi_types(_): } attribute_map = { - "consecutive_runs": "consecutive_runs", "crontab_override": "crontab_override", "custom_sql": "custom_sql", "custom_where": "custom_where", - "detection_type": "detection_type", "group_by_columns": "group_by_columns", "model_configuration": "model_configuration", "model_type_override": "model_type_override", @@ -78,11 +62,9 @@ def openapi_types(_): def __init__( self_, - consecutive_runs: Union[int, UnsetType] = unset, crontab_override: Union[str, UnsetType] = unset, custom_sql: Union[str, UnsetType] = unset, custom_where: Union[str, UnsetType] = unset, - detection_type: Union[MonitorFormulaAndFunctionDataQualityDetectionType, UnsetType] = unset, group_by_columns: Union[List[str], UnsetType] = unset, model_configuration: Union[MonitorFormulaAndFunctionDataQualityModelConfiguration, UnsetType] = unset, model_type_override: Union[MonitorFormulaAndFunctionDataQualityModelTypeOverride, UnsetType] = unset, @@ -93,10 +75,6 @@ def __init__( """ Monitor configuration options for data quality queries. - :param consecutive_runs: Number of consecutive runs that must breach before the monitor alerts. - Only supported by ``data-jobs alert`` job duration monitors. Defaults to ``1``. - :type consecutive_runs: int, optional - :param crontab_override: Crontab expression to override the default schedule. :type crontab_override: str, optional @@ -106,10 +84,6 @@ def __init__( :param custom_where: Custom WHERE clause for the query. :type custom_where: str, optional - :param detection_type: How a ``data-jobs alert`` job duration monitor detects a breach. Must match the - ``.detection()`` call in the monitor query. Required for job duration monitors. - :type detection_type: MonitorFormulaAndFunctionDataQualityDetectionType, optional - :param group_by_columns: Columns to group results by. :type group_by_columns: [str], optional @@ -128,16 +102,12 @@ def __init__( across two data entities and alerts on the difference between them. :type source_to_target_config: MonitorFormulaAndFunctionDataQualitySourceToTargetConfig, optional """ - if consecutive_runs is not unset: - kwargs["consecutive_runs"] = consecutive_runs if crontab_override is not unset: kwargs["crontab_override"] = crontab_override if custom_sql is not unset: kwargs["custom_sql"] = custom_sql if custom_where is not unset: kwargs["custom_where"] = custom_where - if detection_type is not unset: - kwargs["detection_type"] = detection_type if group_by_columns is not unset: kwargs["group_by_columns"] = group_by_columns if model_configuration is not unset: diff --git a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_query_definition.py b/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_query_definition.py index 7958de3ca6..ef57341eaa 100644 --- a/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_query_definition.py +++ b/src/datadog_api_client/v1/model/monitor_formula_and_function_data_quality_query_definition.py @@ -39,7 +39,6 @@ def openapi_types(_): "measure": (str,), "monitor_options": (MonitorFormulaAndFunctionDataQualityMonitorOptions,), "name": (str,), - "run_filter": (str,), "schema_version": (str,), "scope": (str,), } @@ -51,7 +50,6 @@ def openapi_types(_): "measure": "measure", "monitor_options": "monitor_options", "name": "name", - "run_filter": "run_filter", "schema_version": "schema_version", "scope": "scope", } @@ -64,7 +62,6 @@ def __init__( name: str, group_by: Union[List[str], UnsetType] = unset, monitor_options: Union[MonitorFormulaAndFunctionDataQualityMonitorOptions, UnsetType] = unset, - run_filter: Union[str, UnsetType] = unset, schema_version: Union[str, UnsetType] = unset, scope: Union[str, UnsetType] = unset, **kwargs, @@ -84,8 +81,7 @@ def __init__( :param measure: The data quality measure to query. Common values include: ``bytes`` , ``cardinality`` , ``custom`` , ``freshness`` , ``max`` , ``mean`` , ``min`` , ``nullness`` , ``percent_negative`` , ``percent_zero`` , ``row_count`` , ``stddev`` , - ``sum`` , ``uniqueness``. ``data-jobs alert`` job duration monitors use ``duration``. - Additional values may be supported. + ``sum`` , ``uniqueness``. Additional values may be supported. :type measure: str :param monitor_options: Monitor configuration options for data quality queries. @@ -94,10 +90,6 @@ def __init__( :param name: Name of the query for use in formulas. :type name: str - :param run_filter: Optional filter on individual runs, using metrics filter syntax. - Only supported by ``data-jobs alert`` job duration monitors. - :type run_filter: str, optional - :param schema_version: Schema version for the data quality query. :type schema_version: str, optional @@ -109,8 +101,6 @@ def __init__( kwargs["group_by"] = group_by if monitor_options is not unset: kwargs["monitor_options"] = monitor_options - if run_filter is not unset: - kwargs["run_filter"] = run_filter if schema_version is not unset: kwargs["schema_version"] = schema_version if scope is not unset: diff --git a/src/datadog_api_client/v1/model/monitor_formula_and_function_query_definition.py b/src/datadog_api_client/v1/model/monitor_formula_and_function_query_definition.py index 07eb35e8a3..ce4c3bbda6 100644 --- a/src/datadog_api_client/v1/model/monitor_formula_and_function_query_definition.py +++ b/src/datadog_api_client/v1/model/monitor_formula_and_function_query_definition.py @@ -45,17 +45,12 @@ def __init__(self, **kwargs): :param measure: The data quality measure to query. Common values include: `bytes`, `cardinality`, `custom`, `freshness`, `max`, `mean`, `min`, `nullness`, `percent_negative`, `percent_zero`, `row_count`, `stddev`, - `sum`, `uniqueness`. `data-jobs alert` job duration monitors use `duration`. - Additional values may be supported. + `sum`, `uniqueness`. Additional values may be supported. :type measure: str :param monitor_options: Monitor configuration options for data quality queries. :type monitor_options: MonitorFormulaAndFunctionDataQualityMonitorOptions, optional - :param run_filter: Optional filter on individual runs, using metrics filter syntax. - Only supported by `data-jobs alert` job duration monitors. - :type run_filter: str, optional - :param schema_version: Schema version for the data quality query. :type schema_version: str, optional @@ -64,17 +59,15 @@ def __init__(self, **kwargs): :type scope: str, optional :param job_type: The type of job being monitored. Valid values include: - `databricks.job`, `spark.application`, `airflow.dag`, `dbt.job`, `glue.job`, `adf.pipeline`. - The `aastra` dialect also accepts `airflow.job`, `dbt.model`, and `dbt.test`. + `databricks.job`, `spark.application`, `airflow.dag`, + `dbt.job`, `dbt.model`, `dbt.test`, `glue.job`. Custom job types are supported with the `custom.ol.` prefix. :type job_type: str - :param jobs_query: Filter expression used to select the jobs to monitor. Its syntax depends on `query_dialect`: - a metric tag filter such as `job_name:smoke*` for `metric`, or an Aastra entity search - such as ``search for databricks_job where `@team:data-eng` `` for `aastra`. + :param jobs_query: Filter expression used to select the jobs to monitor. :type jobs_query: str - :param query_dialect: Query dialect for data jobs queries. Valid values are `metric` and `aastra`. + :param query_dialect: Query dialect for data jobs queries. Currently only `metric` is supported. :type query_dialect: str :param augment_query: Augment query for aggregate augmented queries. Can be an events query or a reference table query. diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 85954dfc40..135ebf6b1f 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -558,18 +558,12 @@ from datadog_api_client.v1.model.monitor_formula_and_function_cost_query_definition import ( MonitorFormulaAndFunctionCostQueryDefinition, ) -from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_monitor_options import ( - MonitorFormulaAndFunctionDataJobsMonitorOptions, -) from datadog_api_client.v1.model.monitor_formula_and_function_data_jobs_query_definition import ( MonitorFormulaAndFunctionDataJobsQueryDefinition, ) from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_data_source import ( MonitorFormulaAndFunctionDataQualityDataSource, ) -from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_detection_type import ( - MonitorFormulaAndFunctionDataQualityDetectionType, -) from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_diff_function import ( MonitorFormulaAndFunctionDataQualityDiffFunction, ) @@ -2023,10 +2017,8 @@ "MonitorFormulaAndFunctionCostAggregator", "MonitorFormulaAndFunctionCostDataSource", "MonitorFormulaAndFunctionCostQueryDefinition", - "MonitorFormulaAndFunctionDataJobsMonitorOptions", "MonitorFormulaAndFunctionDataJobsQueryDefinition", "MonitorFormulaAndFunctionDataQualityDataSource", - "MonitorFormulaAndFunctionDataQualityDetectionType", "MonitorFormulaAndFunctionDataQualityDiffFunction", "MonitorFormulaAndFunctionDataQualityDiffType", "MonitorFormulaAndFunctionDataQualityEntityMetricConfig", diff --git a/src/datadog_api_client/v2/api/error_tracking_api.py b/src/datadog_api_client/v2/api/error_tracking_api.py index 6f188b874a..85c5e84b02 100644 --- a/src/datadog_api_client/v2/api/error_tracking_api.py +++ b/src/datadog_api_client/v2/api/error_tracking_api.py @@ -18,6 +18,7 @@ from datadog_api_client.v2.model.get_issue_include_query_parameter_item import GetIssueIncludeQueryParameterItem from datadog_api_client.v2.model.issue_sample_bias import IssueSampleBias from datadog_api_client.v2.model.issue_update_assignee_request import IssueUpdateAssigneeRequest +from datadog_api_client.v2.model.issue_impact_response import IssueImpactResponse from datadog_api_client.v2.model.issue_update_state_request import IssueUpdateStateRequest @@ -89,6 +90,41 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_issue_impact_endpoint = _Endpoint( + settings={ + "response_type": (IssueImpactResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/error-tracking/issues/{issue_id}/impact", + "operation_id": "get_issue_impact", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "issue_id": { + "required": True, + "openapi_types": (str,), + "attribute": "issue_id", + "location": "path", + }, + "filter_from": { + "required": True, + "openapi_types": (int,), + "attribute": "filter[from]", + "location": "query", + }, + "filter_to": { + "required": True, + "openapi_types": (int,), + "attribute": "filter[to]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._search_issues_endpoint = _Endpoint( settings={ "response_type": (IssuesSearchResponse,), @@ -217,6 +253,37 @@ def get_issue( return self._get_issue_endpoint.call_with_http_info(**kwargs) + def get_issue_impact( + self, + issue_id: str, + filter_from: int, + filter_to: int, + ) -> IssueImpactResponse: + """Get the impact of an error tracking issue. + + Get an issue's impact over a time window: its error counts by source, and the users, sessions, accounts, + RUM views, and endpoints it affects most. + Returns 403 if the caller lacks the ``error_tracking_read`` permission or does not have access to the issue's + data. + + :param issue_id: The identifier of the issue. + :type issue_id: str + :param filter_from: Start of the time window, in milliseconds since the Unix epoch. Must be before ``filter[to]``. + :type filter_from: int + :param filter_to: End of the time window, in milliseconds since the Unix epoch. Use the issue's ``last_seen`` to end the window at + its latest error. + :type filter_to: int + :rtype: IssueImpactResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["issue_id"] = issue_id + + kwargs["filter_from"] = filter_from + + kwargs["filter_to"] = filter_to + + return self._get_issue_impact_endpoint.call_with_http_info(**kwargs) + def search_issues( self, body: IssuesSearchRequest, diff --git a/src/datadog_api_client/v2/model/ai_gateway_nullable_routing_rule_tier_ordering.py b/src/datadog_api_client/v2/model/ai_gateway_nullable_routing_rule_tier_ordering.py index c43b289658..247d5dae46 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_nullable_routing_rule_tier_ordering.py +++ b/src/datadog_api_client/v2/model/ai_gateway_nullable_routing_rule_tier_ordering.py @@ -14,7 +14,7 @@ class AiGatewayNullableRoutingRuleTierOrdering(ModelSimple): """ - How a tier orders its targets. Omission preserves the saved same-position tier on update; null resets to configured. New tiers default to configured. The weighted_affinity ordering distributes first-choice assignments by relative target weights and accepts only model targets with an explicit provider, without repeated provider and model pairs in the same tier. The `classified` ordering is allowed only in the first tier and requires a classifier, destination rubrics, and one default destination. + How a tier orders its targets. Omission preserves the saved same-position tier on update; null resets to configured. New tiers default to configured. The weighted_affinity ordering distributes first-choice assignments by relative target weights and accepts only model targets with an explicit provider, without repeated provider and model pairs in the same tier. The `classified` ordering is allowed only in the first tier and requires a classifier, destination rubrics, and one default destination. Its targets are model targets that each name one provider, not "*". Besides the default, it needs 1 to 9 destinations, each with a different rubric. Classified routing is in Preview: saving a classified tier returns 403 Forbidden unless the feature is enabled for the organization. :param value: Must be one of ["configured", "weighted_affinity", "classified"]. :type value: str diff --git a/src/datadog_api_client/v2/model/ai_gateway_routing_classifier_request.py b/src/datadog_api_client/v2/model/ai_gateway_routing_classifier_request.py index d8b34f0b01..0d921231a1 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_routing_classifier_request.py +++ b/src/datadog_api_client/v2/model/ai_gateway_routing_classifier_request.py @@ -62,7 +62,7 @@ def __init__( :param model: Decision model on the provider. Omit together with provider to preserve the saved selection. :type model: str, optional - :param provider: Decision-model provider slug. Omit together with model to preserve the saved selection. + :param provider: Decision-model provider slug. It must name a provider of type ``openai`` , ``baseten`` , or ``typesafe`` , the provider types that serve a decision model. Omit together with model to preserve the saved selection. :type provider: str, optional """ if confidence_threshold is not unset: diff --git a/src/datadog_api_client/v2/model/ai_gateway_routing_rule_target_request.py b/src/datadog_api_client/v2/model/ai_gateway_routing_rule_target_request.py index 1e2cab70d7..b230f9a7a6 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_routing_rule_target_request.py +++ b/src/datadog_api_client/v2/model/ai_gateway_routing_rule_target_request.py @@ -96,13 +96,13 @@ def __init__( :param model_id: Opaque model catalog ID for a concrete model target. New selections require provider View; saved selections can be retained without metadata. :type model_id: int, optional - :param provider: Provider slug. weighted_affinity requires an explicit provider and does not allow "*". + :param provider: Provider slug. weighted_affinity and classified tiers require an explicit provider and do not allow "*". :type provider: str, optional :param reasoning_level: Optional reasoning effort preference for this model destination. Must be supported by the selected model and provider. For provider "*", every eligible provider must support the level. An explicit value overrides the request's reasoning setting, subject to model-group policy. Omitted or null preserves request and provider behavior; none is an explicit level, not the default. On update, omission preserves a saved target override; null explicitly clears it. Routing-rule references cannot set this field; each referenced model destination owns its override. If an override cannot be applied at runtime, the gateway keeps the destination and restores the caller's original reasoning settings, or preserves the provider default when omitted. It rechecks all applicable route and model-group policies against those settings before sending. Model-group max_reasoning_level enforces hard limits; the override is not an additional cap. Normal fallback applies if governance denies the resulting request or the destination cannot otherwise serve it. Metrics and span tags record the override outcome and incompatibility reason. When response headers have not already been committed, ``X-Ai-Gateway-Reasoning-Override`` reports applied or not_applied for the returned attempt, and ``X-Ai-Gateway-Reasoning-Override-Reason`` reports the reason when not applied. :type reasoning_level: AiGatewayRoutingReasoningLevel, none_type, optional - :param rubric: Destination rubric in a classified tier. Omission preserves a saved value; null clears it. Must be absent on the default destination. + :param rubric: Destination rubric in a classified tier: when the decision model picks this destination. Up to 300 characters after leading and trailing spaces are trimmed, and different for each destination in the tier. Omission preserves a saved value; null clears it. Must be absent on the default destination. :type rubric: str, none_type, optional :param slug: Organization-unique routing rule slug. New references require route View. Omit to retain a saved target by its parent-local ID. Allowed only in configured tiers. diff --git a/src/datadog_api_client/v2/model/ai_gateway_routing_rule_tier_request.py b/src/datadog_api_client/v2/model/ai_gateway_routing_rule_tier_request.py index d5362c86e9..c490489e8d 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_routing_rule_tier_request.py +++ b/src/datadog_api_client/v2/model/ai_gateway_routing_rule_tier_request.py @@ -62,7 +62,7 @@ def __init__( :param classifier: Decision model and settings for a classified tier. Omission preserves the saved classifier; null clears it. Newly selected models require provider View. :type classifier: AiGatewayRoutingClassifierRequest, none_type, optional - :param ordering: How a tier orders its targets. Omission preserves the saved same-position tier on update; null resets to configured. New tiers default to configured. The weighted_affinity ordering distributes first-choice assignments by relative target weights and accepts only model targets with an explicit provider, without repeated provider and model pairs in the same tier. The ``classified`` ordering is allowed only in the first tier and requires a classifier, destination rubrics, and one default destination. + :param ordering: How a tier orders its targets. Omission preserves the saved same-position tier on update; null resets to configured. New tiers default to configured. The weighted_affinity ordering distributes first-choice assignments by relative target weights and accepts only model targets with an explicit provider, without repeated provider and model pairs in the same tier. The ``classified`` ordering is allowed only in the first tier and requires a classifier, destination rubrics, and one default destination. Its targets are model targets that each name one provider, not "*". Besides the default, it needs 1 to 9 destinations, each with a different rubric. Classified routing is in Preview: saving a classified tier returns 403 Forbidden unless the feature is enabled for the organization. :type ordering: AiGatewayNullableRoutingRuleTierOrdering, none_type, optional :param targets: diff --git a/src/datadog_api_client/v2/model/issue_impact.py b/src/datadog_api_client/v2/model/issue_impact.py new file mode 100644 index 0000000000..46491ce213 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_attributes import IssueImpactAttributes + from datadog_api_client.v2.model.issue_impact_type import IssueImpactType + + +class IssueImpact(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_attributes import IssueImpactAttributes + from datadog_api_client.v2.model.issue_impact_type import IssueImpactType + + return { + "attributes": (IssueImpactAttributes,), + "id": (str,), + "type": (IssueImpactType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: IssueImpactAttributes, id: str, type: IssueImpactType, **kwargs): + """ + The impact of an issue over the requested time window. + + :param attributes: The issue's errors in the time window, and the users, sessions, accounts, views, and endpoints they affect. + :type attributes: IssueImpactAttributes + + :param id: Identifier of the issue. + :type id: str + + :param type: Type of the object. + :type type: IssueImpactType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_impact_account.py b/src/datadog_api_client/v2/model/issue_impact_account.py new file mode 100644 index 0000000000..718893ff47 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_account.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + +class IssueImpactAccount(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + return { + "error_counts": (IssueImpactErrorCounts,), + "id": (str,), + "name": (str,), + "significant": (bool,), + } + + attribute_map = { + "error_counts": "error_counts", + "id": "id", + "name": "name", + "significant": "significant", + } + + def __init__( + self_, + error_counts: IssueImpactErrorCounts, + id: str, + significant: bool, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + An account whose users are affected by the issue. + + :param error_counts: Number of errors reported by each source. Several sources can report the same error, such as an APM span and + a log, so the counts overlap: don't add them together. + :type error_counts: IssueImpactErrorCounts + + :param id: Account ID, from the ``account.id`` attribute. + :type id: str + + :param name: Account name, if available. + :type name: str, optional + + :param significant: Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + :type significant: bool + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.error_counts = error_counts + self_.id = id + self_.significant = significant diff --git a/src/datadog_api_client/v2/model/issue_impact_accounts.py b/src/datadog_api_client/v2/model/issue_impact_accounts.py new file mode 100644 index 0000000000..580f0a1b6f --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_accounts.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_account import IssueImpactAccount + + +class IssueImpactAccounts(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_account import IssueImpactAccount + + return { + "distinct_count": (int,), + "top": ([IssueImpactAccount],), + } + + attribute_map = { + "distinct_count": "distinct_count", + "top": "top", + } + + def __init__(self_, distinct_count: int, top: List[IssueImpactAccount], **kwargs): + """ + Accounts whose users are affected by the issue. + + :param distinct_count: Number of distinct accounts affected by the issue in the time window. + :type distinct_count: int + + :param top: Up to five accounts with the most errors, most affected first. + :type top: [IssueImpactAccount] + """ + super().__init__(kwargs) + + self_.distinct_count = distinct_count + self_.top = top diff --git a/src/datadog_api_client/v2/model/issue_impact_attributes.py b/src/datadog_api_client/v2/model/issue_impact_attributes.py new file mode 100644 index 0000000000..2c1f85c31d --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_attributes.py @@ -0,0 +1,90 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_accounts import IssueImpactAccounts + from datadog_api_client.v2.model.issue_impact_endpoints import IssueImpactEndpoints + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + from datadog_api_client.v2.model.issue_impact_sessions import IssueImpactSessions + from datadog_api_client.v2.model.issue_impact_users import IssueImpactUsers + from datadog_api_client.v2.model.issue_impact_views import IssueImpactViews + + +class IssueImpactAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_accounts import IssueImpactAccounts + from datadog_api_client.v2.model.issue_impact_endpoints import IssueImpactEndpoints + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + from datadog_api_client.v2.model.issue_impact_sessions import IssueImpactSessions + from datadog_api_client.v2.model.issue_impact_users import IssueImpactUsers + from datadog_api_client.v2.model.issue_impact_views import IssueImpactViews + + return { + "accounts": (IssueImpactAccounts,), + "endpoints": (IssueImpactEndpoints,), + "error_counts": (IssueImpactErrorCounts,), + "sessions": (IssueImpactSessions,), + "users": (IssueImpactUsers,), + "views": (IssueImpactViews,), + } + + attribute_map = { + "accounts": "accounts", + "endpoints": "endpoints", + "error_counts": "error_counts", + "sessions": "sessions", + "users": "users", + "views": "views", + } + + def __init__( + self_, + accounts: IssueImpactAccounts, + endpoints: IssueImpactEndpoints, + error_counts: IssueImpactErrorCounts, + sessions: IssueImpactSessions, + users: IssueImpactUsers, + views: IssueImpactViews, + **kwargs, + ): + """ + The issue's errors in the time window, and the users, sessions, accounts, views, and endpoints they affect. + + :param accounts: Accounts whose users are affected by the issue. + :type accounts: IssueImpactAccounts + + :param endpoints: Endpoints whose traces have the issue's errors, identified by each trace's root span. + :type endpoints: IssueImpactEndpoints + + :param error_counts: Number of errors reported by each source. Several sources can report the same error, such as an APM span and + a log, so the counts overlap: don't add them together. + :type error_counts: IssueImpactErrorCounts + + :param sessions: RUM sessions where the issue occurred. + :type sessions: IssueImpactSessions + + :param users: Users affected by the issue. + :type users: IssueImpactUsers + + :param views: RUM views where the issue occurred. + :type views: IssueImpactViews + """ + super().__init__(kwargs) + + self_.accounts = accounts + self_.endpoints = endpoints + self_.error_counts = error_counts + self_.sessions = sessions + self_.users = users + self_.views = views diff --git a/src/datadog_api_client/v2/model/issue_impact_endpoint.py b/src/datadog_api_client/v2/model/issue_impact_endpoint.py new file mode 100644 index 0000000000..6e5d1923ce --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_endpoint.py @@ -0,0 +1,62 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + +class IssueImpactEndpoint(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + return { + "error_counts": (IssueImpactErrorCounts,), + "resource_name": (str,), + "service": (str,), + "significant": (bool,), + } + + attribute_map = { + "error_counts": "error_counts", + "resource_name": "resource_name", + "service": "service", + "significant": "significant", + } + + def __init__( + self_, error_counts: IssueImpactErrorCounts, resource_name: str, service: str, significant: bool, **kwargs + ): + """ + An endpoint whose traces have the issue's errors. + + :param error_counts: Number of errors reported by each source. Several sources can report the same error, such as an APM span and + a log, so the counts overlap: don't add them together. + :type error_counts: IssueImpactErrorCounts + + :param resource_name: Resource name of the trace's root span. + :type resource_name: str + + :param service: Service of the trace's root span. + :type service: str + + :param significant: Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + :type significant: bool + """ + super().__init__(kwargs) + + self_.error_counts = error_counts + self_.resource_name = resource_name + self_.service = service + self_.significant = significant diff --git a/src/datadog_api_client/v2/model/issue_impact_endpoints.py b/src/datadog_api_client/v2/model/issue_impact_endpoints.py new file mode 100644 index 0000000000..0eab2feb5f --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_endpoints.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_endpoint import IssueImpactEndpoint + + +class IssueImpactEndpoints(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_endpoint import IssueImpactEndpoint + + return { + "distinct_count": (int,), + "top": ([IssueImpactEndpoint],), + } + + attribute_map = { + "distinct_count": "distinct_count", + "top": "top", + } + + def __init__(self_, distinct_count: int, top: List[IssueImpactEndpoint], **kwargs): + """ + Endpoints whose traces have the issue's errors, identified by each trace's root span. + + :param distinct_count: Number of distinct endpoints affected by the issue in the time window. + :type distinct_count: int + + :param top: Up to five endpoints with the most errors, most affected first. + :type top: [IssueImpactEndpoint] + """ + super().__init__(kwargs) + + self_.distinct_count = distinct_count + self_.top = top diff --git a/src/datadog_api_client/v2/model/issue_impact_error_counts.py b/src/datadog_api_client/v2/model/issue_impact_error_counts.py new file mode 100644 index 0000000000..e2e76c3041 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_error_counts.py @@ -0,0 +1,52 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class IssueImpactErrorCounts(ModelNormal): + @cached_property + def openapi_types(_): + return { + "apm": (int,), + "llmobs": (int,), + "logs": (int,), + "rum": (int,), + } + + attribute_map = { + "apm": "apm", + "llmobs": "llmobs", + "logs": "logs", + "rum": "rum", + } + + def __init__(self_, apm: int, llmobs: int, logs: int, rum: int, **kwargs): + """ + Number of errors reported by each source. Several sources can report the same error, such as an APM span and + a log, so the counts overlap: don't add them together. + + :param apm: Number of errors reported by APM. + :type apm: int + + :param llmobs: Number of errors reported by Agent Observability. + :type llmobs: int + + :param logs: Number of errors reported by Log Management. + :type logs: int + + :param rum: Number of errors reported by RUM. + :type rum: int + """ + super().__init__(kwargs) + + self_.apm = apm + self_.llmobs = llmobs + self_.logs = logs + self_.rum = rum diff --git a/src/datadog_api_client/v2/model/issue_impact_response.py b/src/datadog_api_client/v2/model/issue_impact_response.py new file mode 100644 index 0000000000..ba3a515c5a --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact import IssueImpact + + +class IssueImpactResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact import IssueImpact + + return { + "data": (IssueImpact,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IssueImpact, **kwargs): + """ + Response containing the impact of an error tracking issue. + + :param data: The impact of an issue over the requested time window. + :type data: IssueImpact + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/issue_impact_session.py b/src/datadog_api_client/v2/model/issue_impact_session.py new file mode 100644 index 0000000000..c5390c04b3 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_session.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + +class IssueImpactSession(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + return { + "error_counts": (IssueImpactErrorCounts,), + "id": (str,), + "significant": (bool,), + } + + attribute_map = { + "error_counts": "error_counts", + "id": "id", + "significant": "significant", + } + + def __init__(self_, error_counts: IssueImpactErrorCounts, id: str, significant: bool, **kwargs): + """ + A RUM session where the issue occurred. + + :param error_counts: Number of errors reported by each source. Several sources can report the same error, such as an APM span and + a log, so the counts overlap: don't add them together. + :type error_counts: IssueImpactErrorCounts + + :param id: Session identifier. + :type id: str + + :param significant: Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + :type significant: bool + """ + super().__init__(kwargs) + + self_.error_counts = error_counts + self_.id = id + self_.significant = significant diff --git a/src/datadog_api_client/v2/model/issue_impact_sessions.py b/src/datadog_api_client/v2/model/issue_impact_sessions.py new file mode 100644 index 0000000000..de7ebcc834 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_sessions.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_session import IssueImpactSession + + +class IssueImpactSessions(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_session import IssueImpactSession + + return { + "distinct_count": (int,), + "top": ([IssueImpactSession],), + } + + attribute_map = { + "distinct_count": "distinct_count", + "top": "top", + } + + def __init__(self_, distinct_count: int, top: List[IssueImpactSession], **kwargs): + """ + RUM sessions where the issue occurred. + + :param distinct_count: Number of distinct sessions where the issue occurred in the time window. + :type distinct_count: int + + :param top: Up to five sessions with the most errors, most affected first. + :type top: [IssueImpactSession] + """ + super().__init__(kwargs) + + self_.distinct_count = distinct_count + self_.top = top diff --git a/src/datadog_api_client/v2/model/issue_impact_type.py b/src/datadog_api_client/v2/model/issue_impact_type.py new file mode 100644 index 0000000000..ef3dfd149b --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class IssueImpactType(ModelSimple): + """ + Type of the object. + + :param value: If omitted defaults to "error_tracking_issue_impact". Must be one of ["error_tracking_issue_impact"]. + :type value: str + """ + + allowed_values = { + "error_tracking_issue_impact", + } + ERROR_TRACKING_ISSUE_IMPACT: ClassVar["IssueImpactType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueImpactType.ERROR_TRACKING_ISSUE_IMPACT = IssueImpactType("error_tracking_issue_impact") diff --git a/src/datadog_api_client/v2/model/issue_impact_user.py b/src/datadog_api_client/v2/model/issue_impact_user.py new file mode 100644 index 0000000000..02ee71851a --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_user.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + +class IssueImpactUser(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + return { + "error_counts": (IssueImpactErrorCounts,), + "id": (str,), + "name": (str,), + "significant": (bool,), + } + + attribute_map = { + "error_counts": "error_counts", + "id": "id", + "name": "name", + "significant": "significant", + } + + def __init__( + self_, + error_counts: IssueImpactErrorCounts, + id: str, + significant: bool, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A user affected by the issue. + + :param error_counts: Number of errors reported by each source. Several sources can report the same error, such as an APM span and + a log, so the counts overlap: don't add them together. + :type error_counts: IssueImpactErrorCounts + + :param id: User ID, from the ``usr.id`` attribute. + :type id: str + + :param name: User name or email, if available. + :type name: str, optional + + :param significant: Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + :type significant: bool + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.error_counts = error_counts + self_.id = id + self_.significant = significant diff --git a/src/datadog_api_client/v2/model/issue_impact_users.py b/src/datadog_api_client/v2/model/issue_impact_users.py new file mode 100644 index 0000000000..16469b54ec --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_users.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_user import IssueImpactUser + + +class IssueImpactUsers(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_user import IssueImpactUser + + return { + "distinct_count": (int,), + "top": ([IssueImpactUser],), + } + + attribute_map = { + "distinct_count": "distinct_count", + "top": "top", + } + + def __init__(self_, distinct_count: int, top: List[IssueImpactUser], **kwargs): + """ + Users affected by the issue. + + :param distinct_count: Number of distinct users affected by the issue in the time window. + :type distinct_count: int + + :param top: Up to five users with the most errors, most affected first. + :type top: [IssueImpactUser] + """ + super().__init__(kwargs) + + self_.distinct_count = distinct_count + self_.top = top diff --git a/src/datadog_api_client/v2/model/issue_impact_view.py b/src/datadog_api_client/v2/model/issue_impact_view.py new file mode 100644 index 0000000000..22a8d6f1fd --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_view.py @@ -0,0 +1,83 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_view_counts import IssueImpactViewCounts + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + +class IssueImpactView(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_view_counts import IssueImpactViewCounts + from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts + + return { + "affected": (IssueImpactViewCounts,), + "baseline": (IssueImpactViewCounts,), + "error_counts": (IssueImpactErrorCounts,), + "name": (str,), + "significant": (bool,), + } + + attribute_map = { + "affected": "affected", + "baseline": "baseline", + "error_counts": "error_counts", + "name": "name", + "significant": "significant", + } + + def __init__( + self_, + affected: IssueImpactViewCounts, + error_counts: IssueImpactErrorCounts, + name: str, + significant: bool, + baseline: Union[IssueImpactViewCounts, UnsetType] = unset, + **kwargs, + ): + """ + A RUM view where the issue occurred. + + :param affected: Distinct users, accounts, sessions, and view instances on a view. ``affected`` counts only those with the issue's + errors. ``baseline`` counts all users, accounts, sessions, and view instances on the view in the time window. It + is absent when RUM has no data for the view. + :type affected: IssueImpactViewCounts + + :param baseline: Distinct users, accounts, sessions, and view instances on a view. ``affected`` counts only those with the issue's + errors. ``baseline`` counts all users, accounts, sessions, and view instances on the view in the time window. It + is absent when RUM has no data for the view. + :type baseline: IssueImpactViewCounts, optional + + :param error_counts: Number of errors reported by each source. Several sources can report the same error, such as an APM span and + a log, so the counts overlap: don't add them together. + :type error_counts: IssueImpactErrorCounts + + :param name: View name. + :type name: str + + :param significant: Whether the entry stands out as a likely driver of the issue, because it accounts for most of the issue's + errors or for far more errors than the other listed entries. + :type significant: bool + """ + if baseline is not unset: + kwargs["baseline"] = baseline + super().__init__(kwargs) + + self_.affected = affected + self_.error_counts = error_counts + self_.name = name + self_.significant = significant diff --git a/src/datadog_api_client/v2/model/issue_impact_view_counts.py b/src/datadog_api_client/v2/model/issue_impact_view_counts.py new file mode 100644 index 0000000000..283d91a708 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_view_counts.py @@ -0,0 +1,53 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class IssueImpactViewCounts(ModelNormal): + @cached_property + def openapi_types(_): + return { + "accounts": (int,), + "sessions": (int,), + "users": (int,), + "views": (int,), + } + + attribute_map = { + "accounts": "accounts", + "sessions": "sessions", + "users": "users", + "views": "views", + } + + def __init__(self_, accounts: int, sessions: int, users: int, views: int, **kwargs): + """ + Distinct users, accounts, sessions, and view instances on a view. ``affected`` counts only those with the issue's + errors. ``baseline`` counts all users, accounts, sessions, and view instances on the view in the time window. It + is absent when RUM has no data for the view. + + :param accounts: Number of distinct accounts. + :type accounts: int + + :param sessions: Number of distinct sessions. + :type sessions: int + + :param users: Number of distinct users. + :type users: int + + :param views: Number of distinct view instances. + :type views: int + """ + super().__init__(kwargs) + + self_.accounts = accounts + self_.sessions = sessions + self_.users = users + self_.views = views diff --git a/src/datadog_api_client/v2/model/issue_impact_views.py b/src/datadog_api_client/v2/model/issue_impact_views.py new file mode 100644 index 0000000000..f8d52c08a9 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_impact_views.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_impact_view import IssueImpactView + + +class IssueImpactViews(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_impact_view import IssueImpactView + + return { + "distinct_count": (int,), + "top": ([IssueImpactView],), + } + + attribute_map = { + "distinct_count": "distinct_count", + "top": "top", + } + + def __init__(self_, distinct_count: int, top: List[IssueImpactView], **kwargs): + """ + RUM views where the issue occurred. + + :param distinct_count: Number of distinct view names where the issue occurred in the time window. + :type distinct_count: int + + :param top: Up to five views with the most errors, most affected first. + :type top: [IssueImpactView] + """ + super().__init__(kwargs) + + self_.distinct_count = distinct_count + self_.top = top diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 8153ee17ab..8b3adfdfbc 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -5922,6 +5922,22 @@ from datadog_api_client.v2.model.issue_case_relationship import IssueCaseRelationship from datadog_api_client.v2.model.issue_case_relationships import IssueCaseRelationships from datadog_api_client.v2.model.issue_case_resource_type import IssueCaseResourceType +from datadog_api_client.v2.model.issue_impact import IssueImpact +from datadog_api_client.v2.model.issue_impact_account import IssueImpactAccount +from datadog_api_client.v2.model.issue_impact_accounts import IssueImpactAccounts +from datadog_api_client.v2.model.issue_impact_attributes import IssueImpactAttributes +from datadog_api_client.v2.model.issue_impact_endpoint import IssueImpactEndpoint +from datadog_api_client.v2.model.issue_impact_endpoints import IssueImpactEndpoints +from datadog_api_client.v2.model.issue_impact_error_counts import IssueImpactErrorCounts +from datadog_api_client.v2.model.issue_impact_response import IssueImpactResponse +from datadog_api_client.v2.model.issue_impact_session import IssueImpactSession +from datadog_api_client.v2.model.issue_impact_sessions import IssueImpactSessions +from datadog_api_client.v2.model.issue_impact_type import IssueImpactType +from datadog_api_client.v2.model.issue_impact_user import IssueImpactUser +from datadog_api_client.v2.model.issue_impact_users import IssueImpactUsers +from datadog_api_client.v2.model.issue_impact_view import IssueImpactView +from datadog_api_client.v2.model.issue_impact_view_counts import IssueImpactViewCounts +from datadog_api_client.v2.model.issue_impact_views import IssueImpactViews from datadog_api_client.v2.model.issue_included import IssueIncluded from datadog_api_client.v2.model.issue_language import IssueLanguage from datadog_api_client.v2.model.issue_platform import IssuePlatform @@ -18136,6 +18152,22 @@ "IssueCaseRelationship", "IssueCaseRelationships", "IssueCaseResourceType", + "IssueImpact", + "IssueImpactAccount", + "IssueImpactAccounts", + "IssueImpactAttributes", + "IssueImpactEndpoint", + "IssueImpactEndpoints", + "IssueImpactErrorCounts", + "IssueImpactResponse", + "IssueImpactSession", + "IssueImpactSessions", + "IssueImpactType", + "IssueImpactUser", + "IssueImpactUsers", + "IssueImpactView", + "IssueImpactViewCounts", + "IssueImpactViews", "IssueIncluded", "IssueLanguage", "IssuePlatform", diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index 387a953725..4f0bdf135b 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -1428,13 +1428,6 @@ "scenario": "Create a Cost Monitor returns \"OK\" response", "version": "v1" }, - { - "feature": "Monitors", - "feature_file": "../../v1/features/monitors.feature", - "file": "v1/monitors/create-a-data-jobs-duration-monitor-returns-ok-response.json", - "scenario": "Create a Data Jobs duration monitor returns \"OK\" response", - "version": "v1" - }, { "feature": "Monitors", "feature_file": "../../v1/features/monitors.feature", @@ -1442,13 +1435,6 @@ "scenario": "Create a Data Jobs monitor returns \"OK\" response", "version": "v1" }, - { - "feature": "Monitors", - "feature_file": "../../v1/features/monitors.feature", - "file": "v1/monitors/create-a-data-jobs-monitor-with-the-aastra-query-dialect-returns-ok-response.json", - "scenario": "Create a Data Jobs monitor with the aastra query dialect returns \"OK\" response", - "version": "v1" - }, { "feature": "Monitors", "feature_file": "../../v1/features/monitors.feature", diff --git a/tests/generated-test/test-runner-data/v1/monitors/create-a-data-jobs-duration-monitor-returns-ok-response.json b/tests/generated-test/test-runner-data/v1/monitors/create-a-data-jobs-duration-monitor-returns-ok-response.json deleted file mode 100644 index 97b89686c1..0000000000 --- a/tests/generated-test/test-runner-data/v1/monitors/create-a-data-jobs-duration-monitor-returns-ok-response.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "api": "Monitors", - "expected_status": 200, - "feature": "Monitors", - "id": "v1/Monitors/Create a Data Jobs duration monitor returns \"OK\" response", - "operation_id": "CreateMonitor", - "request": { - "body": { - "schema": { - "format": null, - "ref": "Monitor", - "type": "object" - }, - "source": "inline", - "value": { - "message": "Data jobs duration alert triggered", - "name": "{{ unique }}", - "options": { - "variables": [ - { - "data_source": "data_quality_metrics", - "filter": "search for databricks_job", - "group_by": [ - "name", - "workspace_name", - "entity_id" - ], - "measure": "duration", - "monitor_options": { - "consecutive_runs": 2, - "detection_type": "anomaly" - }, - "name": "run_query", - "run_filter": "env:prod", - "schema_version": "0.0.1" - } - ] - }, - "query": "formula(\"job_duration(run_query)\").detection(anomaly).by(name,workspace_name,entity_id) > 0", - "tags": [ - "test:{{ unique_lower_alnum }}", - "env:ci" - ], - "type": "data-jobs alert" - } - }, - "content_type": "application/json", - "method": "POST", - "pagination": false, - "parameters": [], - "path": "/api/v1/monitor" - }, - "scenario": "Create a Data Jobs duration monitor returns \"OK\" response", - "schema_version": 1, - "version": "v1" -} diff --git a/tests/generated-test/test-runner-data/v1/monitors/create-a-data-jobs-monitor-with-the-aastra-query-dialect-returns-ok-response.json b/tests/generated-test/test-runner-data/v1/monitors/create-a-data-jobs-monitor-with-the-aastra-query-dialect-returns-ok-response.json deleted file mode 100644 index 9f662996b9..0000000000 --- a/tests/generated-test/test-runner-data/v1/monitors/create-a-data-jobs-monitor-with-the-aastra-query-dialect-returns-ok-response.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "api": "Monitors", - "expected_status": 200, - "feature": "Monitors", - "id": "v1/Monitors/Create a Data Jobs monitor with the aastra query dialect returns \"OK\" response", - "operation_id": "CreateMonitor", - "request": { - "body": { - "schema": { - "format": null, - "ref": "Monitor", - "type": "object" - }, - "source": "inline", - "value": { - "message": "Data jobs alert triggered", - "name": "{{ unique }}", - "options": { - "thresholds": { - "critical": 0 - }, - "variables": [ - { - "job_type": "databricks.job", - "jobs_query": "search for databricks_job", - "monitor_options": { - "alert_on_every_failure": true - }, - "name": "run_query", - "query_dialect": "aastra", - "run_filter": "env:prod" - } - ] - }, - "query": "formula(\"failed_runs(run_query)\").by(name,workspace_name,entity_id).last(1d) > 0", - "tags": [ - "test:{{ unique_lower_alnum }}", - "env:ci" - ], - "type": "data-jobs alert" - } - }, - "content_type": "application/json", - "method": "POST", - "pagination": false, - "parameters": [], - "path": "/api/v1/monitor" - }, - "scenario": "Create a Data Jobs monitor with the aastra query dialect returns \"OK\" response", - "schema_version": 1, - "version": "v1" -} diff --git a/tests/generated-test/test-server-data/v1/monitors.json b/tests/generated-test/test-server-data/v1/monitors.json index b1fd4a2ab7..1242fc1f2c 100644 --- a/tests/generated-test/test-server-data/v1/monitors.json +++ b/tests/generated-test/test-server-data/v1/monitors.json @@ -192,90 +192,6 @@ "scenario": "Create a Cost Monitor returns \"OK\" response", "version": "v1" }, - { - "feature": "Monitors", - "frozen_at": "2026-11-06T16:42:00.361Z", - "interactions": [ - { - "request": { - "body": { - "type": "json", - "value": { - "message": "Data jobs duration alert triggered", - "name": "Test-Create_a_Data_Jobs_duration_monitor_returns_OK_response-1793983320", - "options": { - "variables": [ - { - "data_source": "data_quality_metrics", - "filter": "search for databricks_job", - "group_by": [ - "name", - "workspace_name", - "entity_id" - ], - "measure": "duration", - "monitor_options": { - "consecutive_runs": 2, - "detection_type": "anomaly" - }, - "name": "run_query", - "run_filter": "env:prod", - "schema_version": "0.0.1" - } - ] - }, - "query": "formula(\"job_duration(run_query)\").detection(anomaly).by(name,workspace_name,entity_id) > 0", - "tags": [ - "test:testcreateadatajobsdurationmonitorreturnsokresponse1793983320", - "env:ci" - ], - "type": "data-jobs alert" - } - }, - "content_type": "application/json", - "method": "POST", - "path": "/api/v1/monitor", - "query": [] - }, - "response": { - "body": { - "encoding": "text", - "value": "{\"id\":341751249,\"org_id\":321813,\"type\":\"data-jobs alert\",\"name\":\"Test-Create_a_Data_Jobs_duration_monitor_returns_OK_response-1793983320\",\"message\":\"Data jobs duration alert triggered\",\"tags\":[\"test:testcreateadatajobsdurationmonitorreturnsokresponse1793983320\",\"env:ci\"],\"query\":\"formula(\\\"job_duration(run_query)\\\").detection(anomaly).by(name,workspace_name,entity_id) > 0\",\"options\":{\"variables\":[{\"data_source\":\"data_quality_metrics\",\"filter\":\"search for databricks_job\",\"group_by\":[\"name\",\"workspace_name\",\"entity_id\"],\"measure\":\"duration\",\"monitor_options\":{\"consecutive_runs\":2,\"detection_type\":\"anomaly\"},\"name\":\"run_query\",\"run_filter\":\"env:prod\",\"schema_version\":\"0.0.1\"}],\"notify_no_data\":false,\"notify_audit\":false,\"new_host_delay\":300,\"include_tags\":true,\"silenced\":{}},\"multi\":true,\"created_at\":1793983320000,\"created\":\"2026-11-06T16:42:00.590725+00:00\",\"modified\":\"2026-11-06T16:42:00.590725+00:00\",\"deleted\":null,\"priority\":null,\"restricted_roles\":null,\"restriction_policy\":null,\"draft_status\":\"published\",\"assets\":[],\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":\"C\\u00e9dric Van Rompay\",\"handle\":\"cedric.vanrompay@datadoghq.com\",\"email\":\"cedric.vanrompay@datadoghq.com\",\"id\":68397867}}\n" - }, - "headers": { - "content-type": "application/json" - }, - "reason": "OK", - "status": 200 - } - }, - { - "request": { - "body": { - "type": "empty", - "value": null - }, - "content_type": "", - "method": "DELETE", - "path": "/api/v1/monitor/341751249", - "query": [] - }, - "response": { - "body": { - "encoding": "text", - "value": "{\"deleted_monitor_id\":341751249}\n" - }, - "headers": { - "content-type": "application/json" - }, - "reason": "OK", - "status": 200 - } - } - ], - "scenario": "Create a Data Jobs duration monitor returns \"OK\" response", - "version": "v1" - }, { "feature": "Monitors", "frozen_at": "2026-05-14T10:58:54.153Z", @@ -352,86 +268,6 @@ "scenario": "Create a Data Jobs monitor returns \"OK\" response", "version": "v1" }, - { - "feature": "Monitors", - "frozen_at": "2026-11-06T16:42:01.032Z", - "interactions": [ - { - "request": { - "body": { - "type": "json", - "value": { - "message": "Data jobs alert triggered", - "name": "Test-Create_a_Data_Jobs_monitor_with_the_aastra_query_dialect_returns_OK_response-1793983321", - "options": { - "thresholds": { - "critical": 0 - }, - "variables": [ - { - "job_type": "databricks.job", - "jobs_query": "search for databricks_job", - "monitor_options": { - "alert_on_every_failure": true - }, - "name": "run_query", - "query_dialect": "aastra", - "run_filter": "env:prod" - } - ] - }, - "query": "formula(\"failed_runs(run_query)\").by(name,workspace_name,entity_id).last(1d) > 0", - "tags": [ - "test:testcreateadatajobsmonitorwiththeaastraquerydialectreturnsokresponse1793983321", - "env:ci" - ], - "type": "data-jobs alert" - } - }, - "content_type": "application/json", - "method": "POST", - "path": "/api/v1/monitor", - "query": [] - }, - "response": { - "body": { - "encoding": "text", - "value": "{\"id\":341751253,\"org_id\":321813,\"type\":\"data-jobs alert\",\"name\":\"Test-Create_a_Data_Jobs_monitor_with_the_aastra_query_dialect_returns_OK_response-1793983321\",\"message\":\"Data jobs alert triggered\",\"tags\":[\"test:testcreateadatajobsmonitorwiththeaastraquerydialectreturnsokresponse1793983321\",\"env:ci\"],\"query\":\"formula(\\\"failed_runs(run_query)\\\").by(name,workspace_name,entity_id).last(1d) > 0\",\"options\":{\"thresholds\":{\"critical\":0.0},\"variables\":[{\"job_type\":\"databricks.job\",\"jobs_query\":\"search for databricks_job\",\"monitor_options\":{\"alert_on_every_failure\":true},\"name\":\"run_query\",\"query_dialect\":\"aastra\",\"run_filter\":\"env:prod\"}],\"notify_no_data\":false,\"notify_audit\":false,\"new_host_delay\":300,\"include_tags\":true,\"silenced\":{}},\"multi\":true,\"created_at\":1793983321000,\"created\":\"2026-11-06T16:42:01.177378+00:00\",\"modified\":\"2026-11-06T16:42:01.177378+00:00\",\"deleted\":null,\"priority\":null,\"restricted_roles\":null,\"restriction_policy\":null,\"draft_status\":\"published\",\"assets\":[],\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":\"C\\u00e9dric Van Rompay\",\"handle\":\"cedric.vanrompay@datadoghq.com\",\"email\":\"cedric.vanrompay@datadoghq.com\",\"id\":68397867}}\n" - }, - "headers": { - "content-type": "application/json" - }, - "reason": "OK", - "status": 200 - } - }, - { - "request": { - "body": { - "type": "empty", - "value": null - }, - "content_type": "", - "method": "DELETE", - "path": "/api/v1/monitor/341751253", - "query": [] - }, - "response": { - "body": { - "encoding": "text", - "value": "{\"deleted_monitor_id\":341751253}\n" - }, - "headers": { - "content-type": "application/json" - }, - "reason": "OK", - "status": 200 - } - } - ], - "scenario": "Create a Data Jobs monitor with the aastra query dialect returns \"OK\" response", - "version": "v1" - }, { "feature": "Monitors", "frozen_at": "2026-01-12T17:23:49.629Z", diff --git a/tests/v1/features/monitors.feature b/tests/v1/features/monitors.feature index ef8d3d387b..5584472ab2 100644 --- a/tests/v1/features/monitors.feature +++ b/tests/v1/features/monitors.feature @@ -42,18 +42,6 @@ Feature: Monitors When the request is sent Then the response status is 200 OK - @team:ddoghq/monitor-app - Scenario: Create a Data Jobs duration monitor returns "OK" response - Given new "CreateMonitor" request - And body with value {"name": "{{ unique }}", "type": "data-jobs alert", "query": "formula(\"job_duration(run_query)\").detection(anomaly).by(name,workspace_name,entity_id) > 0", "message": "Data jobs duration alert triggered", "tags": ["test:{{ unique_lower_alnum }}", "env:ci"], "options": {"variables": [{"name": "run_query", "data_source": "data_quality_metrics", "schema_version": "0.0.1", "measure": "duration", "filter": "search for databricks_job", "run_filter": "env:prod", "group_by": ["name", "workspace_name", "entity_id"], "monitor_options": {"detection_type": "anomaly", "consecutive_runs": 2}}]}} - When the request is sent - Then the response status is 200 OK - And the response "name" is equal to "{{ unique }}" - And the response "type" is equal to "data-jobs alert" - And the response "options.variables[0].run_filter" is equal to "env:prod" - And the response "options.variables[0].monitor_options.detection_type" is equal to "anomaly" - And the response "options.variables[0].monitor_options.consecutive_runs" is equal to 2 - @team:ddoghq/monitor-app Scenario: Create a Data Jobs monitor returns "OK" response Given new "CreateMonitor" request @@ -63,18 +51,6 @@ Feature: Monitors And the response "name" is equal to "{{ unique }}" And the response "type" is equal to "data-jobs alert" - @team:ddoghq/monitor-app - Scenario: Create a Data Jobs monitor with the aastra query dialect returns "OK" response - Given new "CreateMonitor" request - And body with value {"name": "{{ unique }}", "type": "data-jobs alert", "query": "formula(\"failed_runs(run_query)\").by(name,workspace_name,entity_id).last(1d) > 0", "message": "Data jobs alert triggered", "tags": ["test:{{ unique_lower_alnum }}", "env:ci"], "options": {"thresholds": {"critical": 0}, "variables": [{"name": "run_query", "jobs_query": "search for databricks_job", "job_type": "databricks.job", "query_dialect": "aastra", "run_filter": "env:prod", "monitor_options": {"alert_on_every_failure": true}}]}} - When the request is sent - Then the response status is 200 OK - And the response "name" is equal to "{{ unique }}" - And the response "type" is equal to "data-jobs alert" - And the response "options.variables[0].query_dialect" is equal to "aastra" - And the response "options.variables[0].run_filter" is equal to "env:prod" - And the response "options.variables[0].monitor_options.alert_on_every_failure" is equal to true - @team:ddoghq/monitor-app Scenario: Create a Data Quality monitor returns "OK" response Given new "CreateMonitor" request diff --git a/tests/v2/features/error_tracking.feature b/tests/v2/features/error_tracking.feature index 0245544462..468c9b4d8e 100644 --- a/tests/v2/features/error_tracking.feature +++ b/tests/v2/features/error_tracking.feature @@ -53,6 +53,41 @@ Feature: Error Tracking And the response "data.id" is equal to "{{ issue.id }}" And the response "data.relationships" has field "samples" + @skip @team:ddoghq/error-tracking + Scenario: Get the impact of an error tracking issue returns "Bad Request" response + Given operation "GetIssueImpact" enabled + And new "GetIssueImpact" request + And there is a valid "issue" in the system + And request contains "issue_id" parameter from "issue.id" + And request contains "filter[from]" parameter with value {{ timestamp("now") }}000 + And request contains "filter[to]" parameter with value {{ timestamp("now - 15d") }}000 + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:ddoghq/error-tracking + Scenario: Get the impact of an error tracking issue returns "Not Found" response + Given operation "GetIssueImpact" enabled + And new "GetIssueImpact" request + And request contains "issue_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And request contains "filter[from]" parameter with value {{ timestamp("now - 15d") }}000 + And request contains "filter[to]" parameter with value {{ timestamp("now") }}000 + When the request is sent + Then the response status is 404 Not Found + + @replay-only @skip @team:ddoghq/error-tracking + Scenario: Get the impact of an error tracking issue returns "OK" response + Given operation "GetIssueImpact" enabled + And new "GetIssueImpact" request + And there is a valid "issue" in the system + And request contains "issue_id" parameter from "issue.id" + And request contains "filter[from]" parameter with value {{ timestamp("now - 15d") }}000 + And request contains "filter[to]" parameter with value {{ timestamp("now") }}000 + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{ issue.id }}" + And the response "data.type" is equal to "error_tracking_issue_impact" + And the response "data.attributes" has field "error_counts" + @generated @skip @team:ddoghq/error-tracking Scenario: Remove the assignee of an issue returns "Bad Request" response Given new "DeleteIssueAssignee" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index fb7afa5fc4..735b21bfcc 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2783,6 +2783,12 @@ "type": "idempotent" } }, + "GetIssueImpact": { + "tag": "Error Tracking", + "undo": { + "type": "safe" + } + }, "UpdateIssueState": { "tag": "Error Tracking", "undo": {