> For the complete documentation index, see [llms.txt](https://docs.ilert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ilert.com/developer-docs/rest-api/api-reference/metrics.md).

# Metrics

## GET /metrics

> Get metrics.

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"v2.2026.9-r.4"},"tags":[{"name":"Metrics"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}},"schemas":{"MetricList":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"aggregationType":{"$ref":"#/components/schemas/MetricAggregationType"},"displayType":{"$ref":"#/components/schemas/MetricDisplayType"},"interpolateGaps":{"type":"boolean","default":false},"lockYAxisMax":{"type":"number","format":"double"},"lockYAxisMin":{"type":"number","format":"double"},"mouseOverDecimal":{"maximum":6,"minimum":0,"type":"number","format":"int32"},"showValuesOnMouseOver":{"type":"boolean","default":false},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"unitLabel":{"type":"string"},"integrationKey":{"type":"string"},"dataSource":{"$ref":"#/components/schemas/MetricDataSourceNoIncludes"},"managedBy":{"$ref":"#/components/schemas/ManagedBy"}}},"MetricAggregationType":{"type":"string","enum":["AVG","SUM","MIN","MAX","LAST"]},"MetricDisplayType":{"type":"string","enum":["GRAPH","SINGLE"]},"TeamRel":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"MetricDataSourceNoIncludes":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/MetricDataSourceType"},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"managedBy":{"$ref":"#/components/schemas/ManagedBy"}}},"MetricDataSourceType":{"type":"string","enum":["DATADOG","PROMETHEUS"]},"ManagedBy":{"type":"object","readOnly":true,"description":"Present when this entity is managed outside of the ilert web app, for example through Terraform, Pulumi or the API. Read-only.","properties":{"type":{"type":"string","enum":["API","TERRAFORM","PULUMI","ILERT"]},"source":{"type":"string","description":"Identifier of the system managing this entity."}}}}},"paths":{"/metrics":{"get":{"tags":["Metrics"],"summary":"Get metrics.","parameters":[{"name":"start-index","in":"query","description":"an integer specifying the starting point (beginning with 0) when paging through a list of entities","schema":{"type":"integer","format":"int32","default":0}},{"name":"max-results","in":"query","description":"the maximum number of results when paging through a list of metrics. (Note: when using ?include maximum is reduced to 25)","schema":{"maximum":100,"type":"integer","format":"int32","default":10}},{"name":"include","in":"query","description":"Describes optional properties that should be included in the response. You may declare multiple. (dataSource, integrationKey, status)","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string","enum":["dataSource","integrationKey","status"]}}}],"responses":{"200":{"description":"The metrics","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MetricList"}}}}}}}}}}
```

## POST /metrics

> Create a new metric.

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"v2.2026.9-r.4"},"tags":[{"name":"Metrics"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}},"schemas":{"MetricPost":{"required":["aggregationType","displayType","name"],"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"aggregationType":{"$ref":"#/components/schemas/MetricAggregationType"},"displayType":{"$ref":"#/components/schemas/MetricDisplayType"},"interpolateGaps":{"type":"boolean","default":false},"lockYAxisMax":{"type":"number","format":"double"},"lockYAxisMin":{"type":"number","format":"double"},"mouseOverDecimal":{"maximum":6,"minimum":0,"type":"number","format":"int32"},"showValuesOnMouseOver":{"type":"boolean","default":false},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"unitLabel":{"type":"string"},"metadata":{"$ref":"#/components/schemas/MetricMetadata"},"dataSource":{"type":"object","properties":{"id":{"type":"number","description":"dataSource is required when providing metadata"}}}}},"MetricAggregationType":{"type":"string","enum":["AVG","SUM","MIN","MAX","LAST"]},"MetricDisplayType":{"type":"string","enum":["GRAPH","SINGLE"]},"TeamRel":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"MetricMetadata":{"type":"object","description":"Only required if the metric has a dataSource. You may not change this after creation.","default":"null","oneOf":[{"$ref":"#/components/schemas/MDataDogMetadata"},{"$ref":"#/components/schemas/MPrometheusMetadata"}]},"MDataDogMetadata":{"required":["query"],"type":"object","properties":{"query":{"type":"string"}}},"MPrometheusMetadata":{"required":["query"],"type":"object","properties":{"query":{"type":"string"}}},"Metric":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"aggregationType":{"$ref":"#/components/schemas/MetricAggregationType"},"displayType":{"$ref":"#/components/schemas/MetricDisplayType"},"interpolateGaps":{"type":"boolean","default":false},"lockYAxisMax":{"type":"number","format":"double"},"lockYAxisMin":{"type":"number","format":"double"},"mouseOverDecimal":{"maximum":6,"minimum":0,"type":"number","format":"int32"},"showValuesOnMouseOver":{"type":"boolean","default":false},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"unitLabel":{"type":"string"},"integrationKey":{"type":"string"},"metadata":{"$ref":"#/components/schemas/MetricMetadata"},"dataSource":{"$ref":"#/components/schemas/MetricDataSource"},"managedBy":{"$ref":"#/components/schemas/ManagedBy"},"status":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["NONE","OK","IMPORT_REQUEST","IMPORT","ERROR"],"readOnly":true},"lastStatusTransition":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"lastIngestion":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"importStatus":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["NONE","PENDING","ERROR","FINISHED"],"readOnly":true},"lastError":{"type":"string","description":"This is an include field, it is not available in the list resource","readOnly":true}}},"MetricDataSource":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/MetricDataSourceType"},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"metadata":{"$ref":"#/components/schemas/MetricDataSourceMetadata"},"managedBy":{"$ref":"#/components/schemas/ManagedBy"},"status":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["OK","ERROR"],"readOnly":true},"lastStatusTransition":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"lastError":{"type":"string","description":"This is an include field, it is not available in the list resource","readOnly":true}}},"MetricDataSourceType":{"type":"string","enum":["DATADOG","PROMETHEUS"]},"MetricDataSourceMetadata":{"type":"object","oneOf":[{"$ref":"#/components/schemas/MParamsDatadog"},{"$ref":"#/components/schemas/MParamsPrometheus"}]},"MParamsDatadog":{"required":["apiKey","applicationKey","region"],"type":"object","properties":{"region":{"type":"string"},"apiKey":{"type":"string"},"applicationKey":{"type":"string"}}},"MParamsPrometheus":{"required":["authType","url"],"type":"object","properties":{"url":{"type":"string"},"authType":{"type":"string","enum":["NONE","BASIC","HEADER"]},"basicUser":{"type":"string","description":"Optional, required for 'BASIC'"},"basicPass":{"type":"string","description":"Optional, required for 'BASIC'"},"headerKey":{"type":"string","description":"Optional, required for 'HEADER'"},"headerValue":{"type":"string","description":"Optional, required for 'HEADER'"}}},"ManagedBy":{"type":"object","readOnly":true,"description":"Present when this entity is managed outside of the ilert web app, for example through Terraform, Pulumi or the API. Read-only.","properties":{"type":{"type":"string","enum":["API","TERRAFORM","PULUMI","ILERT"]},"source":{"type":"string","description":"Identifier of the system managing this entity."}}}}},"paths":{"/metrics":{"post":{"tags":["Metrics"],"summary":"Create a new metric.","requestBody":{"description":"The metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricPost"}}},"required":true},"responses":{"200":{"description":"The newly created metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}}}}}}}
```

