lib/protoparser: metrics renaming: vm_protoparser_<type>_* -> vm_protoparser_*{type="<type>"}

This should improve composability of these metrics in PromQL queries
This commit is contained in:
Aliaksandr Valialkin 2020-02-28 20:19:35 +02:00
parent f9a584b5c1
commit b785429ddb
6 changed files with 20 additions and 20 deletions

View file

@ -100,9 +100,9 @@ func (ctx *streamContext) reset() {
}
var (
readCalls = metrics.NewCounter(`vm_protoparser_graphite_read_calls_total`)
readErrors = metrics.NewCounter(`vm_protoparser_graphite_read_errors_total`)
rowsRead = metrics.NewCounter(`vm_protoparser_graphite_rows_read_total`)
readCalls = metrics.NewCounter(`vm_protoparser_read_calls_total{type="graphite"}`)
readErrors = metrics.NewCounter(`vm_protoparser_read_errors_total{type="graphite"}`)
rowsRead = metrics.NewCounter(`vm_protoparser_rows_read_total{type="graphite"}`)
)
func getStreamContext() *streamContext {

View file

@ -97,9 +97,9 @@ func (ctx *streamContext) Read(r io.Reader, tsMultiplier int64) bool {
}
var (
readCalls = metrics.NewCounter(`vm_protoparser_influx_read_calls_total`)
readErrors = metrics.NewCounter(`vm_protoparser_influx_read_errors_total`)
rowsRead = metrics.NewCounter(`vm_protoparser_influx_rows_read_total`)
readCalls = metrics.NewCounter(`vm_protoparser_read_calls_total{type="influx"}`)
readErrors = metrics.NewCounter(`vm_protoparser_read_errors_total{type="influx"}`)
rowsRead = metrics.NewCounter(`vm_protoparser_rows_read_total{type="influx"}`)
)
type streamContext struct {

View file

@ -98,9 +98,9 @@ func (ctx *streamContext) reset() {
}
var (
readCalls = metrics.NewCounter(`vm_protoparser_opentsdb_read_calls_total`)
readErrors = metrics.NewCounter(`vm_protoparser_opentsdb_read_errors_total`)
rowsRead = metrics.NewCounter(`vm_protoparser_opentsdb_rows_read_total`)
readCalls = metrics.NewCounter(`vm_protoparser_read_calls_total{type="opentsdb"}`)
readErrors = metrics.NewCounter(`vm_protoparser_read_errors_total{type="opentsdb"}`)
rowsRead = metrics.NewCounter(`vm_protoparser_rows_read_total{type="opentsdb"}`)
)
func getStreamContext() *streamContext {

View file

@ -96,10 +96,10 @@ func (ctx *streamContext) reset() {
}
var (
readCalls = metrics.NewCounter(`vm_protoparser_opentsdbhttp_read_calls_total`)
readErrors = metrics.NewCounter(`vm_protoparser_opentsdbhttp_read_errors_total`)
rowsRead = metrics.NewCounter(`vm_protoparser_opentsdbhttp_rows_read_total`)
unmarshalErrors = metrics.NewCounter(`vm_protoparser_opentsdbhttp_unmarshal_errors_total`)
readCalls = metrics.NewCounter(`vm_protoparser_read_calls_total{type="opentsdbhttp"}`)
readErrors = metrics.NewCounter(`vm_protoparser_read_errors_total{type="opentsdbhttp"}`)
rowsRead = metrics.NewCounter(`vm_protoparser_rows_read_total{type="opentsdbhttp"}`)
unmarshalErrors = metrics.NewCounter(`vm_protoparser_unmarshal_errors_total{type="opentsdbhttp"}`)
)
func getStreamContext() *streamContext {

View file

@ -62,10 +62,10 @@ func (ctx *pushCtx) Read(r *http.Request) error {
}
var (
readCalls = metrics.NewCounter(`vm_protoparser_promremotewrite_read_calls_total`)
readErrors = metrics.NewCounter(`vm_protoparser_promremotewrite_read_errors_total`)
rowsRead = metrics.NewCounter(`vm_protoparser_promremotewrite_rows_read_total`)
unmarshalErrors = metrics.NewCounter(`vm_protoparser_promremotewrite_unmarshal_errors`)
readCalls = metrics.NewCounter(`vm_protoparser_read_calls_total{type="promremotewrite"}`)
readErrors = metrics.NewCounter(`vm_protoparser_read_errors_total{type="promremotewrite"}`)
rowsRead = metrics.NewCounter(`vm_protoparser_rows_read_total{type="promremotewrite"}`)
unmarshalErrors = metrics.NewCounter(`vm_protoparser_unmarshal_errors{type="promremotewrite"}`)
)
func getPushCtx() *pushCtx {

View file

@ -60,9 +60,9 @@ func (ctx *streamContext) Read(r io.Reader) bool {
}
var (
readCalls = metrics.NewCounter(`vm_protoparser_vmimport_read_calls_total`)
readErrors = metrics.NewCounter(`vm_protoparser_vmimport_read_errors_total`)
rowsRead = metrics.NewCounter(`vm_protoparser_vmimport_rows_read_total`)
readCalls = metrics.NewCounter(`vm_protoparser_read_calls_total{type="vmimport"}`)
readErrors = metrics.NewCounter(`vm_protoparser_read_errors_total{type="vmimport"}`)
rowsRead = metrics.NewCounter(`vm_protoparser_rows_read_total{type="vmimport"}`)
)
type streamContext struct {