The Local Metrics Endpoint is only available for BYOC Pro clusters. To enable it, see Enable the Local Metrics Endpoint.
Prerequisites
- A BYOC Pro cluster with the Local Metrics Endpoint enabled, and its endpoint URL. The URL has the
form
https://metric-<id>.<your-domain>, and there is one per cluster. - A Super Admin service account that is authorized for the endpoint. To authorize an additional service account, submit a request through the support portal.
- An API key for that service account.
Authenticate
Send the API key in thex-jwt-Authorization header, prefixed with ApiKey and a single space:
Authorization: Bearer header is not used by this endpoint.
Verify your credentials with an instant query:
Choose an endpoint path
The Local Metrics Endpoint serves the standard
Prometheus federation API. Federation
requires at least one
match[] selector, so to collect everything the endpoint exposes, select every
series:
Narrowing the selector to a single name prefix, such as
{__name__=~"pulsar_.*"}, also drops the
BookKeeper, ZooKeeper, JVM, and node metrics, because those series do not share that prefix. Select
every series unless you have a specific reason to collect less.Configure your collector
honor_labels: true so that federation preserves the original instance, job, and Pulsar
labels instead of replacing them with the labels of the federation target.
Your collector must be able to set a custom request header:
- In the OpenTelemetry Collector, the Prometheus receiver reads the value from the environment, so
${PULSAR_API_KEY}resolves at startup. - In Prometheus,
http_headerstakes the header value from a file (files) or inline (values); it does not expand environment variables. The file must contain the complete header value,ApiKey <your-api-key>. - The
authorizationsetting does not work with this endpoint, because it writes the standardAuthorizationheader.
Set your scrape interval
The cluster Prometheus retains data for 30 minutes. It is a federation source, not long-term storage, so:- Scrape every 15 to 60 seconds and retain the data in your own backend.
- If your collector stops for longer than 30 minutes, the metrics for that period are no longer available from the endpoint.
Metric names
The Local Metrics Endpoint serves Apache Pulsar’s own metric names. For the complete list of broker, BookKeeper, ZooKeeper, and Pulsar Functions metrics, see the Pulsar metrics reference. The endpoint also serves Kubernetes-level metrics for the nodes that run your cluster, which is why a query such asup returns Kubernetes jobs alongside Pulsar jobs.
Troubleshoot a 403 Forbidden response
Check each of the following:
If every check passes and the endpoint still returns
403, submit a request through the
support portal with the request time, the endpoint hostname,
and the service account name.