hassila / swift-statsd-client

metrics backend for swift-metrics that uses the statsd protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SwiftStatsDClient

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

Security

Please see SECURITY.md for details on the security process.

Getting involved

Do not hesitate to get in touch as well, over on https://forums.swift.org/c/server

About

metrics backend for swift-metrics that uses the statsd protocol

License:Apache License 2.0


Languages

Language:Swift 71.4%Language:Shell 13.1%Language:Ruby 12.6%Language:Dockerfile 2.9%