## GET /metrics/{id}

> Get a specific Metric

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"v2.2026.9-r.4"},"tags":[{"name":"Metrics"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}},"schemas":{"Metric":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"aggregationType":{"$ref":"#/components/schemas/MetricAggregationType"},"displayType":{"$ref":"#/components/schemas/MetricDisplayType"},"interpolateGaps":{"type":"boolean","default":false},"lockYAxisMax":{"type":"number","format":"double"},"lockYAxisMin":{"type":"number","format":"double"},"mouseOverDecimal":{"maximum":6,"minimum":0,"type":"number","format":"int32"},"showValuesOnMouseOver":{"type":"boolean","default":false},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"unitLabel":{"type":"string"},"integrationKey":{"type":"string"},"metadata":{"$ref":"#/components/schemas/MetricMetadata"},"dataSource":{"$ref":"#/components/schemas/MetricDataSource"},"managedBy":{"$ref":"#/components/schemas/ManagedBy"},"status":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["NONE","OK","IMPORT_REQUEST","IMPORT","ERROR"],"readOnly":true},"lastStatusTransition":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"lastIngestion":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"importStatus":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["NONE","PENDING","ERROR","FINISHED"],"readOnly":true},"lastError":{"type":"string","description":"This is an include field, it is not available in the list resource","readOnly":true}}},"MetricAggregationType":{"type":"string","enum":["AVG","SUM","MIN","MAX","LAST"]},"MetricDisplayType":{"type":"string","enum":["GRAPH","SINGLE"]},"TeamRel":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"MetricMetadata":{"type":"object","description":"Only required if the metric has a dataSource. You may not change this after creation.","default":"null","oneOf":[{"$ref":"#/components/schemas/MDataDogMetadata"},{"$ref":"#/components/schemas/MPrometheusMetadata"}]},"MDataDogMetadata":{"required":["query"],"type":"object","properties":{"query":{"type":"string"}}},"MPrometheusMetadata":{"required":["query"],"type":"object","properties":{"query":{"type":"string"}}},"MetricDataSource":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/MetricDataSourceType"},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"metadata":{"$ref":"#/components/schemas/MetricDataSourceMetadata"},"managedBy":{"$ref":"#/components/schemas/ManagedBy"},"status":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["OK","ERROR"],"readOnly":true},"lastStatusTransition":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"lastError":{"type":"string","description":"This is an include field, it is not available in the list resource","readOnly":true}}},"MetricDataSourceType":{"type":"string","enum":["DATADOG","PROMETHEUS"]},"MetricDataSourceMetadata":{"type":"object","oneOf":[{"$ref":"#/components/schemas/MParamsDatadog"},{"$ref":"#/components/schemas/MParamsPrometheus"}]},"MParamsDatadog":{"required":["apiKey","applicationKey","region"],"type":"object","properties":{"region":{"type":"string"},"apiKey":{"type":"string"},"applicationKey":{"type":"string"}}},"MParamsPrometheus":{"required":["authType","url"],"type":"object","properties":{"url":{"type":"string"},"authType":{"type":"string","enum":["NONE","BASIC","HEADER"]},"basicUser":{"type":"string","description":"Optional, required for 'BASIC'"},"basicPass":{"type":"string","description":"Optional, required for 'BASIC'"},"headerKey":{"type":"string","description":"Optional, required for 'HEADER'"},"headerValue":{"type":"string","description":"Optional, required for 'HEADER'"}}},"ManagedBy":{"type":"object","readOnly":true,"description":"Present when this entity is managed outside of the ilert web app, for example through Terraform, Pulumi or the API. Read-only.","properties":{"type":{"type":"string","enum":["API","TERRAFORM","PULUMI","ILERT"]},"source":{"type":"string","description":"Identifier of the system managing this entity."}}}}},"paths":{"/metrics/{id}":{"get":{"tags":["Metrics"],"summary":"Get a specific Metric","parameters":[{"name":"id","in":"path","description":"entity ID","required":true,"schema":{"type":"number"}},{"name":"include","in":"query","description":"Describes optional properties that should be included in the response. You may declare multiple. (dataSource, integrationKey, status, metadata)","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string","enum":["dataSource","integrationKey","status","metadata"]}}}],"responses":{"200":{"description":"The requested metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}}}}}}}
```

## PUT /metrics/{id}

> Update the specific Metric

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"v2.2026.9-r.4"},"tags":[{"name":"Metrics"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}},"schemas":{"MetricPost":{"required":["aggregationType","displayType","name"],"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"aggregationType":{"$ref":"#/components/schemas/MetricAggregationType"},"displayType":{"$ref":"#/components/schemas/MetricDisplayType"},"interpolateGaps":{"type":"boolean","default":false},"lockYAxisMax":{"type":"number","format":"double"},"lockYAxisMin":{"type":"number","format":"double"},"mouseOverDecimal":{"maximum":6,"minimum":0,"type":"number","format":"int32"},"showValuesOnMouseOver":{"type":"boolean","default":false},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"unitLabel":{"type":"string"},"metadata":{"$ref":"#/components/schemas/MetricMetadata"},"dataSource":{"type":"object","properties":{"id":{"type":"number","description":"dataSource is required when providing metadata"}}}}},"MetricAggregationType":{"type":"string","enum":["AVG","SUM","MIN","MAX","LAST"]},"MetricDisplayType":{"type":"string","enum":["GRAPH","SINGLE"]},"TeamRel":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"MetricMetadata":{"type":"object","description":"Only required if the metric has a dataSource. You may not change this after creation.","default":"null","oneOf":[{"$ref":"#/components/schemas/MDataDogMetadata"},{"$ref":"#/components/schemas/MPrometheusMetadata"}]},"MDataDogMetadata":{"required":["query"],"type":"object","properties":{"query":{"type":"string"}}},"MPrometheusMetadata":{"required":["query"],"type":"object","properties":{"query":{"type":"string"}}},"Metric":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"aggregationType":{"$ref":"#/components/schemas/MetricAggregationType"},"displayType":{"$ref":"#/components/schemas/MetricDisplayType"},"interpolateGaps":{"type":"boolean","default":false},"lockYAxisMax":{"type":"number","format":"double"},"lockYAxisMin":{"type":"number","format":"double"},"mouseOverDecimal":{"maximum":6,"minimum":0,"type":"number","format":"int32"},"showValuesOnMouseOver":{"type":"boolean","default":false},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"unitLabel":{"type":"string"},"integrationKey":{"type":"string"},"metadata":{"$ref":"#/components/schemas/MetricMetadata"},"dataSource":{"$ref":"#/components/schemas/MetricDataSource"},"managedBy":{"$ref":"#/components/schemas/ManagedBy"},"status":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["NONE","OK","IMPORT_REQUEST","IMPORT","ERROR"],"readOnly":true},"lastStatusTransition":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"lastIngestion":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"importStatus":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["NONE","PENDING","ERROR","FINISHED"],"readOnly":true},"lastError":{"type":"string","description":"This is an include field, it is not available in the list resource","readOnly":true}}},"MetricDataSource":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/MetricDataSourceType"},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"metadata":{"$ref":"#/components/schemas/MetricDataSourceMetadata"},"managedBy":{"$ref":"#/components/schemas/ManagedBy"},"status":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["OK","ERROR"],"readOnly":true},"lastStatusTransition":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"lastError":{"type":"string","description":"This is an include field, it is not available in the list resource","readOnly":true}}},"MetricDataSourceType":{"type":"string","enum":["DATADOG","PROMETHEUS"]},"MetricDataSourceMetadata":{"type":"object","oneOf":[{"$ref":"#/components/schemas/MParamsDatadog"},{"$ref":"#/components/schemas/MParamsPrometheus"}]},"MParamsDatadog":{"required":["apiKey","applicationKey","region"],"type":"object","properties":{"region":{"type":"string"},"apiKey":{"type":"string"},"applicationKey":{"type":"string"}}},"MParamsPrometheus":{"required":["authType","url"],"type":"object","properties":{"url":{"type":"string"},"authType":{"type":"string","enum":["NONE","BASIC","HEADER"]},"basicUser":{"type":"string","description":"Optional, required for 'BASIC'"},"basicPass":{"type":"string","description":"Optional, required for 'BASIC'"},"headerKey":{"type":"string","description":"Optional, required for 'HEADER'"},"headerValue":{"type":"string","description":"Optional, required for 'HEADER'"}}},"ManagedBy":{"type":"object","readOnly":true,"description":"Present when this entity is managed outside of the ilert web app, for example through Terraform, Pulumi or the API. Read-only.","properties":{"type":{"type":"string","enum":["API","TERRAFORM","PULUMI","ILERT"]},"source":{"type":"string","description":"Identifier of the system managing this entity."}}}}},"paths":{"/metrics/{id}":{"put":{"tags":["Metrics"],"summary":"Update the specific Metric","parameters":[{"name":"id","in":"path","description":"entity ID","required":true,"schema":{"type":"number"}}],"requestBody":{"description":"The metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricPost"}}},"required":true},"responses":{"200":{"description":"The updated metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}}}}}}}
```

