You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,22 @@ let myProm = PrometheusClient()
27
27
## Usage with SwiftMetrics
28
28
_For more details about swift-metrics, please view [the GitHub repo](https://github.com/apple/swift-metrics)._
29
29
30
+
Starting with SwiftPrometheus [1.0.0-alpha.10](https://github.com/MrLotU/SwiftPrometheus/releases/tag/1.0.0-alpha.10)`MetricsSystem` is no longer directly configured with a `PrometheusClient`.
31
+
32
+
Instead, create a `PrometheusMetricsFactory` instance wrapping a `PrometheusClient`.
Along with a `PrometheusClient`, `PrometheusMetricsFactory` can take a `Configuration` object setting the following properties:
40
+
- A `LabelSanitizer` used to sanitize metric names to valid Prometheus values. A default implementation is provided.
41
+
- The Prometheus metric type to use for swift-metrics' `Timer`. Can be a `Histogram` or a `Summary`. Note that when using `Histogram`, `preferredDisplayUnit` will not be observed.
42
+
- Default buckets for use by aggregating swift-metrics `Recorder` instances.
43
+
44
+
### Before Alpha 10
45
+
30
46
To use SwiftPrometheus with swift-metrics, you need to configure the backend inside the `MetricsSystem`:
0 commit comments