openaire / iis

Information Inference Service of the OpenAIRE system
Apache License 2.0
20 stars 11 forks source link

Avoid using report file location as a metric help in metrics exporter #1335

Open marekhorst opened 2 years ago

marekhorst commented 2 years ago

Originally reported on redmine: https://support.openaire.eu/issues/7666

Apparently using report file location as a metric help:

$ http localhost:9091/metrics|grep processing_citationTextExtraction_docs
# HELP processing_citationTextExtraction_docs location:/user/dnet.beta/iis/working_dirs/primary/report
# TYPE processing_citationTextExtraction_docs gauge
processing_citationTextExtraction_docs{instance="",job="iis",user="dnet.beta"} 1.0487217e+07
processing_citationTextExtraction_docs{instance="",job="iis",user="dnet.production"} 8.202193e+06

is problematic because the following entries are produced in the pushgateway logs:

Mar 31 11:49:46 prometheus pushgateway[27192](https://support.openaire.eu/issues/7666#fn27192): {"caller":"diskmetricstore.go:165","err":"Metric families have inconsistent help strings. The latter will have priority. This is bad. Fix your pushed metrics!","level":"info","msg":"metric families inconsistent help strings","new":"name:\"processing_citationTextExtraction_docs\" help:\"location:/user/dnet.production/iis/working_dirs/primary/report\" type:GAUGE metric:\u003clabel:\u003cname:\"instance\" value:\"\" \u003e label:\u003cname:\"job\" value:\"iis\" \u003e label:\u003cname:\"user\" value:\"dnet.production\" \u003e gauge:\u003cvalue:8.202193e+06 \u003e \u003e ","old":"name:\"processing_citationTextExtraction_docs\" help:\"location:/user/dnet.beta/iis/working_dirs/primary/report\" type:GAUGE metric:\u003clabel:\u003cname:\"instance\" value:\"\" \u003e label:\u003cname:\"job\" value:\"iis\" \u003e label:\u003cname:\"user\" value:\"dnet.beta\" \u003e gauge:\u003cvalue:1.0487217e+07 \u003e \u003e ","ts":"2022-03-31T09:49:46.301Z"}
Mar 31 11:49:46 prometheus pushgateway[27192](https://support.openaire.eu/issues/7666#fn27192): {"caller":"diskmetricstore.go:165","err":"Metric families have inconsistent help strings. The latter will have priority. This is bad. Fix your pushed metrics!","level":"info","msg":"metric families inconsistent help strings","new":"name:\"processing_referenceExtraction_softwareUrl_duration_seconds\" help:\"location:/user/dnet.production/iis/working_dirs/primary/report\" type:GAUGE metric:\u003clabel:\u003cname:\"instance\" value:\"\" \u003e label:\u003cname:\"job\" value:\"iis\" \u003e label:\u003cname:\"user\" value:\"dnet.production\" \u003e gauge:\u003cvalue:9130 \u003e \u003e ","old":"name:\"processing_referenceExtraction_softwareUrl_duration_seconds\" help:\"location:/user/dnet.beta/iis/working_dirs/primary/report\" type:GAUGE metric:\u003clabel:\u003cname:\"instance\" value:\"\" \u003e label:\u003cname:\"job\" value:\"iis\" \u003e label:\u003cname:\"user\" value:\"dnet.beta\" \u003e gauge:\u003cvalue:8386 \u003e \u003e ","ts":"2022-03-31T09:49:46.301Z"}
mpol commented 2 years ago

Additionally it would be confusing to anybody ever looking at the help (maybe in Grafana) to see a path related to eg. dnet.beta with a metric related to dnet.production (or the other way around). Although in practice I guess nobody ever looks at the help anyway.