Skip to content

Commit

Permalink
node, ir: Remove deprecated metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Karpy <[email protected]>
  • Loading branch information
notimetoname committed Jun 20, 2023
1 parent 1581ff1 commit 38decb7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 35 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog for NeoFS Node

### Removed
- Deprecated `morph.rpc_endpoint` SN and `morph.endpoint.client` IR config sections (#2400)
- `neofs_node_object_epoch` metric for IR and SN (#2347)

### Changed
- CLI `--timeout` flag configures whole execution timeout from now (#2124)
Expand All @@ -26,6 +27,9 @@ specified time period is now limited to 1 minute. This value can be changed with
`--timeout` flag.
Deprecated `morph.rpc_endpoint` SN and `morph.endpoint.client` IR configurations
have been removed. Use `morph.endpoints` for both instead.
Deprecated `neofs_node_object_epoch` metric for IR and SN (the same for both)
has been removed. Use `neofs_node_state_epoch` for SN and `neofs_ir_state_epoch`
for IR instead.

## [0.37.0] - 2023-06-15 - Sogado

Expand Down
21 changes: 2 additions & 19 deletions pkg/metrics/innerring.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
package metrics

import (
"fmt"

"github.com/prometheus/client_golang/prometheus"
)

const innerRingNameSpace = "neofs_ir"

// FIXME: drop after v0.38.0 release: #2347.
const innerRingNameSpaceDeprecated = storageNodeNameSpace
const innerRingSubsystemDeprecated = objectSubsystem

// InnerRingServiceMetrics contains metrics collected by inner ring.
type InnerRingServiceMetrics struct {
epoch prometheus.Gauge
epochDeprecated prometheus.Gauge
epoch prometheus.Gauge
}

// NewInnerRingMetrics returns new instance of metrics collectors for inner ring.
Expand All @@ -30,22 +23,12 @@ func NewInnerRingMetrics(version string) InnerRingServiceMetrics {
})
prometheus.MustRegister(epoch)

epochDeprecated := prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: innerRingNameSpaceDeprecated,
Subsystem: innerRingSubsystemDeprecated,
Name: "epoch",
Help: fmt.Sprintf("Current epoch as seen by inner-ring node. DEPRECATED: use [%s_%s_epoch] instead.", innerRingNameSpace, stateSubsystem),
})
prometheus.MustRegister(epochDeprecated)

return InnerRingServiceMetrics{
epoch: epoch,
epochDeprecated: epochDeprecated,
epoch: epoch,
}
}

// SetEpoch updates epoch metrics.
func (m InnerRingServiceMetrics) SetEpoch(epoch uint64) {
m.epoch.Set(float64(epoch))
m.epochDeprecated.Set(float64(epoch))
}
17 changes: 1 addition & 16 deletions pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package metrics

import (
"fmt"

"github.com/prometheus/client_golang/prometheus"
)

Expand All @@ -12,8 +10,7 @@ type NodeMetrics struct {
objectServiceMetrics
engineMetrics
stateMetrics
epoch prometheus.Gauge
epochDeprecated prometheus.Gauge
epoch prometheus.Gauge
}

func NewNodeMetrics(version string) *NodeMetrics {
Expand All @@ -36,27 +33,15 @@ func NewNodeMetrics(version string) *NodeMetrics {
})
prometheus.MustRegister(epoch)

// FIXME: drop after v0.38.0 release: #2347.
const stateSubsystemDeprecated = objectSubsystem
epochDeprecated := prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: storageNodeNameSpace,
Subsystem: stateSubsystemDeprecated,
Name: "epoch",
Help: fmt.Sprintf("Current epoch as seen by inner-ring node. DEPRECATED: use [%s_%s_epoch] instead.", storageNodeNameSpace, stateSubsystem),
})
prometheus.MustRegister(epochDeprecated)

return &NodeMetrics{
objectServiceMetrics: objectService,
engineMetrics: engine,
stateMetrics: state,
epoch: epoch,
epochDeprecated: epochDeprecated,
}
}

// SetEpoch updates epoch metric.
func (m *NodeMetrics) SetEpoch(epoch uint64) {
m.epoch.Set(float64(epoch))
m.epochDeprecated.Set(float64(epoch))
}

0 comments on commit 38decb7

Please sign in to comment.