Skip to content

Commit 36eed4d

Browse files
committed
fix units for solr jmx metrics
1 parent 9cf28ad commit 36eed4d

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

jmx-metrics/src/integrationTest/java/io/opentelemetry/contrib/jmxmetrics/target_systems/SolrIntegrationTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ void endToEnd() {
4343
metric,
4444
"solr.document.count",
4545
"The total number of indexed documents.",
46-
"{documents}",
46+
"{document}",
4747
attrs -> attrs.containsOnly(entry("core", "gettingstarted"))),
4848
metric ->
4949
assertSumWithAttributes(
5050
metric,
5151
"solr.index.size",
5252
"The total index size.",
53-
"by",
53+
"By",
5454
attrs -> attrs.containsOnly(entry("core", "gettingstarted"))),
5555
metric ->
5656
assertSolrRequestSumMetric(
57-
metric, "solr.request.count", "The number of queries made.", "{queries}"),
57+
metric, "solr.request.count", "The number of queries made.", "{query}"),
5858
metric ->
5959
assertSolrRequestGaugeMetric(
6060
metric,
@@ -66,37 +66,37 @@ void endToEnd() {
6666
metric,
6767
"solr.request.error.count",
6868
"The number of queries resulting in an error.",
69-
"{queries}"),
69+
"{query}"),
7070
metric ->
7171
assertSolrRequestSumMetric(
7272
metric,
7373
"solr.request.timeout.count",
7474
"The number of queries resulting in a timeout.",
75-
"{queries}"),
75+
"{query}"),
7676
metric ->
7777
assertSolrCacheSumMetric(
7878
metric,
7979
"solr.cache.eviction.count",
8080
"The number of evictions from a cache.",
81-
"{evictions}"),
81+
"{eviction}"),
8282
metric ->
8383
assertSolrCacheSumMetric(
84-
metric, "solr.cache.hit.count", "The number of hits for a cache.", "{hits}"),
84+
metric, "solr.cache.hit.count", "The number of hits for a cache.", "{hit}"),
8585
metric ->
8686
assertSolrCacheSumMetric(
8787
metric,
8888
"solr.cache.insert.count",
8989
"The number of inserts to a cache.",
90-
"{inserts}"),
90+
"{insert}"),
9191
metric ->
9292
assertSolrCacheSumMetric(
9393
metric,
9494
"solr.cache.lookup.count",
9595
"The number of lookups to a cache.",
96-
"{lookups}"),
96+
"{lookup}"),
9797
metric ->
9898
assertSolrCacheSumMetric(
99-
metric, "solr.cache.size", "The size of the cache occupied in memory.", "by"));
99+
metric, "solr.cache.size", "The size of the cache occupied in memory.", "By"));
100100
}
101101

