You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/prometheus.go
+12-5Lines changed: 12 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,11 @@ type ListPrometheusMetricMetadataParams struct {
32
32
Limitint`json:"limit" jsonschema:"default=10,description=The maximum number of metrics to return"`
33
33
LimitPerMetricint`json:"limitPerMetric" jsonschema:"description=The maximum number of metrics to return per metric"`
34
34
Metricstring`json:"metric" jsonschema:"description=The metric to query"`
35
+
ProjectNamestring`json:"projectName,omitempty" jsonschema:"description=GCP project name to query (Cloud Monitoring datasources only). Overrides or substitutes the defaultProject configured on the datasource."`
@@ -68,6 +69,7 @@ type QueryPrometheusParams struct {
68
69
EndTimestring`json:"endTime" jsonschema:"required,description=The end time. Supported formats are RFC3339 or relative to now (e.g. 'now'\\, 'now-1.5h'\\, 'now-2h45m'). Valid time units are 'ns'\\, 'us' (or 'µs')\\, 'ms'\\, 's'\\, 'm'\\, 'h'\\, 'd'."`
69
70
StepSecondsint`json:"stepSeconds,omitempty" jsonschema:"description=The time series step size in seconds. Required if queryType is 'range'\\, ignored if queryType is 'instant'"`
70
71
QueryTypestring`json:"queryType,omitempty" jsonschema:"description=The type of query to use. Either 'range' or 'instant'"`
72
+
ProjectNamestring`json:"projectName,omitempty" jsonschema:"description=GCP project name to query (Cloud Monitoring datasources only). Overrides or substitutes the defaultProject configured on the datasource."`
71
73
}
72
74
73
75
// QueryPrometheusResult wraps the Prometheus query result with optional hints
@@ -178,10 +180,11 @@ type ListPrometheusMetricNamesParams struct {
178
180
Regexstring`json:"regex" jsonschema:"description=The regex to match against the metric names"`
179
181
Limitint`json:"limit,omitempty" jsonschema:"default=10,description=The maximum number of results to return"`
180
182
Pageint`json:"page,omitempty" jsonschema:"default=1,description=The page number to return"`
183
+
ProjectNamestring`json:"projectName,omitempty" jsonschema:"description=GCP project name to query (Cloud Monitoring datasources only). Overrides or substitutes the defaultProject configured on the datasource."`
@@ -294,10 +297,11 @@ type ListPrometheusLabelNamesParams struct {
294
297
StartRFC3339string`json:"startRfc3339,omitempty" jsonschema:"description=Optionally\\, the start time of the time range to filter the results by"`
295
298
EndRFC3339string`json:"endRfc3339,omitempty" jsonschema:"description=Optionally\\, the end time of the time range to filter the results by"`
296
299
Limitint`json:"limit,omitempty" jsonschema:"default=100,description=Optionally\\, the maximum number of results to return"`
300
+
ProjectNamestring`json:"projectName,omitempty" jsonschema:"description=GCP project name to query (Cloud Monitoring datasources only). Overrides or substitutes the defaultProject configured on the datasource."`
@@ -353,10 +357,11 @@ type ListPrometheusLabelValuesParams struct {
353
357
StartRFC3339string`json:"startRfc3339,omitempty" jsonschema:"description=Optionally\\, the start time of the query"`
354
358
EndRFC3339string`json:"endRfc3339,omitempty" jsonschema:"description=Optionally\\, the end time of the query"`
355
359
Limitint`json:"limit,omitempty" jsonschema:"default=100,description=Optionally\\, the maximum number of results to return"`
360
+
ProjectNamestring`json:"projectName,omitempty" jsonschema:"description=GCP project name to query (Cloud Monitoring datasources only). Overrides or substitutes the defaultProject configured on the datasource."`
@@ -422,6 +427,7 @@ type QueryPrometheusHistogramParams struct {
422
427
StartTimestring`json:"startTime,omitempty" jsonschema:"description=Start time (default: now-1h). Supports RFC3339\\, relative (now-1h)\\, or Unix ms."`
423
428
EndTimestring`json:"endTime,omitempty" jsonschema:"description=End time (default: now). Supports RFC3339\\, relative\\, or Unix ms."`
424
429
StepSecondsint`json:"stepSeconds,omitempty" jsonschema:"description=Step size in seconds for range query (default: 60)"`
430
+
ProjectNamestring`json:"projectName,omitempty" jsonschema:"description=GCP project name to query (Cloud Monitoring datasources only). Overrides or substitutes the defaultProject configured on the datasource."`
425
431
}
426
432
427
433
// queryPrometheusHistogram generates and executes a histogram percentile query
0 commit comments