summaryrefslogtreecommitdiff
path: root/plugins/metrics
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-19 18:10:39 +0300
committerGitHub <[email protected]>2021-01-19 18:10:39 +0300
commit0ff05b2732b4fd0783f959c94c54d7e39169f979 (patch)
treef50aa894ea4e5b402332f7f4a13b8c50ebb09126 /plugins/metrics
parent75ebbaac89ce8ebc3ab8de47b16e137844cfcd8a (diff)
parentd8e42927b63a0b102ce10d465a10d64bb6c02e22 (diff)
Merge pull request #487 from spiral/refactor/server_log_messagesv2.0.0-beta9
refactor(errors, logs): Uniform all errors operations, Update server log level of the server log messages
Diffstat (limited to 'plugins/metrics')
-rw-r--r--plugins/metrics/plugin.go2
-rw-r--r--plugins/metrics/rpc.go10
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/metrics/plugin.go b/plugins/metrics/plugin.go
index fb9096a1..5ed1054e 100644
--- a/plugins/metrics/plugin.go
+++ b/plugins/metrics/plugin.go
@@ -40,7 +40,7 @@ type Plugin struct {
// Init service.
func (m *Plugin) Init(cfg config.Configurer, log logger.Logger) error {
- const op = errors.Op("metrics init")
+ const op = errors.Op("metrics_plugin_init")
err := cfg.UnmarshalKey(PluginName, &m.cfg)
if err != nil {
return errors.E(op, errors.Disabled, err)
diff --git a/plugins/metrics/rpc.go b/plugins/metrics/rpc.go
index f9c6accb..d7c90d39 100644
--- a/plugins/metrics/rpc.go
+++ b/plugins/metrics/rpc.go
@@ -25,7 +25,7 @@ type Metric struct {
// Add new metric to the designated collector.
func (rpc *rpcServer) Add(m *Metric, ok *bool) error {
- const op = errors.Op("Add metric")
+ const op = errors.Op("metrics_plugin_add")
rpc.log.Info("Adding metric", "name", m.Name, "value", m.Value, "labels", m.Labels)
c, exist := rpc.svc.collectors.Load(m.Name)
if !exist {
@@ -76,7 +76,7 @@ func (rpc *rpcServer) Add(m *Metric, ok *bool) error {
// Sub subtract the value from the specific metric (gauge only).
func (rpc *rpcServer) Sub(m *Metric, ok *bool) error {
- const op = errors.Op("Subtracting metric")
+ const op = errors.Op("metrics_plugin_sub")
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 {
@@ -115,7 +115,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("Observe metrics")
+ const op = errors.Op("metrics_plugin_observe")
rpc.log.Info("Observing metric", "name", m.Name, "value", m.Value, "labels", m.Labels)
c, exist := rpc.svc.collectors.Load(m.Name)
@@ -170,7 +170,7 @@ func (rpc *rpcServer) Observe(m *Metric, ok *bool) error {
// RETURNS:
// error
func (rpc *rpcServer) Declare(nc *NamedCollector, ok *bool) error {
- const op = errors.Op("Declare metric")
+ const op = errors.Op("metrics_plugin_declare")
rpc.log.Info("Declaring new metric", "name", nc.Name, "type", nc.Type, "namespace", nc.Namespace)
_, exist := rpc.svc.collectors.Load(nc.Name)
if exist {
@@ -255,7 +255,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("Set metric")
+ const op = errors.Op("metrics_plugin_set")
rpc.log.Info("Observing metric", "name", m.Name, "value", m.Value, "labels", m.Labels)
c, exist := rpc.svc.collectors.Load(m.Name)