Skip to content

metrics backend for swift-metrics that uses the statsd protocol

License

Notifications You must be signed in to change notification settings

tomerd/swift-statsd-client

 
 

Repository files navigation

swift-statsd-client

a metrics backend for swift-metrics that uses the statsd protocol, and can be used to integrate applications with observability solutions that support statsd including:

getting started

create an instance of the StatsdClient and boostrap the MertricsSystem in your application's main:

let statsdClient = try StatsdClient(host: host, port: port)
MetricsSystem.bootstrap(statsdClient)

see https://github.com/apple/swift-metrics#selecting-a-metrics-backend-implementation-applications-only

remeber to also shutdown the client before you application terminates:

statsdClient.shutdown()

architecture

the statsd client uses swift-nio to establish a UDP connection to the statsd server

metrics types are mapped as follwoing:

  • Counter -> Counter
  • Gauge -> Gauge
  • Recorder -> Histogram
  • Timer -> Timer

About

metrics backend for swift-metrics that uses the statsd protocol

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 70.3%
  • Ruby 13.6%
  • Shell 12.9%
  • Dockerfile 3.2%