apple/swift-statsd-client
metrics backend for swift-metrics that uses the statsd protocol
Getting started
Create an instance of the StatsdClient and boostrap the MetricsSystem in your application's main:
let statsdClient = try StatsdClient(host: host, port: port)
MetricsSystem.bootstrap(statsdClient)See selecting a metrics backend implementation for more information.
Remember to also shutdown the client before you application terminates:
statsdClient.shutdown()Architecture
StatsdClient uses SwiftNIO to establish a UDP connection to the statsd server.
Metrics types are mapped as following:
- 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
Run CI checks locally
You can run the GitHub Actions workflows locally using act. For detailed steps on how to do this please see https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally.
Package Metadata
Repository: apple/swift-statsd-client
Stars: 72
Forks: 22
Open issues: 3
Default branch: main
Primary language: swift
License: Apache-2.0
README: README.md