summaryrefslogtreecommitdiff
path: root/plugins/metrics
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-25 15:43:15 +0300
committerGitHub <[email protected]>2021-01-25 15:43:15 +0300
commitaa3a6a18c7d0cd08da0465377d22caa0cb5a4ff6 (patch)
treed8dbf5c76542546cab461837709874354e9a2445 /plugins/metrics
parent29d6020a9e8a3713b22269ed946547c96c24d3da (diff)
parent349aaf76c6203d5fa75dfc27c0409034cd91bb64 (diff)
Merge pull request #495 from spiral/feature/stabilization
feat(all): stabilization
Diffstat (limited to 'plugins/metrics')
-rw-r--r--plugins/metrics/plugin.go2
-rw-r--r--plugins/metrics/rpc.go14
2 files changed, 8 insertions, 8 deletions
diff --git a/plugins/metrics/plugin.go b/plugins/metrics/plugin.go
index 859f3d24..fefe92bd 100644
--- a/plugins/metrics/plugin.go
+++ b/plugins/metrics/plugin.go
@@ -9,7 +9,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
- "github.com/spiral/endure"
+ endure "github.com/spiral/endure/pkg/container"
"github.com/spiral/errors"
"github.com/spiral/roadrunner/v2/plugins/config"
"github.com/spiral/roadrunner/v2/plugins/logger"
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 {