-
Notifications
You must be signed in to change notification settings - Fork 808
SOLR-18064: CrossDC Producer - add more detailed metrics. #4106
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
base: main
Are you sure you want to change the base?
Conversation
Fix the missing metrics updates that the test discovered.
| 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)"); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
No description provided.