102102
private void assertSolrRequestSumMetric(

jmx-metrics/src/main/resources/target-systems/solr.groovy

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@
1515
*/
1616

1717
def beanSolrCoreSearcherNumDocs = otel.mbeans("solr:dom1=core,dom2=*,category=SEARCHER,scope=searcher,name=numDocs")
18-
otel.instrument(beanSolrCoreSearcherNumDocs, "solr.document.count", "The total number of indexed documents.", "{documents}",
18+
otel.instrument(beanSolrCoreSearcherNumDocs, "solr.document.count", "The total number of indexed documents.", "{document}",
1919
["core" : { mbean -> mbean.name().getKeyProperty("dom2") }],
2020
"Value", otel.&longUpDownCounterCallback)
2121

2222
def beanSolrCoreIndexSize = otel.mbeans("solr:dom1=core,dom2=*,category=INDEX,name=sizeInBytes")
23-
otel.instrument(beanSolrCoreIndexSize, "solr.index.size", "The total index size.", "by",
23+
otel.instrument(beanSolrCoreIndexSize, "solr.index.size", "The total index size.", "By",
2424
["core" : { mbean -> mbean.name().getKeyProperty("dom2") }],
2525
"Value", otel.&longUpDownCounterCallback)
2626

2727
def beanSolrCoreRequests = otel.mbeans(["solr:dom1=core,dom2=*,category=QUERY,scope=*,name=requests",
2828
"solr:dom1=core,dom2=*,category=UPDATE,scope=*,name=requests"])
29-
otel.instrument(beanSolrCoreRequests, "solr.request.count", "The number of queries made.", "{queries}",
29+
otel.instrument(beanSolrCoreRequests, "solr.request.count", "The number of queries made.", "{query}",
3030
["core" : { mbean -> mbean.name().getKeyProperty("dom2") },
3131
"type" : { mbean -> mbean.name().getKeyProperty("category") },
3232
"handler" : { mbean -> mbean.name().getKeyProperty("scope") }],
@@ -44,38 +44,38 @@ otel.instrument(beanSolrCoreRequestTimes, "solr.request.time.average",
4444

4545
def beanSolrCoreErrors = otel.mbeans(["solr:dom1=core,dom2=*,category=QUERY,scope=*,name=errors",
4646
"solr:dom1=core,dom2=*,category=UPDATE,scope=*,name=errors"])
47-
otel.instrument(beanSolrCoreErrors, "solr.request.error.count", "The number of queries resulting in an error.", "{queries}",
47+
otel.instrument(beanSolrCoreErrors, "solr.request.error.count", "The number of queries resulting in an error.", "{query}",
4848
["core" : { mbean -> mbean.name().getKeyProperty("dom2") },
4949
"type" : { mbean -> mbean.name().getKeyProperty("category") },
5050
"handler" : { mbean -> mbean.name().getKeyProperty("scope") }],
5151
"Count", otel.&longCounterCallback)
5252

5353
def beanSolrCoreTimeouts = otel.mbeans(["solr:dom1=core,dom2=*,category=QUERY,scope=*,name=timeouts",
5454
"solr:dom1=core,dom2=*,category=UPDATE,scope=*,name=timeouts"])
55-
otel.instrument(beanSolrCoreTimeouts, "solr.request.timeout.count", "The number of queries resulting in a timeout.", "{queries}",
55+
otel.instrument(beanSolrCoreTimeouts, "solr.request.timeout.count", "The number of queries resulting in a timeout.", "{query}",
5656
["core" : { mbean -> mbean.name().getKeyProperty("dom2") },
5757
"type" : { mbean -> mbean.name().getKeyProperty("category") },
5858
"handler" : { mbean -> mbean.name().getKeyProperty("scope") }],
5959
"Count", otel.&longCounterCallback)
6060

6161
def beanSolrCoreQueryResultsCache = otel.mbeans("solr:dom1=core,dom2=*,category=CACHE,scope=*,name=queryResultCache")
62-
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.eviction.count", "The number of evictions from a cache.", "{evictions}",
62+
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.eviction.count", "The number of evictions from a cache.", "{eviction}",
6363
["core" : { mbean -> mbean.name().getKeyProperty("dom2") },
6464
"cache" : { mbean -> mbean.name().getKeyProperty("scope") }],
6565
"cumulative_evictions", otel.&longCounterCallback)
66-
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.hit.count", "The number of hits for a cache.", "{hits}",
66+
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.hit.count", "The number of hits for a cache.", "{hit}",
6767
["core" : { mbean -> mbean.name().getKeyProperty("dom2") },
6868
"cache" : { mbean -> mbean.name().getKeyProperty("scope") }],
6969
"cumulative_hits", otel.&longCounterCallback)
70-
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.insert.count", "The number of inserts to a cache.", "{inserts}",
70+
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.insert.count", "The number of inserts to a cache.", "{insert}",
7171
["core" : { mbean -> mbean.name().getKeyProperty("dom2") },
7272
"cache" : { mbean -> mbean.name().getKeyProperty("scope") }],
7373
"cumulative_inserts", otel.&longCounterCallback)
74-
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.lookup.count", "The number of lookups to a cache.", "{lookups}",
74+
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.lookup.count", "The number of lookups to a cache.", "{lookup}",
7575
["core" : { mbean -> mbean.name().getKeyProperty("dom2") },
7676
"cache" : { mbean -> mbean.name().getKeyProperty("scope") }],
7777
"cumulative_lookups", otel.&longCounterCallback)
78-
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.size", "The size of the cache occupied in memory.", "by",
78+
otel.instrument(beanSolrCoreQueryResultsCache, "solr.cache.size", "The size of the cache occupied in memory.", "By",
7979
["core" : { mbean -> mbean.name().getKeyProperty("dom2") },
8080
"cache" : { mbean -> mbean.name().getKeyProperty("scope") }],
8181
"ramBytesUsed", otel.&longUpDownCounterCallback)

0 commit comments

Comments
 (0)