Combine multiple collectors into one that fans out every call to all of them.
Combine multiple collectors into one that fans out every call to all of them.
Every method of the trait is forwarded, the image-generation ones included; a collector that throws does not stop the others. A method added to the trait must be forwarded here too - MetricsCollectorComposeSpec fails otherwise.
Useful for running a CostTracker (in llm4s-observability) alongside PrometheusMetrics (in llm4s-observability-prometheus):
val combined = MetricsCollector.compose(prometheusMetrics, costTracker)
val client = LLMConnect.getClient(config, combined)