---
title: "scrape Prometheus metrics"
method: GET
path: "/mockserver/metrics"
tags: ["metrics"]
---

# scrape Prometheus metrics

`GET /mockserver/metrics`

## Request

- Base URL: `http://localhost:1080`
- URL: `http://localhost:1080/mockserver/metrics`
- Auth: none declared

Serves the Prometheus metrics exposition when `metricsEnabled` is set, negotiating the text or OpenMetrics format from the Accept header. Returns 404 when metrics are disabled. Unlike its sibling control-plane endpoints this path has deliberately NO bare `/metrics` alias, because `/metrics` is a plausible path for a user's own mocked API and reserving it would shadow their expectation. It is gated by control-plane authentication like every neighbouring endpoint; since control-plane authentication is off by default an unauthenticated scrape keeps working on a default instance.

## Response `200`

metrics exposition returned

## Other responses

- `404`: metrics are disabled (enable with metricsEnabled=true)

---

[API](https://skmtc.dev/mock-server/apis/mockserver-api.md) · [All operations](https://skmtc.dev/mock-server/apis/mockserver-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mock-server/apis/mockserver-api/revisions/9239b693996e?raw)
