Skip to content

hamba/statter

Repository files navigation

Logo

Go Report Card Build Status Coverage Status Go Reference GitHub release GitHub license

Go stats clients

Overview

Install with:

go get github.com/hamba/statter/v2

Supported stats clients

  • L2met Writes l2met to a Logger interface
  • Statsd Writes statsd to UDP
  • Prometheus Exposes stats via HTTP
  • VictoriaMetrics Exposes stats via HTTP

Note: This project has renamed the default branch from master to main. You will need to update your local environment.

Usage

reporter := statsd.New(statsdAddr, "")
stats := statter.New(reporter, 10*time.Second).With("my-prefix")

stats.Counter("my-counter", tags.Str("tag", "value")).Inc(1)