(Translated by https://www.hiragana.jp/)
GitHub - hamba/statter: Go stats clients
Skip to content

hamba/statter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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)