Open Tyler-Keith-Thompson opened 1 year ago
My temporary workaround:
struct PrometheusClientKey: StorageKey {
typealias Value = PrometheusClient
}
extension Application {
var prometheusClient: PrometheusClient? {
get { storage[PrometheusClientKey.self] }
set { storage[PrometheusClientKey.self] = newValue }
}
}
I can just attach the client to the application. It's probably suboptimal, but fits my use-case for now.
Steps to reproduce
Prometheus makes a few too many assumptions about my metrics system factory. I use the multiplex factory that comes from Apple and bootstrap prometheus with it, but then this code tries to cast the multiplexed factory and fails:
Expected behavior
No error is thrown...cause it was in fact bootstrapped
Actual behavior
It throws the error
Environment