-
Notifications
You must be signed in to change notification settings - Fork 149
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
Enhance Solr 7+ JMX metrics by including clustered Solr collections which include the collection name, shard name, and (replica) core #1812
Conversation
newrelic-agent/src/main/java/com/newrelic/agent/config/JmxConfigImpl.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1812 +/- ##
=========================================
Coverage 70.89% 70.89%
- Complexity 9956 9965 +9
=========================================
Files 827 828 +1
Lines 39880 39955 +75
Branches 6043 6053 +10
=========================================
+ Hits 28272 28327 +55
- Misses 8887 8896 +9
- Partials 2721 2732 +11 ☔ View full report in Codecov by Sentry. |
The pekko AIT failing is because this branch does not have the pekko instrumentation which is in another PR. So when all other tests pass, this branch will be merged. |
Overview
Allow the agent to capture clustered Solr cores via our JMX API .
Single instances of Solr will contain function the same.
In clustered Solr cores, their JMX MBeans will look like
solr:dom1=core,dom2=dummy_collection,dom3=shard2,dom4=replica_n2,category=CACHE,scope=searcher,name=documentCache
which the agent did not capture.Now the agent will export Solr values with nested DOM (i.e. clustered cores) in the formats:
Fpr example:
JMX/solr/dummy_collection.shard2.replica_n2/documentCache/%/
The Solr UI will recognize the cores in the format
{collection name}.{shard}.{core name}
New Iteration Syntax Internal To The Agent
This is done by adding new iteration syntax for object name keys for MBeans when formatting them into agent metrics.
You may see it in any class that extends
com.newrelic.agent.jmx.metrics.JmxFrameworkValues
in thenewrelic-agent
module.To see this in practice, we will query an MBean from JMX with Solr using the string:
which may return an MBean with an object name like:
We take a metric name with the format
JMX/solr/{for:dom[2::.]}/documentCache/%/
such that it becomes the metricJMX/solr/dummy_collection.shard2.replica_n2/documentCache/%/
We can use this metric syntax in other ways such that
JMX/solr/{for:dom[2:4:.]}/documentCache/%/
can translate toJMX/solr/dummy_collection.shard2.documentCache/%/
In the format we see the following placeholder
{for:dom[start:end:delimiter]}
wherefor:
indicate some iterable object name keys and[start:end]
represents some range wherestart
is the start number andend
represents an optional exclusive end of the range.[start::delimiter]
means theend
is unbounded. This is similar to python syntax you may have with accessing sublists. Thedelimiter
represents a string that will join the iterated values in a sequence. If left empty, it will default to/
.Currently the solution will work with positive numbers for simplicity but we can eventually extend this to more characters.
Since the syntax is new and there maybe unexpected side effects, we will include new undocumented temporarily configuration to disable it for Solr:
yaml:
system property:
environment variable:
By default the configuration is true. To disable the syntax, set it to false.
Related Github Issue
#1571