apache / apache/pulsar

Add pulsar_tenant and pulsar_namespace labels to prometheus metrics

Open
#19,554 4 comments 0 reactions 1 assignee Claimed by @pgier View on GitHub
Stale type/enhancement
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### Motivation

It can be useful in to combine metrics by the pulsar tenant or namespace. Currently this is difficult to do by tenant because there is no distinct tenant label. There is only the `namespace` label which has the format `/`.

### Solution

Add two new labels to prometheus metrics: `pulsar_tenant` and `pulsar_namespace`. This would allow metrics to easily be grouped by tenant, and the `pulsar_namespace` label would avoid confusion with the kubernetes namespace. We should also keep the current `namespace` label for compatibility, but consider deprecating it and eventually remove it in some future release.

### Alternatives

_No response_

### Anything else?

_No response_

### Are you willing to submit a PR?

- [X] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.