[#680] metrics: Export log and morph with script

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-10-04 10:03:37 +03:00
parent aca11d7474
commit 994f48f8bb
7 changed files with 24 additions and 14 deletions

View file

@ -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),