Skip to content

Commit 3f3956a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add apm_metrics query support to dashboard OpenAPI spec (#3832)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 5db0eb9 commit 3f3956a

10 files changed

Lines changed: 1000 additions & 0 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2709,6 +2709,123 @@ components:
27092709
- service
27102710
- name
27112711
type: object
2712+
FormulaAndFunctionApmMetricStatName:
2713+
description: APM metric stat name.
2714+
enum:
2715+
- errors
2716+
- error_rate
2717+
- errors_per_second
2718+
- latency_avg
2719+
- latency_max
2720+
- latency_p50
2721+
- latency_p75
2722+
- latency_p90
2723+
- latency_p95
2724+
- latency_p99
2725+
- latency_p999
2726+
- latency_distribution
2727+
- hits
2728+
- hits_per_second
2729+
- total_time
2730+
- apdex
2731+
example: "hits"
2732+
type: string
2733+
x-enum-varnames:
2734+
- ERRORS
2735+
- ERROR_RATE
2736+
- ERRORS_PER_SECOND
2737+
- LATENCY_AVG
2738+
- LATENCY_MAX
2739+
- LATENCY_P50
2740+
- LATENCY_P75
2741+
- LATENCY_P90
2742+
- LATENCY_P95
2743+
- LATENCY_P99
2744+
- LATENCY_P999
2745+
- LATENCY_DISTRIBUTION
2746+
- HITS
2747+
- HITS_PER_SECOND
2748+
- TOTAL_TIME
2749+
- APDEX
2750+
FormulaAndFunctionApmMetricsDataSource:
2751+
description: Data source for APM metrics queries.
2752+
enum:
2753+
- apm_metrics
2754+
example: apm_metrics
2755+
type: string
2756+
x-enum-varnames:
2757+
- APM_METRICS
2758+
FormulaAndFunctionApmMetricsQueryDefinition:
2759+
description: A formula and functions APM metrics query.
2760+
properties:
2761+
data_source:
2762+
$ref: "#/components/schemas/FormulaAndFunctionApmMetricsDataSource"
2763+
group_by:
2764+
description: Optional fields to group the query results by.
2765+
items:
2766+
description: A field to group results by.
2767+
example: "resource_name"
2768+
type: string
2769+
type: array
2770+
name:
2771+
description: Name of this query to use in formulas.
2772+
example: "query_errors"
2773+
type: string
2774+
operation_mode:
2775+
description: Optional operation mode to aggregate across operation names.
2776+
example: "primary"
2777+
type: string
2778+
operation_name:
2779+
description: Name of operation on service. If not provided, the primary operation name is used.
2780+
example: "web.request"
2781+
type: string
2782+
peer_tags:
2783+
description: Tags to query for a specific downstream entity (peer.service, peer.db_instance, peer.s3, peer.s3.bucket, etc.).
2784+
items:
2785+
example: "peer.service:my-service"
2786+
type: string
2787+
type: array
2788+
query_filter:
2789+
description: Additional filters for the query using metrics query syntax (e.g., env, primary_tag).
2790+
example: "env:prod"
2791+
type: string
2792+
resource_hash:
2793+
description: The hash of a specific resource to filter by.
2794+
example: "abc123"
2795+
type: string
2796+
resource_name:
2797+
description: The full name of a specific resource to filter by.
2798+
example: "GET /api/v1/users"
2799+
type: string
2800+
service:
2801+
description: APM service name.
2802+
example: "web-store"
2803+
type: string
2804+
span_kind:
2805+
$ref: "#/components/schemas/FormulaAndFunctionApmMetricsSpanKind"
2806+
stat:
2807+
$ref: "#/components/schemas/FormulaAndFunctionApmMetricStatName"
2808+
required:
2809+
- data_source
2810+
- name
2811+
- stat
2812+
type: object
2813+
FormulaAndFunctionApmMetricsSpanKind:
2814+
description: Describes the relationship between the span, its parents, and its children in a trace.
2815+
enum:
2816+
- consumer
2817+
- server
2818+
- client
2819+
- producer
2820+
- internal
2821+
example: "server"
2822+
type: string
2823+
x-enum-varnames:
2824+
- CONSUMER
2825+
- SERVER
2826+
- CLIENT
2827+
- PRODUCER
2828+
- INTERNAL
27122829
FormulaAndFunctionApmResourceStatName:
27132830
description: APM resource stat name.
27142831
enum:
@@ -3138,6 +3255,7 @@ components:
31383255
- $ref: "#/components/schemas/FormulaAndFunctionProcessQueryDefinition"
31393256
- $ref: "#/components/schemas/FormulaAndFunctionApmDependencyStatsQueryDefinition"
31403257
- $ref: "#/components/schemas/FormulaAndFunctionApmResourceStatsQueryDefinition"
3258+
- $ref: "#/components/schemas/FormulaAndFunctionApmMetricsQueryDefinition"
31413259
- $ref: "#/components/schemas/FormulaAndFunctionSLOQueryDefinition"
31423260
- $ref: "#/components/schemas/FormulaAndFunctionCloudCostQueryDefinition"
31433261
FormulaAndFunctionResponseFormat:
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV1
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// FormulaAndFunctionApmMetricStatName APM metric stat name.
14+
type FormulaAndFunctionApmMetricStatName string
15+
16+
// List of FormulaAndFunctionApmMetricStatName.
17+
const (
18+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_ERRORS FormulaAndFunctionApmMetricStatName = "errors"
19+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_ERROR_RATE FormulaAndFunctionApmMetricStatName = "error_rate"
20+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_ERRORS_PER_SECOND FormulaAndFunctionApmMetricStatName = "errors_per_second"
21+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_AVG FormulaAndFunctionApmMetricStatName = "latency_avg"
22+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_MAX FormulaAndFunctionApmMetricStatName = "latency_max"
23+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P50 FormulaAndFunctionApmMetricStatName = "latency_p50"
24+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P75 FormulaAndFunctionApmMetricStatName = "latency_p75"
25+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P90 FormulaAndFunctionApmMetricStatName = "latency_p90"
26+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P95 FormulaAndFunctionApmMetricStatName = "latency_p95"
27+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P99 FormulaAndFunctionApmMetricStatName = "latency_p99"
28+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P999 FormulaAndFunctionApmMetricStatName = "latency_p999"
29+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_DISTRIBUTION FormulaAndFunctionApmMetricStatName = "latency_distribution"
30+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_HITS FormulaAndFunctionApmMetricStatName = "hits"
31+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_HITS_PER_SECOND FormulaAndFunctionApmMetricStatName = "hits_per_second"
32+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_TOTAL_TIME FormulaAndFunctionApmMetricStatName = "total_time"
33+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_APDEX FormulaAndFunctionApmMetricStatName = "apdex"
34+
)
35+
36+
var allowedFormulaAndFunctionApmMetricStatNameEnumValues = []FormulaAndFunctionApmMetricStatName{
37+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_ERRORS,
38+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_ERROR_RATE,
39+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_ERRORS_PER_SECOND,
40+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_AVG,
41+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_MAX,
42+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P50,
43+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P75,
44+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P90,
45+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P95,
46+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P99,
47+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_P999,
48+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_LATENCY_DISTRIBUTION,
49+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_HITS,
50+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_HITS_PER_SECOND,
51+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_TOTAL_TIME,
52+
FORMULAANDFUNCTIONAPMMETRICSTATNAME_APDEX,
53+
}
54+
55+
// GetAllowedValues reeturns the list of possible values.
56+
func (v *FormulaAndFunctionApmMetricStatName) GetAllowedValues() []FormulaAndFunctionApmMetricStatName {
57+
return allowedFormulaAndFunctionApmMetricStatNameEnumValues
58+
}
59+
60+
// UnmarshalJSON deserializes the given payload.
61+
func (v *FormulaAndFunctionApmMetricStatName) UnmarshalJSON(src []byte) error {
62+
var value string
63+
err := datadog.Unmarshal(src, &value)
64+
if err != nil {
65+
return err
66+
}
67+
*v = FormulaAndFunctionApmMetricStatName(value)
68+
return nil
69+
}
70+
71+
// NewFormulaAndFunctionApmMetricStatNameFromValue returns a pointer to a valid FormulaAndFunctionApmMetricStatName
72+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
73+
func NewFormulaAndFunctionApmMetricStatNameFromValue(v string) (*FormulaAndFunctionApmMetricStatName, error) {
74+
ev := FormulaAndFunctionApmMetricStatName(v)
75+
if ev.IsValid() {
76+
return &ev, nil
77+
}
78+
return nil, fmt.Errorf("invalid value '%v' for FormulaAndFunctionApmMetricStatName: valid values are %v", v, allowedFormulaAndFunctionApmMetricStatNameEnumValues)
79+
}
80+
81+
// IsValid return true if the value is valid for the enum, false otherwise.
82+
func (v FormulaAndFunctionApmMetricStatName) IsValid() bool {
83+
for _, existing := range allowedFormulaAndFunctionApmMetricStatNameEnumValues {
84+
if existing == v {
85+
return true
86+
}
87+
}
88+
return false
89+
}
90+
91+
// Ptr returns reference to FormulaAndFunctionApmMetricStatName value.
92+
func (v FormulaAndFunctionApmMetricStatName) Ptr() *FormulaAndFunctionApmMetricStatName {
93+
return &v
94+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV1
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// FormulaAndFunctionApmMetricsDataSource Data source for APM metrics queries.
14+
type FormulaAndFunctionApmMetricsDataSource string
15+
16+
// List of FormulaAndFunctionApmMetricsDataSource.
17+
const (
18+
FORMULAANDFUNCTIONAPMMETRICSDATASOURCE_APM_METRICS FormulaAndFunctionApmMetricsDataSource = "apm_metrics"
19+
)
20+
21+
var allowedFormulaAndFunctionApmMetricsDataSourceEnumValues = []FormulaAndFunctionApmMetricsDataSource{
22+
FORMULAANDFUNCTIONAPMMETRICSDATASOURCE_APM_METRICS,
23+
}
24+
25+
// GetAllowedValues reeturns the list of possible values.
26+
func (v *FormulaAndFunctionApmMetricsDataSource) GetAllowedValues() []FormulaAndFunctionApmMetricsDataSource {
27+
return allowedFormulaAndFunctionApmMetricsDataSourceEnumValues
28+
}
29+
30+
// UnmarshalJSON deserializes the given payload.
31+
func (v *FormulaAndFunctionApmMetricsDataSource) UnmarshalJSON(src []byte) error {
32+
var value string
33+
err := datadog.Unmarshal(src, &value)
34+
if err != nil {
35+
return err
36+
}
37+
*v = FormulaAndFunctionApmMetricsDataSource(value)
38+
return nil
39+
}
40+
41+
// NewFormulaAndFunctionApmMetricsDataSourceFromValue returns a pointer to a valid FormulaAndFunctionApmMetricsDataSource
42+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
43+
func NewFormulaAndFunctionApmMetricsDataSourceFromValue(v string) (*FormulaAndFunctionApmMetricsDataSource, error) {
44+
ev := FormulaAndFunctionApmMetricsDataSource(v)
45+
if ev.IsValid() {
46+
return &ev, nil
47+
}
48+
return nil, fmt.Errorf("invalid value '%v' for FormulaAndFunctionApmMetricsDataSource: valid values are %v", v, allowedFormulaAndFunctionApmMetricsDataSourceEnumValues)
49+
}
50+
51+
// IsValid return true if the value is valid for the enum, false otherwise.
52+
func (v FormulaAndFunctionApmMetricsDataSource) IsValid() bool {
53+
for _, existing := range allowedFormulaAndFunctionApmMetricsDataSourceEnumValues {
54+
if existing == v {
55+
return true
56+
}
57+
}
58+
return false
59+
}
60+
61+
// Ptr returns reference to FormulaAndFunctionApmMetricsDataSource value.
62+
func (v FormulaAndFunctionApmMetricsDataSource) Ptr() *FormulaAndFunctionApmMetricsDataSource {
63+
return &v
64+
}

0 commit comments

Comments
 (0)