Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Add namespace to metrics #79

Merged
merged 2 commits into from
Aug 12, 2022
Merged

Add namespace to metrics #79

merged 2 commits into from
Aug 12, 2022

Conversation

MarcoPolo
Copy link
Contributor

This adds the "rcmgr_" prefix to the exposed metrics.

I originally thought we could add a namespace when we registered the exporter, but it turns out that was done on a more global level rather than just for these sets of metrics.

e.g.:

_, err = ocprom.NewExporter(ocprom.Options{
    Registry: prometheus.DefaultRegisterer.(*prometheus.Registry),
    Namespace: "some_namespace", // This sets the global namespace to all opencensus metrics. I originally thought it was only for the specified metrics.
})

This also updates the dashboard to use the new name. If users add their own namespace to the exporter they'll have to update the dashboard before importing.

Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

Not sure I understand all the nuances of namespaces, but this doesn't look wrong to me.

@MarcoPolo
Copy link
Contributor Author

Not sure I understand all the nuances of namespaces, but this doesn't look wrong to me.

This is the difference between the metrics showing up as rcmgr_peer_connections_bucket vs peer_connections_bucket.

The Namespace field I mentioned only has to do with how you hook up OpenCensus to prometheus. It will put the Namespace in front of the metric name when sending it to prometheus. But it does it for all opencensus metrics, so everything that gets recorded through opencensus and sent to prometheus will have this namespace prefix.

It's a little weird, which is why I got it wrong at first.

@MarcoPolo MarcoPolo merged commit a4cf656 into master Aug 12, 2022
@ajnavarro ajnavarro mentioned this pull request Aug 24, 2022
72 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants