Skip to content

Commit

Permalink
Alternative method for triggering support
Browse files Browse the repository at this point in the history
  • Loading branch information
ywwg committed Jan 11, 2024
1 parent 65d6052 commit 1dc8c5a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/metrics/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"
"go.uber.org/atomic"
"google.golang.org/grpc"

"github.com/grafana/agent/pkg/metrics/cluster"
"github.com/grafana/agent/pkg/metrics/cluster/client"
"github.com/grafana/agent/pkg/metrics/instance"
"github.com/grafana/agent/pkg/util"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/discovery"
)

Expand All @@ -35,7 +35,7 @@ var DefaultConfig = Config{
ServiceClientConfig: client.DefaultConfig,
InstanceMode: instance.DefaultMode,
UTF8Names: false,
NameEscapingScheme: model.DefaultNameEscapingScheme.String(),
// NameEscapingScheme: model.NameEscapingScheme.String(),
}

// Config defines the configuration for the entire set of Prometheus client
Expand Down Expand Up @@ -125,7 +125,7 @@ func (c *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {
f.DurationVar(&c.WALCleanupPeriod, prefix+"wal-cleanup-period", DefaultConfig.WALCleanupPeriod, "how often to check for abandoned WALs")
f.DurationVar(&c.InstanceRestartBackoff, prefix+"instance-restart-backoff", DefaultConfig.InstanceRestartBackoff, "how long to wait before restarting a failed Prometheus instance")
f.BoolVar(&c.UTF8Names, prefix+"utf8-names", DefaultConfig.UTF8Names, "yup this again")
f.StringVar(&c.NameEscapingScheme, prefix+"name-escaping-scheme", model.DefaultNameEscapingScheme.String(), "method to escape legacy invalid names when sending to an old version of prometheus. can be one of values (default), underscores, or dots")
f.StringVar(&c.NameEscapingScheme, prefix+"name-escaping-scheme", model.NameEscapingScheme.String(), "method to escape legacy invalid names when sending to an old version of prometheus. can be one of values (default), underscores, or dots")

c.ServiceConfig.RegisterFlagsWithPrefix(prefix+"service.", f)
c.ServiceClientConfig.RegisterFlagsWithPrefix(prefix, f)
Expand Down Expand Up @@ -263,8 +263,9 @@ func (a *Agent) ApplyConfig(cfg Config) error {
if err != nil {
return err
}
model.DefaultNameEscapingScheme = scheme
model.NameEscapingScheme = scheme
}
level.Info(a.logger).Log("msg", "escaping scheme", "scheme", model.NameEscapingScheme.String())

if a.cleaner != nil {
a.cleaner.Stop()
Expand Down

0 comments on commit 1dc8c5a

Please sign in to comment.