Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ require (
github.com/pion/transport/v2 v2.2.1 // indirect
github.com/pion/transport/v3 v3.0.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/otlptranslator v0.0.2 // indirect
github.com/prometheus/otlptranslator v0.0.2
github.com/prometheus/procfs v0.17.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions sei-db/common/metrics/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/otlptranslator"
"go.opentelemetry.io/otel"
otelprometheus "go.opentelemetry.io/otel/exporters/prometheus"
otelmetric "go.opentelemetry.io/otel/sdk/metric"
Expand All @@ -26,6 +27,7 @@ func SetupOtelPrometheus() (*prometheus.Registry, func(context.Context) error, e

exporter, err := otelprometheus.New(
otelprometheus.WithRegisterer(reg),
otelprometheus.WithTranslationStrategy(otlptranslator.UnderscoreEscapingWithSuffixes),
)
if err != nil {
return nil, nil, fmt.Errorf("create prometheus exporter: %w", err)
Expand Down
6 changes: 5 additions & 1 deletion utils/metrics/metrics_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

metrics "github.com/armon/go-metrics"
"github.com/prometheus/otlptranslator"
"github.com/sei-protocol/sei-chain/sei-cosmos/telemetry"
"github.com/sei-protocol/sei-chain/x/evm/types"
"go.opentelemetry.io/otel"
Expand All @@ -17,7 +18,10 @@ import (
)

func SetupOtelMetricsProvider() error {
metricsExporter, err := prometheus.New(prometheus.WithNamespace("sei_chain"))
metricsExporter, err := prometheus.New(
prometheus.WithNamespace("sei_chain"),
prometheus.WithTranslationStrategy(otlptranslator.UnderscoreEscapingWithSuffixes),
)
if err != nil {
return fmt.Errorf("failed to create Prometheus exporter: %w", err)
}
Expand Down
Loading