forked from TrueCloudLab/frostfs-node
[#680] metrics: Export log and morph with script
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
aca11d7474
commit
994f48f8bb
7 changed files with 24 additions and 14 deletions
|
@ -14,12 +14,12 @@ const (
|
|||
logDroppedLabel = "dropped"
|
||||
)
|
||||
|
||||
type logMetrics struct {
|
||||
type LogMetrics struct {
|
||||
logCount *prometheus.CounterVec
|
||||
}
|
||||
|
||||
func newLogMetrics(namespace string) *logMetrics {
|
||||
return &logMetrics{
|
||||
func NewLogMetrics(namespace string) *LogMetrics {
|
||||
return &LogMetrics{
|
||||
logCount: metrics.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: namespace,
|
||||
Subsystem: logSubsystem,
|
||||
|
@ -29,7 +29,7 @@ func newLogMetrics(namespace string) *logMetrics {
|
|||
}
|
||||
}
|
||||
|
||||
func (m *logMetrics) Inc(level zapcore.Level, dropped bool) {
|
||||
func (m *LogMetrics) Inc(level zapcore.Level, dropped bool) {
|
||||
m.logCount.With(prometheus.Labels{
|
||||
logLevelLabel: level.String(),
|
||||
logDroppedLabel: strconv.FormatBool(dropped),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue