You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "mlbiscoc (via GitHub)" <gi...@apache.org> on 2024/08/01 21:33:54 UTC
[PR] Change prometheus dummy metric to a more unique label [solr]
mlbiscoc opened a new pull request, #2613:
URL: https://github.com/apache/solr/pull/2613
https://issues.apache.org/jira/browse/SOLR-17368
<!--
_(If you are a project committer then you may remove some/all of the following template.)_
Before creating a pull request, please file an issue in the ASF Jira system for Solr:
* https://issues.apache.org/jira/projects/SOLR
For something minor (i.e. that wouldn't be worth putting in release notes), you can skip JIRA.
To create a Jira issue, you will need to create an account there first.
The title of the PR should reference the Jira issue number in the form:
* SOLR-####: <short description of problem or changes>
SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
# Description
`TestPrometheusResponseWriter` was failing ~25% of tests due to dummy metric `dummyMetrics.2xx-responses` not unique enough for exporting compared to `org.eclipse.jetty.server.handler.DefaultHandler.2xx-responses` which could leak between tests creating a duplicate metric.
# Solution
Change the dummy jetty metric with `999xx` that exports a unique enough label that `2xx` cannot clash with it, even with real leaking jetty metrics.
# Checklist
Please review the following and check all that apply:
- [ ] I have reviewed the guidelines for [How to Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my code conforms to the standards described there to the best of my ability.
- [ ] I have created a Jira issue and added the issue ID to my pull request title.
- [ ] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
- [ ] I have developed this patch against the `main` branch.
- [ ] I have run `./gradlew check`.
- [ ] I have added tests for my changes.
- [ ] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] [SOLR-17368] Change prometheus dummy metric to a more unique label [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley merged PR #2613:
URL: https://github.com/apache/solr/pull/2613
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] [SOLR-17368] Change prometheus dummy metric to a more unique label [solr]
Posted by "mlbiscoc (via GitHub)" <gi...@apache.org>.
mlbiscoc commented on PR #2613:
URL: https://github.com/apache/solr/pull/2613#issuecomment-2265399024
Yes, on `main` branch it fails the same way when running Jetty based tests next to it. From Chris's suggestion, `./gradlew -p solr/core test -Ptests.jvms=1 -Ptests.verbose=true --tests TestPrometheusResponseWriter --tests \*Jetty\*` Ran is multiple times and this looks to clean up the issue on my branch.
Current test failure looks to be from `LocalFSCloudIncrementalBackupTest`? Don't think this is related to this though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] [SOLR-17368] Change prometheus dummy metric to a more unique label [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #2613:
URL: https://github.com/apache/solr/pull/2613#issuecomment-2264580162
Were you able to reproduce the problem? If I understand the cause, you'd need to run a number of tests, not just this one test.
The root fix would be to stop metric leaks between tests! Albeit not today -- okay.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] Change prometheus dummy metric to a more unique label [solr]
Posted by "mlbiscoc (via GitHub)" <gi...@apache.org>.
mlbiscoc commented on PR #2613:
URL: https://github.com/apache/solr/pull/2613#issuecomment-2264053909
@dsmiley This should make the dummy metric unique enough to not clash with real leaking jetty metrics from other tests. I ran tests locally multiple times. Any ideas what we can do to make sure that is resilient enough? I want to avoid breaking CI and generating noise for a 3rd time...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] [SOLR-17368] Change prometheus dummy metric to a more unique label [solr]
Posted by "mlbiscoc (via GitHub)" <gi...@apache.org>.
mlbiscoc commented on code in PR #2613:
URL: https://github.com/apache/solr/pull/2613#discussion_r1701057393
##########
solr/core/src/test/org/apache/solr/response/TestPrometheusResponseWriter.java:
##########
@@ -78,7 +78,12 @@ public void testPrometheusStructureOutput() throws Exception {
output.lines().filter(line -> !line.startsWith("#")).collect(Collectors.toList());
filteredResponse.forEach(
(actualMetric) -> {
- String actualValue = actualMetric.substring(actualMetric.lastIndexOf("} ") + 1);
+ String actualValue;
+ if (actualMetric.contains("}")) {
+ actualValue = actualMetric.substring(actualMetric.lastIndexOf("} ") + 1);
+ } else {
+ actualValue = actualMetric.split(" ")[1];
+ }
Review Comment:
Also adding this in to better parse numeric value out of prometheus metrics based on whether or not tags exist
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org