-
Notifications
You must be signed in to change notification settings - Fork 763
SOLR-17806: Migrate DirectUpdateHandler2 metrics to OTEL #3417
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
Changes from 2 commits
8ed6c85
58c6eec
44265eb
7752dfd
1e43bef
fc0a690
6d2e761
eeac8f8
d08dcb3
5f344f5
4b21e68
15eab76
acf902d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
|
||
import com.carrotsearch.randomizedtesting.annotations.Repeat; | ||
import com.codahale.metrics.Meter; | ||
import io.prometheus.metrics.model.snapshots.GaugeSnapshot; | ||
import io.prometheus.metrics.model.snapshots.Labels; | ||
import java.io.IOException; | ||
import java.lang.invoke.MethodHandles; | ||
import java.nio.file.Files; | ||
|
@@ -576,43 +576,31 @@ public void testOnlyLeaderIndexes() throws Exception { | |
|
||
{ | ||
SolrCore core = getSolrCore(true).getFirst(); | ||
var reader = | ||
core.getSolrMetricsContext() | ||
.getMetricManager() | ||
.getPrometheusMetricReader( | ||
getSolrCore(true).getFirst().getCoreMetricManager().getRegistryName()); | ||
var actual = | ||
(GaugeSnapshot.GaugeDataPointSnapshot) | ||
SolrMetricTestUtils.getDataPointSnapshot( | ||
reader, | ||
"solr_metrics_core_update_pending_operations", | ||
SolrMetricTestUtils.getCloudLabelsBase(core) | ||
.get() | ||
.label("category", "UPDATE") | ||
.label("operation", "docs_pending") | ||
.build()); | ||
SolrMetricTestUtils.getGaugeDatapoint( | ||
core, | ||
"solr_core_update_docs_pending_commit", | ||
Labels.builder() | ||
.label("category", "UPDATE") | ||
.label("operation", "docs_pending") | ||
.build(), | ||
true); | ||
assertEquals( | ||
"Expected 4 docs are pending in core " + getSolrCore(true).get(0).getCoreDescriptor(), | ||
4, | ||
(long) actual.getValue()); | ||
} | ||
|
||
for (SolrCore solrCore : getSolrCore(false)) { | ||
var reader = | ||
solrCore | ||
.getSolrMetricsContext() | ||
.getMetricManager() | ||
.getPrometheusMetricReader(solrCore.getCoreMetricManager().getRegistryName()); | ||
var actual = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this statement is lacking some elegance. If this pattern repeats itself; we should seek an improvement There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok so I overhauled the util method a bit for getting metrics in |
||
(GaugeSnapshot.GaugeDataPointSnapshot) | ||
SolrMetricTestUtils.getDataPointSnapshot( | ||
reader, | ||
"solr_metrics_core_update_pending_operations", | ||
SolrMetricTestUtils.getCloudLabelsBase(solrCore) | ||
.get() | ||
.label("category", "UPDATE") | ||
.label("operation", "docs_pending") | ||
.build()); | ||
SolrMetricTestUtils.getGaugeDatapoint( | ||
solrCore, | ||
"solr_core_update_docs_pending_commit", | ||
Labels.builder() | ||
.label("category", "UPDATE") | ||
.label("operation", "docs_pending") | ||
.build(), | ||
true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: booleans like here are inscrutable when reviewing code. Not a big deal though |
||
assertEquals( | ||
"Expected non docs are pending in core " + solrCore.getCoreDescriptor(), | ||
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.
that'd be "ops" now?
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.
I was doing a
hasSameValues
instead ofequals
which is why it was still passing. Should be fixed now.