diff options
author | Valery Piashchynski <[email protected]> | 2021-01-25 13:10:06 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-01-25 13:10:06 +0300 |
commit | 2a0e7d37d825da6bb0538599ce0e2edaaa59403b (patch) | |
tree | 89c00a43333246bb6c6815c923548eecd7d4e717 /plugins/metrics | |
parent | b18a3578b6d299aac5dfcc016c2a3a0f6905aa0d (diff) |
resolve #415
Diffstat (limited to 'plugins/metrics')
-rw-r--r-- | plugins/metrics/rpc.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/metrics/rpc.go b/plugins/metrics/rpc.go index d7c90d39..538cdb78 100644 --- a/plugins/metrics/rpc.go +++ b/plugins/metrics/rpc.go @@ -26,7 +26,7 @@ type Metric struct { // Add new metric to the designated collector. func (rpc *rpcServer) Add(m *Metric, ok *bool) error { const op = errors.Op("metrics_plugin_add") - rpc.log.Info("Adding metric", "name", m.Name, "value", m.Value, "labels", m.Labels) + rpc.log.Info("adding metric", "name", m.Name, "value", m.Value, "labels", m.Labels) c, exist := rpc.svc.collectors.Load(m.Name) if !exist { rpc.log.Error("undefined collector", "collector", m.Name) @@ -70,14 +70,14 @@ func (rpc *rpcServer) Add(m *Metric, ok *bool) error { // RPC, set ok to true as return value. Need by rpc.Call reply argument *ok = true - rpc.log.Info("new metric successfully added", "name", m.Name, "labels", m.Labels, "value", m.Value) + rpc.log.Info("metric successfully added", "name", m.Name, "labels", m.Labels, "value", m.Value) return nil } // Sub subtract the value from the specific metric (gauge only). func (rpc *rpcServer) Sub(m *Metric, ok *bool) error { const op = errors.Op("metrics_plugin_sub") - rpc.log.Info("Subtracting value from metric", "name", m.Name, "value", m.Value, "labels", m.Labels) + rpc.log.Info("subtracting value from metric", "name", m.Name, "value", m.Value, "labels", m.Labels) c, exist := rpc.svc.collectors.Load(m.Name) if !exist { rpc.log.Error("undefined collector", "name", m.Name, "value", m.Value, "labels", m.Labels) @@ -107,7 +107,7 @@ func (rpc *rpcServer) Sub(m *Metric, ok *bool) error { default: return errors.E(op, errors.Errorf("collector `%s` does not support method `Sub`", m.Name)) } - rpc.log.Info("Subtracting operation applied successfully", "name", m.Name, "labels", m.Labels, "value", m.Value) + rpc.log.Info("subtracting operation finished successfully", "name", m.Name, "labels", m.Labels, "value", m.Value) *ok = true return nil @@ -116,7 +116,7 @@ func (rpc *rpcServer) Sub(m *Metric, ok *bool) error { // Observe the value (histogram and summary only). func (rpc *rpcServer) Observe(m *Metric, ok *bool) error { const op = errors.Op("metrics_plugin_observe") - rpc.log.Info("Observing metric", "name", m.Name, "value", m.Value, "labels", m.Labels) + rpc.log.Info("observing metric", "name", m.Name, "value", m.Value, "labels", m.Labels) c, exist := rpc.svc.collectors.Load(m.Name) if !exist { @@ -171,7 +171,7 @@ func (rpc *rpcServer) Observe(m *Metric, ok *bool) error { // error func (rpc *rpcServer) Declare(nc *NamedCollector, ok *bool) error { const op = errors.Op("metrics_plugin_declare") - rpc.log.Info("Declaring new metric", "name", nc.Name, "type", nc.Type, "namespace", nc.Namespace) + rpc.log.Info("declaring new metric", "name", nc.Name, "type", nc.Type, "namespace", nc.Namespace) _, exist := rpc.svc.collectors.Load(nc.Name) if exist { rpc.log.Error("metric with provided name already exist", "name", nc.Name, "type", nc.Type, "namespace", nc.Namespace) @@ -256,7 +256,7 @@ func (rpc *rpcServer) Declare(nc *NamedCollector, ok *bool) error { // Set the metric value (only for gaude). func (rpc *rpcServer) Set(m *Metric, ok *bool) (err error) { const op = errors.Op("metrics_plugin_set") - rpc.log.Info("Observing metric", "name", m.Name, "value", m.Value, "labels", m.Labels) + rpc.log.Info("observing metric", "name", m.Name, "value", m.Value, "labels", m.Labels) c, exist := rpc.svc.collectors.Load(m.Name) if !exist { |