Swiftpack.co -  apple/swift-statsd-client as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
apple/swift-statsd-client
metrics backend for swift-metrics that uses the statsd protocol
.package(url: "https://github.com/apple/swift-statsd-client.git", from: "1.0.0-alpha.4")

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

GitHub

link
Stars: 37
Last commit: 3 days ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

1.0.0-alpha.4
1 year ago

Introduces MetricNameSanitizer and enables it by default, allowing statsd-client to be used directly with Vapor apps (as their metric labels may include : which was causing trouble).

See #21 for details.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API