Skip to content

Commit

Permalink
examples: Follow best practices and established naming conventions
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lilic committed Oct 15, 2024
1 parent 9c67f61 commit 582e0a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/customlabels/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}),
)
Expand Down

0 comments on commit 582e0a3

Please sign in to comment.