---
title: "Create Metric"
method: POST
path: "/spans/{span_id}/metrics"
tags: ["span metrics"]
---

# Create Metric

`POST /spans/{span_id}/metrics`

Create a new metric for a span

## Path parameters

- `span_id` string, uuid, required — The id of the span

## Request body

- CreateSpanMetricRequest
  - `dimension` string, required — The dimension of the metric
  - `value` number, required — The value of the metric
  - `comment` string, nullable — A comment about the metric, e.g. a description of the metric

## Response `200`

Successful Response

- CreateSpanMetricResponse
  - `dimension` string, required — The dimension of the metric
  - `value` number, required — The value of the metric
  - `comment` string, nullable — A comment about the metric, e.g. a description of the metric
  - `id` string, uuid, required
  - `span_id` string, uuid, required
  - `created_at` string, date-time, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `402` — Payment Required (out of credits)
- `404` — Not Found
- `409` — Conflict
- `422` — Request Validation Error

---

[API](https://skmtc.dev/opper/apis/opper-api-v2.md) · [All operations](https://skmtc.dev/opper/apis/opper-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/opper/opper-api-v2/revisions/d3ccdaa15678/schema)
