Skip to content

SOLR-18165 Complete dot-separated metric name migration#4284

Open
janhoy wants to merge 2 commits intoapache:mainfrom
janhoy:SOLR-18165-More-dot-separated-metric-names
Open

SOLR-18165 Complete dot-separated metric name migration#4284
janhoy wants to merge 2 commits intoapache:mainfrom
janhoy:SOLR-18165-More-dot-separated-metric-names

Conversation

@janhoy
Copy link
Copy Markdown
Contributor

@janhoy janhoy commented Apr 15, 2026

https://issues.apache.org/jira/browse/SOLR-18165

PR #4223 converted the majority of Solr metric instrument names from underscore_delimited
to dot.separated OTel standard naming. Several files were missed or only partially converted.
This PR completes that work.

Files changed

AuditLoggerPlugin.java — all 7 metric names were still in old solr_auditlogger_* format;
converted to solr.auditlogger.*.

CaffeineCache.java — the default base metric name "solr_caffeine_cache" and the five
metric name suffixes (_lookups, _ops, _size, _ram_used, _warmup_time) were still using
underscores as namespace separators. Converted to "solr.caffeine_cache" base with
dot-prefixed suffixes (.lookups, .ops, .size, .ram_used, .warmup_time).

ZkContainer.java — all 7 metrics still in old solr_zk_* format; converted to solr.zk.*.

OtelMetrics.java (cross-dc-manager) — all 8 metric names were in old crossdc_consumer_*
format. The NAME_PREFIX constant is updated to "crossdc.consumer." and all suffix strings
are converted to dot-separated.

Metric name mapping

Old name New name Comments
solr_auditlogger_count solr.auditlogger.count
solr_auditlogger_errors solr.auditlogger.errors
solr_auditlogger_lost solr.auditlogger.lost
solr_auditlogger_request_times solr.auditlogger.request_times Leaf kept as compound word
solr_auditlogger_queue solr.auditlogger.queue
solr_auditlogger_queued_time solr.auditlogger.queued_time Leaf kept as compound word
solr_auditlogger_async_enabled solr.auditlogger.async_enabled Leaf kept as compound word
solr_caffeine_cache_lookups solr.caffeine_cache.lookups caffeine_cache is the cache type name
solr_caffeine_cache_ops solr.caffeine_cache.ops
solr_caffeine_cache_size solr.caffeine_cache.size
solr_caffeine_cache_ram_used solr.caffeine_cache.ram_used Leaf kept as compound word
solr_caffeine_cache_warmup_time solr.caffeine_cache.warmup_time Leaf kept as compound word
solr_zk_ops solr.zk.ops
solr_zk_read solr.zk.read
solr_zk_watches_fired solr.zk.watches_fired Leaf kept as compound word
solr_zk_written solr.zk.written
solr_zk_cumulative_multi_ops_total solr.zk.cumulative.multi_ops.total Leaf kept as compound word;
solr_zk_child_fetches solr.zk.child.fetches
solr_zk_cumulative_children_fetched solr.zk.cumulative.children_fetched Leaf kept as compound word
crossdc_consumer_input_msg_total crossdc.consumer.input.msg.total Consider _total?
crossdc_consumer_input_req_total crossdc.consumer.input.req.total
crossdc_consumer_collapsed_total crossdc.consumer.collapsed.total
crossdc_consumer_output_total crossdc.consumer.output.total
crossdc_consumer_output_batch_size crossdc.consumer.output.batch_size Leaf kept as compound word
crossdc_consumer_output_backoff_time crossdc.consumer.output.backoff_time Leaf kept as compound word
crossdc_consumer_output_time crossdc.consumer.output.time
crossdc_consumer_output_first_attempt_time crossdc.consumer.output.first_attempt_time Leaf kept as compound word

Questions:

  • Do you agree with the name mappings above?
  • The two existing solr_zk_child_fetches and solr_zk_cumulative_children_fetched both talk about the same thing, only cumulative is total? So a bit strange that they use child_fetches vs children_fetched. Should solr.zk.child.fetches instead be solr.zk.child_fetches to align with solr_zk_cumulative_children_fetched? Or should we do a breaking change here and align naming?
  • The crossdc consumer metrics do not have a solr. prefix. The corresponsing producer metrics use solr.core.crossdc.producer.XXX. So ideally consumer would also use solr.core.crossdc.consumer.XXX. Or why the core part in there? Should we do a breaking change here, for one or for both?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Completes the remaining OpenTelemetry metric instrument renames from underscore-delimited names to dot-separated names as part of SOLR-18165.

Changes:

  • Migrates AuditLoggerPlugin metric names to solr.auditlogger.*.
  • Migrates CaffeineCache metric base name and suffixes to solr.caffeine_cache.*.
  • Migrates ZooKeeper metrics in ZkContainer to solr.zk.*, and cross-dc consumer metrics to crossdc.consumer.*.
  • Adds an unreleased changelog entry for this follow-up migration.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
solr/cross-dc-manager/src/java/org/apache/solr/crossdc/manager/consumer/OtelMetrics.java Renames cross-dc consumer OTel instrument names to dot-separated format.
solr/core/src/java/org/apache/solr/security/AuditLoggerPlugin.java Renames audit logger OTel instrument names to solr.auditlogger.*.
solr/core/src/java/org/apache/solr/search/CaffeineCache.java Renames caffeine cache OTel instrument base name and suffixes to dot-separated format.
solr/core/src/java/org/apache/solr/core/ZkContainer.java Renames ZooKeeper OTel instrument names to solr.zk.*.
changelog/unreleased/SOLR-18165-More-dot-separated-metric-names.yml Adds changelog entry documenting the additional metric renames.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread solr/core/src/java/org/apache/solr/search/CaffeineCache.java Outdated
Comment on lines 208 to 213
ctx.observableLongCounter(
"solr_zk_child_fetches",
"solr.zk.child.fetches",
"Total number of ZooKeeper child node fetches",
measurement -> {
measurement.record(metricsListener.getChildFetches(), attributes);
});
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metric name solr.zk.child.fetches introduces an extra hierarchy level (childfetches) even though the pre-migration name treated this as a single compound concept (child_fetches). In this same block, other compound leaves keep underscores (e.g. watches_fired, children_fetched, multi_ops), so this one stands out and makes the naming inconsistent. Consider using solr.zk.child_fetches instead to keep the compound token intact (and keep the mapping closer to the previous name).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I also commented in the Questions section above. So probably use child_fetches.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@janhoy
Copy link
Copy Markdown
Contributor Author

janhoy commented Apr 15, 2026

@chan-dx I ping you here since I could not add you as reviewer...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants