---
title: "Creates MeshMetric entity"
method: POST
path: "/v3/mesh/control-planes/{cpId}/meshes/{mesh}/meshmetrics"
tags: ["MeshMetric"]
---

# Creates MeshMetric entity

`POST /v3/mesh/control-planes/{cpId}/meshes/{mesh}/meshmetrics`

## Request

- Base URL: `https://global.api.konghq.com`
- URL: `https://global.api.konghq.com/v3/mesh/control-planes/{cpId}/meshes/{mesh}/meshmetrics`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Creates a resource using the name in the body. An existing resource is never modified. Requires Kuma 3.0 or later.

## Path parameters

- `cpId` string, uuid, required
- `mesh` string, required

## Request body

- MeshMetricItem: MeshMetric enables collection and export of service mesh metrics. It configures sidecar and application metrics scraping, allows customization of which metrics are published, and supports exporting to Prometheus or OpenTelemetry backends for monitoring and observability.
  - `type` 'MeshMetric', required: the type of the resource
  - `mesh` string: Mesh is the name of the Kuma mesh this resource belongs to. It may be omitted for cluster-scoped resources.
  - `kri` string: A unique identifier for this resource instance used by internal tooling and integrations. Typically derived from resource attributes and may be used for cross-references or indexing
  - `name` string, required: Name of the Kuma resource
  - `labels` object: The labels to help identity resources
  - `spec` object, required: Spec is the specification of the Kuma MeshMetric resource.
    - `default` object: MeshMetric configuration.
      - `applications` object[]: Applications is a list of applications that Dataplane Proxy will scrape. Ignored on zone-proxy-only Dataplanes (zone ingress/egress exist without a co-located workload).
        - `address` string: Address on which an application listens.
        - `name` string: Name of the application to scrape
        - `path` string: Path on which an application expose HTTP endpoint with metrics.
        - `port` integer, required: Port on which an application expose HTTP endpoint with metrics.
      - `backends` object[]: Backends list that will be used to collect metrics.
        - `openTelemetry` object: OpenTelemetry backend configuration
          - `backendRef` object: BackendRef is a reference to a MeshOpenTelemetryBackend resource that defines the collector endpoint.
            - `kind` 'MeshOpenTelemetryBackend', required: Kind of the backend resource.
            - `labels` object: Labels to match the referenced resource. When multiple resources match, the oldest by creation time wins.
          - `refreshInterval` string: RefreshInterval defines how frequent metrics should be pushed to collector
        - `prometheus` object: Prometheus backend configuration.
          - `clientId` string: ClientId of the Prometheus backend. Needed when using MADS for DP discovery.
          - `path` string: Path on which a dataplane should expose HTTP endpoint with Prometheus metrics.
          - `port` integer: Port on which a dataplane should expose HTTP endpoint with Prometheus metrics.
          - `tls` object: Configuration of TLS for prometheus listener.
            - `mode` 'Disabled' | 'ProvidedTLS' | 'ActiveMTLSBackend': Configuration of TLS for Prometheus listener.
        - `type` 'Prometheus' | 'OpenTelemetry', required: Type of the backend that will be used to collect metrics. At the moment only Prometheus backend is available.
      - `sidecar` object: Sidecar metrics collection configuration
        - `includeUnused` boolean: IncludeUnused if false will scrape only metrics that has been by sidecar (counters incremented at least once, gauges changed at least once, and histograms added to at least once). If true will scrape all metrics (even the ones with zeros). If not specified then the default value is false.
        - `profiles` object: Profiles allows to customize which metrics are published.
          - `appendProfiles` object[]: AppendProfiles allows to combine the metrics from multiple predefined profiles.
            - `name` 'All' | 'Basic' | 'None', required: Name of the predefined profile, one of: all, basic, none
          - `exclude` object[]: Exclude makes it possible to exclude groups of metrics from a resulting profile. Exclude is subordinate to Include.
            - `match` string, required: Match is the value used to match using particular Type
            - `type` 'Prefix' | 'Regex' | 'Exact' | 'Contains', required: Type defined the type of selector, one of: prefix, regex, exact
          - `include` object[]: Include makes it possible to include additional metrics in a selected profiles. Include takes precedence over Exclude.
            - `match` string, required: Match is the value used to match using particular Type
            - `type` 'Prefix' | 'Regex' | 'Exact' | 'Contains', required: Type defined the type of selector, one of: prefix, regex, exact
    - `targetRef` object: TargetRef is a reference to the resource the policy takes an effect on. The resource could be either a real store object or virtual resource defined in-place.
      - `kind` 'Mesh' | 'Dataplane', required: Kind of the referenced resource
      - `labels` object: Labels are used to select referenced real resources and to carry legacy service identity when a common TargetRef must still target old service-tag based paths.
      - `sectionName` string: SectionName is used to target specific section of resource. For example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.
  - `creationTime` string, date-time: Time at which the resource was created
  - `modificationTime` string, date-time: Time at which the resource was updated
  - `status` object: Status is the current status of the Kuma MeshMetric resource.
    - `conditions` object[]
      - `message` string, required: message is a human readable message indicating details about the transition. This may be an empty string.
      - `reason` string, required: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
      - `status` 'True' | 'False' | 'Unknown', required: status of the condition, one of True, False, Unknown.
      - `type` string, required: type of condition in CamelCase or in foo.example.com/CamelCase.

## Response `201`

Successful response

- object
  - `warnings` string[]: warnings is a list of warning messages to return to the requesting Kuma API clients. Warning messages describe a problem the client making the API request should correct or be aware of.

## Other responses

- `400`: Invalid resource
- `404`: Parent mesh not found
- `409`: A resource with this identity already exists

## Changes

- **2026-12-03** `9c8d300657bd`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/konnect-api-beta/changes/v3/mesh/control-planes/:cpId/meshes/:mesh/meshmetrics/post.md)

---

[API](https://skmtc.dev/kong/apis/konnect-api-beta.md) - [All operations](https://skmtc.dev/kong/apis/konnect-api-beta/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/konnect-api-beta/revisions/9c8d300657bd?raw)