## DELETE /metrics/{id}

> Delete the specific Metric

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"v2.2026.9-r.4"},"tags":[{"name":"Metrics"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}}},"paths":{"/metrics/{id}":{"delete":{"tags":["Metrics"],"summary":"Delete the specific Metric","parameters":[{"name":"id","in":"path","description":"entity ID","required":true,"schema":{"type":"number"}}],"responses":{"204":{"description":"Empty body delete response","content":{}}}}}}}
```

## GET /metrics/name/{name}

> Get the metric with the specified name.

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"v2.2026.9-r.4"},"tags":[{"name":"Metrics"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}},"schemas":{"Metric":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"aggregationType":{"$ref":"#/components/schemas/MetricAggregationType"},"displayType":{"$ref":"#/components/schemas/MetricDisplayType"},"interpolateGaps":{"type":"boolean","default":false},"lockYAxisMax":{"type":"number","format":"double"},"lockYAxisMin":{"type":"number","format":"double"},"mouseOverDecimal":{"maximum":6,"minimum":0,"type":"number","format":"int32"},"showValuesOnMouseOver":{"type":"boolean","default":false},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"unitLabel":{"type":"string"},"integrationKey":{"type":"string"},"metadata":{"$ref":"#/components/schemas/MetricMetadata"},"dataSource":{"$ref":"#/components/schemas/MetricDataSource"},"managedBy":{"$ref":"#/components/schemas/ManagedBy"},"status":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["NONE","OK","IMPORT_REQUEST","IMPORT","ERROR"],"readOnly":true},"lastStatusTransition":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"lastIngestion":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"importStatus":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["NONE","PENDING","ERROR","FINISHED"],"readOnly":true},"lastError":{"type":"string","description":"This is an include field, it is not available in the list resource","readOnly":true}}},"MetricAggregationType":{"type":"string","enum":["AVG","SUM","MIN","MAX","LAST"]},"MetricDisplayType":{"type":"string","enum":["GRAPH","SINGLE"]},"TeamRel":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"MetricMetadata":{"type":"object","description":"Only required if the metric has a dataSource. You may not change this after creation.","default":"null","oneOf":[{"$ref":"#/components/schemas/MDataDogMetadata"},{"$ref":"#/components/schemas/MPrometheusMetadata"}]},"MDataDogMetadata":{"required":["query"],"type":"object","properties":{"query":{"type":"string"}}},"MPrometheusMetadata":{"required":["query"],"type":"object","properties":{"query":{"type":"string"}}},"MetricDataSource":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/MetricDataSourceType"},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamRel"}},"metadata":{"$ref":"#/components/schemas/MetricDataSourceMetadata"},"managedBy":{"$ref":"#/components/schemas/ManagedBy"},"status":{"type":"string","description":"This is an include field, it is not available in the list resource","enum":["OK","ERROR"],"readOnly":true},"lastStatusTransition":{"type":"string","format":"date-time","description":"This is an include field, it is not available in the list resource","readOnly":true},"lastError":{"type":"string","description":"This is an include field, it is not available in the list resource","readOnly":true}}},"MetricDataSourceType":{"type":"string","enum":["DATADOG","PROMETHEUS"]},"MetricDataSourceMetadata":{"type":"object","oneOf":[{"$ref":"#/components/schemas/MParamsDatadog"},{"$ref":"#/components/schemas/MParamsPrometheus"}]},"MParamsDatadog":{"required":["apiKey","applicationKey","region"],"type":"object","properties":{"region":{"type":"string"},"apiKey":{"type":"string"},"applicationKey":{"type":"string"}}},"MParamsPrometheus":{"required":["authType","url"],"type":"object","properties":{"url":{"type":"string"},"authType":{"type":"string","enum":["NONE","BASIC","HEADER"]},"basicUser":{"type":"string","description":"Optional, required for 'BASIC'"},"basicPass":{"type":"string","description":"Optional, required for 'BASIC'"},"headerKey":{"type":"string","description":"Optional, required for 'HEADER'"},"headerValue":{"type":"string","description":"Optional, required for 'HEADER'"}}},"ManagedBy":{"type":"object","readOnly":true,"description":"Present when this entity is managed outside of the ilert web app, for example through Terraform, Pulumi or the API. Read-only.","properties":{"type":{"type":"string","enum":["API","TERRAFORM","PULUMI","ILERT"]},"source":{"type":"string","description":"Identifier of the system managing this entity."}}}}},"paths":{"/metrics/name/{name}":{"get":{"tags":["Metrics"],"summary":"Get the metric with the specified name.","parameters":[{"name":"name","in":"path","description":"unique name of the metric","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","description":"Describes optional properties that should be included in the response. You may declare multiple. (dataSource, integrationKey, status, metadata)","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string","enum":["dataSource","integrationKey","status","metadata"]}}}],"responses":{"200":{"description":"The requested metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ilert.com/developer-docs/rest-api/api-reference/metrics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
