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

Chris M. Hostetter commented on SOLR-10654:
-------------------------------------------

{quote}In the PR, I have a regex to try and remove some of the JVM 
implementations but seems as it's not enough.
{quote}
For {{{}TestPrometheusResponseWriter{}}}...

You need to just plain kill the "equals" assertion against 
{{solr-prometheus-output.txt}} ... no matter how many regex tricks you try, 
that's way to brittle to survive future additions/tweaks to the metrics solr 
supports.  The test needs to parse the "actual" response and make some basic 
assertions about the _structure_ it finds, and if there are certain metrics 
that should *always* be present, assert they exist with values that are _valid_ 
 (ie: can be parsed as an int, or can be parsed as a float) w/o asserting 
exactly what those values are.

But under no circumstances should you assert that you know the full list of 
every metrics that _might_ someday exist in solr/jetty.

(this would also be a good place register dummy metrics with fake names that 
you can easily assert have _specific_ expect values)

 

For {{MetricsHandlerTest.testPrometheusMetricsJvm}}...

{code}
s/assertEquals(0, /assertNotNull(/
{code}

> 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: 7h 20m
>  Remaining Estimate: 0h
>
> Expose metrics via a `wt=prometheus` response type.
> Example scape_config in prometheus.yml:
> {code:java}
> scrape_configs:
>   - job_name: 'solr'
>     metrics_path: '/solr/admin/metrics'
>     params:
>       wt: ["prometheus"]
>     static_configs:
>       - targets: ['localhost:8983']
> {code}
> [Rationale|https://issues.apache.org/jira/browse/SOLR-11795?focusedCommentId=17261423&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17261423]
>  for having this despite the "Prometheus Exporter".  They have different 
> strengths and weaknesses.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to