Closed obenkenobi closed 7 months ago
Attention: Patch coverage is 85.71429%
with 12 lines
in your changes are missing coverage. Please review.
Project coverage is 70.89%. Comparing base (
9aee916
) to head (53f531c
). Report is 4 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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
https://github.com/newrelic/newrelic-java-agent/issues/1571