[ 
https://issues.apache.org/jira/browse/SOLR-10654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17799191#comment-17799191
 ] 

Matthew Biscocho commented on SOLR-10654:
-----------------------------------------

So I found some time to look more into a solution to implement these metrics 
and ran into a few problems mostly around Solr metric collection with 
Dropwizard.

I took a first approach by taking Solr Dropwizard Registry and coverting it 
with a Util function from the prometheus client library to a Prometheus 
Registry and use that output in new response writer I made. Doing so gave an 
output that looks like so [^prometheus_metrics.txt]. 

I ran into the first issue in that 1 to 1 naming from Dropwizard isn't very 
useful and doesn't follow [prometheus recommended naming convention. 
|https://prometheus.io/docs/practices/naming/] The bigger issue is that 
Dropwizard doesn't support tagging metrics and without tags/label essentially 
makes these metrics useless for aggregation across Solr nodes.

So based on this, the only other way I can find to expose these metrics from 
Solr was to either:
1. Create a separate [Prometheus 
Registry|https://prometheus.github.io/client_java/getting-started/registry/] 
next to the existing Dropwizard Registry and collect these Solr metrics in 
parallel but with Prometheus having its own naming convention and applying 
tags/labels

2. Possibly migrate off of Dropwizard and migrate to Micrometer as the new 
default registry as it supports metric tagging. I did some research on 
Micrometer and it looks to support [prometheus and a lot of other monitoring 
systems|https://micrometer.io/docs/concepts#_supported_monitoring_systems] 
making it possible to output micrometer in prometheus format.

I'm still newish to the Solr code base but was hoping to get someone who has 
experience with metrics in Solr ( maybe [~dsmiley] ) to discuss possible other 
approaches before going forward and help choose the best?

> Expose Metrics in Prometheus format DIRECTLY from Solr
> ------------------------------------------------------
>
>                 Key: SOLR-10654
>                 URL: https://issues.apache.org/jira/browse/SOLR-10654
>             Project: Solr
>          Issue Type: Improvement
>          Components: metrics
>            Reporter: Keith Laban
>            Priority: Major
>         Attachments: prometheus_metrics.txt
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Expose metrics via a `wt=prometheus` response type.
> Example scape_config in prometheus.yml:
> {code}
> scrape_configs:
>   - job_name: 'solr'
>     metrics_path: '/solr/admin/metrics'
>     params:
>       wt: ["prometheus"]
>     static_configs:
>       - targets: ['localhost:8983']
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to