Skip to content

Conversation

@sigram
Copy link
Contributor

@sigram sigram commented Feb 5, 2026

No description provided.

@github-actions github-actions bot added the tests label Feb 5, 2026
@sigram sigram marked this pull request as draft February 5, 2026 16:57
Fix the missing metrics updates that the test discovered.
@sigram sigram marked this pull request as ready for review February 9, 2026 16:28
Comment on lines +52 to +71
var localSubmitted =
solrMetricsContext.longCounter(
"solr_core_crossdc_producer_submitted",
"The number of documents submitted to the Kafka topic (success or error)");
var localSubmittedAdd =
solrMetricsContext.longCounter(
"solr_core_crossdc_producer_submitted_add",
"The number of add requests submitted to the Kafka topic (success or error)");
var localSubmittedDbi =
solrMetricsContext.longCounter(
"solr_core_crossdc_producer_submitted_delete_by_id",
"The number of Delete-By-Id requests submitted to the Kafka topic (success or error)");
var localSubmittedDbq =
solrMetricsContext.longCounter(
"solr_core_crossdc_producer_submitted_delete_by_query",
"The number of Delete-By-Query requests submitted to the Kafka topic (success or error)");
var localSubmittedCommit =
solrMetricsContext.longCounter(
"solr_core_crossdc_producer_submitted_commit",
"The number of standalone Commit requests submitted to the Kafka topic (success or error)");
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems wrong based on descriptions. solr_core_crossdc_producer_submitted says it is the number of documents. Then the name should probably be solr_core_crossdc_producer_submitted_docs. Then the rest of these should be solr_core_crossdc_producer_submitted_requests and instead of appending the suffix of different metric names that are redundant the add/deletebyid etc should be a label of type or operation. Then success or error should be attribute key of result. This would be much easier for aggregation query languages like promql in my opinion and looks like so:

# HELP
# TYP
solr_core_crossdc_producer_submitted_requests{operation="add",result="success"} 123
solr_core_crossdc_producer_submitted_requests{operation="add",result="error"} 1
solr_core_crossdc_producer_submitted_requests{operation="delete_by_id",result="success"} 1
solr_core_crossdc_producer_submitted_requests{operation="delete_by_id",result="error"} 0
solr_core_crossdc_producer_submitted_requests{operation="delete_by_query",result="success"} 10
solr_core_crossdc_producer_submitted_requests{operation="delete_by_query",result="error"} 1
solr_core_crossdc_producer_submitted_requests{operation="commit",result="success"} 100
solr_core_crossdc_producer_submitted_requests{operation="commit",result="error"} 0

# HELP
# TYPE
solr_core_crossdc_producer_submitted_docs{result="success"} 999
solr_core_crossdc_producer_submitted_docs{result="error"} 123

producerMetrics.getSubmitted().inc();
producerMetrics.getSubmittedDeleteById().inc();
} catch (Exception e) {
log.error("mirror submit failed", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a producerMetrics.getSubmitError().inc(); here? Looks like above that is the pattern. Also the best practice of the repo looks to be log or throw but not both. So I guess remove these log.errrors?

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.

2 participants