Closed xdrew closed 4 years ago
Well, you may use prometheus_metrics_bundle.collector_registry
service via DI and write the metrics directly. Is there any problem with using the registry service?
Yep.
The service "App\Utils\MetricUtils" has a dependency on a non-existent service "prometheus_metrics_bundle.collector_registry".
Do I need to decorate it or create a similar compiler pass?
I think, for it to work you should have your command as a service. Here you can find a similar issue with more details: https://github.com/FriendsOfSymfony/FOSElasticaBundle/issues/1271
Hello!
Is it possible to somehow get access to collectionRegistry in my code without implementing MetricsGeneratorInterface? My metrics do not depend on requests/responses. They come from commands running as daemons. Once something happens, I just want to update my counters, gauges in that registry, but it doesn't seem to be accessible via DI. Any ideas?
Thanks in advance.