-
Notifications
You must be signed in to change notification settings - Fork 748
SOLR-17806: Migrate ADMIN node registry metrics to OTEL #3444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOLR-17806: Migrate ADMIN node registry metrics to OTEL #3444
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Prometheus expose these counts as floating point instead as integer (long)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice to finally see just otel and not also dropwizard simultaneously
} | ||
} | ||
} | ||
|
||
private Double getSelectRequestCount(SolrCore core) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a Double
instead of long
?
solr/solrj/src/test/org/apache/solr/client/solrj/SolrJMetricTestUtils.java
Show resolved
Hide resolved
SolrRequest.METHOD.GET, | ||
"/admin/metrics", | ||
SolrRequest.SolrRequestType.ADMIN, | ||
new ModifiableSolrParams().set("wt", "prometheus")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI try SolrParams.of("wt", "prometheus")
|
||
// Sum both client and server errors | ||
return line.stream() | ||
.map(s -> Double.parseDouble(s.substring(s.lastIndexOf(" ") + 1).trim())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see Stream.mapToDouble
and Stream.mapToLong
System.out.println(namedList); | ||
NamedList<?> metrics = (NamedList<?>) namedList.get("metrics"); | ||
assertEquals(1L, metrics.get(updateRequestCountKey)); | ||
assertEquals(1.0, getPrometheusMetricValue(solrClient, prometheusMetric), 0.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice utility method
return output | ||
.lines() | ||
.filter(l -> l.startsWith(metricName)) | ||
.mapToDouble(s -> Double.parseDouble(s.substring(s.lastIndexOf(" ") + 1).trim())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plus one results in a space that you then remove with a trim. So can't you skip both and simplify?
https://issues.apache.org/jira/browse/SOLR-17806
Migrate node registry ADMIN metrics and remove Dropwizard initializations from
RequestHandlerBase
.This does not include
aggregateNodeLevelMetricsEnabled