Skip to content

Commit

Permalink
feat: add tag format for host name
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhanta-rath committed Jan 31, 2025
1 parent dece17e commit e1eaba2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metrics/statsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ func withTags(bucket, tags string) string {

func Setup() error {
if instance == nil {
hostTagKey := "host:"
hostTagKey := "host"
hostTagValue, err := os.Hostname()
if err != nil {
logger.Errorf("unable to get the host name during StatsD setup: %s", err.Error())
return err
}
c, err := client.New(
client.Address(config.MetricStatsd.Address),
client.FlushPeriod(config.MetricStatsd.FlushPeriodMs), client.Tags(hostTagKey, hostTagValue))
client.FlushPeriod(config.MetricStatsd.FlushPeriodMs), client.TagsFormat(client.InfluxDB), client.Tags(hostTagKey, hostTagValue))
if err != nil {
logger.Errorf("StatsD Set up failed to create client: %s", err.Error())
return err
Expand Down

0 comments on commit e1eaba2

Please sign in to comment.