Skip to content

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

Merged
janhoy merged 4 commits into
apache:mainfrom
janhoy:SOLR-18165-More-dot-separated-metric-names
May 19, 2026
Merged

SOLR-18165 Complete dot-separated metric name migration#4284
janhoy merged 4 commits into
apache: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
solr_zk_child_fetches solr.zk.get_children.ops
solr_zk_cumulative_children_fetched Discontinued

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 thread solr/core/src/java/org/apache/solr/core/ZkContainer.java
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...

@mlbiscoc
Copy link
Copy Markdown
Contributor

mlbiscoc commented Apr 28, 2026

Hey @janhoy sorry, just realized I missed this PR.

Do you agree with the name mappings above?

Mappings LGTM

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?

I took a deeper look at the collections and I don't think they talk about the same thing and I named them incorrectly. solr_zk_child_fetches fetched the number of getChildren calls:
childFetches.increment();

while solr_zk_cumulative_children_fetched got the number of actual child nodes across all of the operations.
cumulativeChildrenFetched.add(trace.getResponseChildrenCount());

WDYT of solr_zk_child_fetches -> solr.zk.get_children.ops and solr_zk_cumulative_children_fetched -> solr.zk.children.fetched? But then also would someone even care about the total number of solr.zk.children_fetched from a Solr perspective? I would probably just drop that metric now that I think of it but idk maybe someone thinks otherwise.

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?

CC @sigram. We should add solr. prefix. Tbh I don't know enough about the crossdc module but to me seems like we don't need core there.

To answer your "breaking changes" question, yes I think we should just make the changes. The mailing list was already sent out about breaking changes on metrics so we should continue to go forward with it. I can see it being debatable if we did a drastic metric name overhaul across everything but a few here that are ZK metrics and the cross DC module should be fine.

@dsmiley dsmiley requested a review from sigram May 9, 2026 04:11
Remove solr_zk_cumulative_children_fetched
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests cat:metrics labels May 12, 2026
@janhoy
Copy link
Copy Markdown
Contributor Author

janhoy commented May 12, 2026

CC @sigram. We should add solr. prefix. Tbh I don't know enough about the crossdc module but to me seems like we don't need core there.

Proposal: Rename CrossDC metric names

Following @mlbiscoc's suggestion — add solr. prefix to consumer metrics and remove the spurious .core. segment from producer metrics. This makes both sides symmetric under solr.crossdc.*.

Consumer: crossdc.consumer.solr.crossdc.consumer.

Old New
crossdc.consumer.input.msg.total solr.crossdc.consumer.input.msg.total
crossdc.consumer.input.req.total solr.crossdc.consumer.input.req.total
crossdc.consumer.collapsed.total solr.crossdc.consumer.collapsed.total
crossdc.consumer.output.total solr.crossdc.consumer.output.total
crossdc.consumer.output.batch_size solr.crossdc.consumer.output.batch_size
crossdc.consumer.output.backoff_time solr.crossdc.consumer.output.backoff_time
crossdc.consumer.output.time solr.crossdc.consumer.output.time
crossdc.consumer.output.first_attempt_time solr.crossdc.consumer.output.first_attempt_time

Prometheus gains a solr_ prefix: crossdc_consumer_output_totalsolr_crossdc_consumer_output_total

Producer: solr.core.crossdc.producer.solr.crossdc.producer.

Old New
solr.core.crossdc.producer.local.processed solr.crossdc.producer.local.processed
solr.core.crossdc.producer.submitted solr.crossdc.producer.submitted
solr.core.crossdc.producer.submitted.add solr.crossdc.producer.submitted.add
solr.core.crossdc.producer.submitted.delete_by_id solr.crossdc.producer.submitted.delete_by_id
solr.core.crossdc.producer.submitted.delete_by_query solr.crossdc.producer.submitted.delete_by_query
solr.core.crossdc.producer.submitted.commit solr.crossdc.producer.submitted.commit
solr.core.crossdc.producer.document_size solr.crossdc.producer.document_size
solr.core.crossdc.producer.doc_too_large_errors solr.crossdc.producer.doc_too_large_errors

Prometheus: solr_core_crossdc_producer_*solr_crossdc_producer_*

@sigram
Copy link
Copy Markdown
Contributor

sigram commented May 13, 2026

@mlbiscoc yes, it makes sense to drop the "core" segment in the names.

…re. from producer

Consumer: crossdc.consumer.* → solr.crossdc.consumer.*
Producer: solr.core.crossdc.producer.* → solr.crossdc.producer.*

Both sides are now symmetric under solr.crossdc.*
@janhoy
Copy link
Copy Markdown
Contributor Author

janhoy commented May 14, 2026

I pushed the crossdc changes. Will merge and backport this PR to 10x next week Tuesday if no objections.

Copy link
Copy Markdown
Contributor

@mlbiscoc mlbiscoc left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks Jan for cleaning up some of my mess :)

@janhoy
Copy link
Copy Markdown
Contributor Author

janhoy commented May 15, 2026

LGTM! Thanks Jan for cleaning up some of my mess :)

Not at all Matthew :) Looking forward to completing the new grafana dashboards...

@janhoy janhoy merged commit 193b2e5 into apache:main May 19, 2026
5 checks passed
@janhoy janhoy deleted the SOLR-18165-More-dot-separated-metric-names branch May 19, 2026 11:52
janhoy added a commit that referenced this pull request May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants