Skip to content

Conversation

@gazi-yestemirova
Copy link
Contributor

@gazi-yestemirova gazi-yestemirova commented Oct 23, 2025

What changed?
Added a metric shard_distributor_active_shards along with namespace and namespace_type tag. Metric is emitted during the shard assignment.

Why?
To be able to track number of active shards via dashboards or setup alerts on this metric.

How did you test it?
local testing
Screenshot 2025-10-23 at 09 10 23

Potential risks
N/A

Release notes

Documentation Changes

Signed-off-by: Gaziza Yestemirova <[email protected]>
Signed-off-by: Gaziza Yestemirova <[email protected]>
@gazi-yestemirova gazi-yestemirova changed the title [shard-distributor]Add metrics on number of active shards feat: [shard-distributor]Add metrics on number of active shards Oct 23, 2025
metricsLoopScope.Tagged(
metrics.NamespaceTag(p.namespaceCfg.Name),
metrics.NamespaceTypeTag(p.namespaceCfg.Type),
).UpdateGauge(metrics.ShardDistributorActiveShards, float64(totalActiveShards))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we have this metric emitted after the call to shardStore.AssignShards? I think in this case, SD will not emit this metric incorrectly in case of failures of writing to etcd. What do you think?

Signed-off-by: Gaziza Yestemirova <[email protected]>
Copy link
Contributor

@arzonus arzonus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants