Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apple/swift-statsd-client
metrics backend for swift-metrics that uses the statsd protocol
https://github.com/apple/swift-statsd-client
Last synced: about 1 month ago
JSON representation
metrics backend for swift-metrics that uses the statsd protocol
- Host: GitHub
- URL: https://github.com/apple/swift-statsd-client
- Owner: apple
- License: apache-2.0
- Created: 2019-06-02T01:59:53.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-11T21:43:31.000Z (2 months ago)
- Last Synced: 2024-09-29T21:41:08.182Z (about 1 month ago)
- Language: Swift
- Homepage:
- Size: 62.5 KB
- Stars: 58
- Watchers: 10
- Forks: 17
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# SwiftStatsDClient
a metrics backend for [swift-metrics](https://github.com/apple/swift-metrics) that uses the [statsd](https://github.com/b/statsd_spec) protocol, and can be used to integrate applications with observability solutions that support `statsd` including:
* [AWS](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-custom-metrics-statsd.html)
* [Azure](https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-platform)
* [Google Cloud](https://cloud.google.com/monitoring/agent/plugins/statsd)
* [IBM Cloud](https://cloud.ibm.com/catalog/services/ibm-cloud-monitoring-with-sysdig)
* [Grafana](https://grafana.com)
* [Graphite](https://graphiteapp.org)
* Many others## Getting started
Create an instance of the `StatsdClient` and boostrap the `MetricsSystem` in your application's `main`:
```swift
let statsdClient = try StatsdClient(host: host, port: port)
MetricsSystem.bootstrap(statsdClient)
```See [selecting a metrics backend implementation](https://github.com/apple/swift-metrics#selecting-a-metrics-backend-implementation-applications-only) for more information.
Remember to also shutdown the client before you application terminates:
```swift
statsdClient.shutdown()
```## Architecture
`StatsdClient` uses [SwiftNIO](https://github.com/apple/swift-nio) 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](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