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
Is there a way to aggregate clusterMetrics() result with default register.metrics
metricsServer.get('/metrics',(req,res)=>{aggregatorRegistry.clusterMetrics().then(metrics=>{res.set('Content-Type',aggregatorRegistry.contentType)// How to merge 'metrics' with register.metrics ?res.send(metrics))}).catch(err=>{error(err)returnres.status(500).end(err)})})
@miton18 Since the Prometheus metrics format is plain text, I think that you can just concatenate the string from aggregatorRegistry.clusterMetrics() with the string from masterRegistry.metrics(). From your example (untested):
Activity
SimenB commentedon Mar 28, 2018
I've never used the cluster code, @zbjornson?
miton18 commentedon Mar 28, 2018
Is there a way to aggregate clusterMetrics() result with default register.metrics
zbjornson commentedon Mar 29, 2018
@miton18 Since the Prometheus metrics format is plain text, I think that you can just concatenate the string from
aggregatorRegistry.clusterMetrics()with the string frommasterRegistry.metrics(). From your example (untested):miton18 commentedon Mar 29, 2018
Yes we can... and it's works ;-)
But I asking if it wasn't interesting to natively add Master metrics with workers ones ?
zbjornson commentedon Mar 29, 2018
Ah, probably! Happy to review a PR for that.
brian-brazil commentedon Apr 3, 2018
This will only work if there is no overlap between the metrics, otherwise you could end up with invalid output.
[-]Allow master to add this own metrics[/-][+]Allow master to add its own metrics[/+]vbrvk commentedon Apr 29, 2020
There are any updates? It would be nice to have #280 merged
zbjornson commentedon Jan 23, 2021
#280 just need tests. If anyone here can contribute a test, we can get that PR landed!
Merge master registries with cluster workers (prometheus#183)
Export stats from the primary thread.
Export stats from the primary thread.
Export stats from the primary thread.
Export stats from the primary thread.
Export stats from the primary thread.
Export stats from the primary thread.
Export stats from the primary thread.
Export stats from the primary thread.
Export stats from the primary thread.
Export stats from the primary thread.
Export stats from the primary thread.