examples: Follow best practices and established naming conventions

This is a nitpick but from my experience and understanding the best
practice for label key naming is to use one word, otherwise using an
underscore. Since this is an example users tend to copy, I think
correcting it might be a good idea.

Signed-off-by: Lili Cosic <cosiclili@gmail.com>
This commit is contained in:
Lili Cosic 2024-10-15 14:16:39 +02:00
parent 9c67f6190c
commit 582e0a32d3
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ func main() {
// Create a new registry.
reg := prometheus.NewRegistry()
prometheus.WrapRegistererWith(prometheus.Labels{"serviceName": "my-service-name"}, reg).MustRegister(
prometheus.WrapRegistererWith(prometheus.Labels{"service": "my-service-name"}, reg).MustRegister(
collectors.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
)