---
title: "Create composite metric"
method: POST
path: "/v1/metrics"
tags: ["metrics"]
---

# Create composite metric

`POST /v1/metrics`

Create a composite metric given a PromQL query.

## Request body

- MetricsCompositeMetric
  - `name` string, required — Name of the composite metric.
  - `displayName` string, nullable — Display name of the composite metric. A short description of the metric.
  - `description` string, nullable — Description of the composite metric. A detailed description of the metric.
  - `formula` string, required — PromQL query to calculate the composite metric.
  - `units` string, nullable — Unit of the composite metric.

## Response `201`

The request has succeeded and a new resource has been created as a result.

- MetricsCompositeMetric
  - `name` string, required — Name of the composite metric.
  - `displayName` string, nullable — Display name of the composite metric. A short description of the metric.
  - `description` string, nullable — Description of the composite metric. A detailed description of the metric.
  - `formula` string, required — PromQL query to calculate the composite metric.
  - `units` string, nullable — Unit of the composite metric.

## Other responses

- `400` — The server could not understand the request due to invalid syntax.
- `401` — Access is unauthorized.
- `409` — The request conflicts with the current state of the server.
- `500` — Server error

---

[API](https://skmtc.net/solarwinds/apis/solarwinds-observability.md) · [All operations](https://skmtc.net/solarwinds/apis/solarwinds-observability/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/solarwinds/solarwinds-observability/versions/994e5ca64961/schema)
