---
title: "Enable or disable OTLP metric ingestion for a deployment."
method: PATCH
path: "/deployments/{id}/metrics/enable"
tags: ["Metrics"]
---

# Enable or disable OTLP metric ingestion for a deployment.

`PATCH /deployments/{id}/metrics/enable`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/deployments/{id}/metrics/enable`
- Auth: HTTP bearer

When `enabled=true`, seeds the default container alert rules for the
deployment via [`temps_alarms::seed_default_container_rules`] (idempotent).

## Path parameters

- `id` integer, required

## Request body

- ToggleDeploymentMetricsRequest: Request body to toggle OTLP metric ingestion for a deployment.
  - `enabled` boolean, required: Whether to enable (`true`) or disable (`false`) metric ingestion.
  - `path` string, nullable: Prometheus scrape path (optional, defaults to `/metrics`).
  - `port` integer, nullable: Prometheus scrape port (optional).

## Response `200`

Metrics toggle applied

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Internal server error

## Changes

- **2026-06-05** `61b7612b2d33`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/deployments/:id/metrics/enable/patch.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
