apache / apache/bifromq

Proposal: hierarchical metric tag maps in standalone.yml

Open
#243 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
792
Forks
95
Avg merge
10h 45m
Merged PRs (30d)
4

Description

## Background

Currently `StandaloneStarter` only adds a single `env` common tag to the global registry. In multi-cluster deployments, it would be nice to have more flexible tagging at different levels.

## Rough Idea

Introduce a `metricsTags` map at different levels, something like:

**Process-level** — global tags for all metrics in the process:

```yaml
metricsTags:
region: gz
deployment: canary
```

**Cluster-level** — tags scoped to a specific host-cluster:

```yaml
agent:
hostcluster:
metricsTags:
cluster: regional-a
cluster_scope: regional
```

**Subservice propagation** — cluster-level tags could also propagate to `base-kv`, `base-rpc`, etc.

## Thoughts on Precedence

For the same key: process-level < cluster-level < metric-local tags. But this is open for discussion.

## Possible Phases

This is quite a bit of scope, so it might make sense to phase it:

1. Process-level `metricsTags`
2. Cluster-level `metricsTags` under `agent.hostcluster`
3. Propagation to base-cluster subservices

Would love to hear thoughts on whether this direction makes sense, and if the naming / precedence / phasing look reasonable.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.