You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "chlorochrule (via GitHub)" <gi...@apache.org> on 2023/01/29 05:46:02 UTC

[GitHub] [solr] chlorochrule opened a new pull request, #1317: SOLR-16639: Fix solr-exporter parse error of node_thread_pool_completed_total

chlorochrule opened a new pull request, #1317:
URL: https://github.com/apache/solr/pull/1317

   https://issues.apache.org/jira/browse/SOLR-16639
   
   <!--
   _(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
   
   jq expr `select(.key | endswith(".completed"))` matches ".tasks.completed" too. But the format of ".tasks.completed" metrics is like bellow:
   
   "QUERY.httpShardHandler.threadPool.httpShardExecutor.tasks.completed":16,
   
   https://github.com/apache/solr/blob/bf490f16b5e1acbbd4b01ec3aa1e5b035096716a/solr/prometheus-exporter/conf/solr-exporter-config.xml#L541
   
   So, `$object.value.count` jq expr occurs jq parse error.
   
   solr-exporter logs:
   ```
   ERROR - 2023-01-28 18:11:55.401; org.apache.solr.prometheus.scraper.SolrScraper; Error apply JSON query=(.metrics["solr.node"] | to_entries | .[] | select((.key | contains(".threadPool."))) | select((.key | endswith(".completed"))) as $object | $object.key | split(".") as $key_items | $key_items | length as $label_len | $key_items[0] as $category | if ($label_len >= 5) then $key_items[1] else "" end as $handler | if ($label_len >= 5) then $key_items[3] else $key_items[2] end as $executor | $object.value.count as $value | {("name"): "solr_metrics_node_thread_pool_completed_total",("type"): "COUNTER",("help"): "See following URL: https://solr.apache.org/guide/solr/latest/deployment-guide/metrics-reporting.html",("label_names"): [("category", "handler", "executor")],("label_values"): [($category, $handler, $executor)],("value"): $value}) to result => net.thisptr.jackson.jq.exception.JsonQueryException: Cannot index number with string "count"
   ```
   
   # Solution
   
   I fixed this problem to add `select(.value | type=="object")` filter to jq expr.
   
   # Tests
   
   I verified this patch in my dev environment using SolrCloud.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] 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)
   - [x] 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


[GitHub] [solr] chlorochrule commented on pull request #1317: SOLR-16639: Fix solr-exporter parse error of node_thread_pool_completed_total

Posted by "chlorochrule (via GitHub)" <gi...@apache.org>.
chlorochrule commented on PR #1317:
URL: https://github.com/apache/solr/pull/1317#issuecomment-1421267860

   @HoustonPutman Thank you for reviewing!


-- 
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


[GitHub] [solr] chlorochrule commented on pull request #1317: SOLR-16639: Fix jq parse error of solr-exporter metrics node_thread_pool_completed_total

Posted by "chlorochrule (via GitHub)" <gi...@apache.org>.
chlorochrule commented on PR #1317:
URL: https://github.com/apache/solr/pull/1317#issuecomment-1430634515

   Thank you for merging, @HoustonPutman!


-- 
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


[GitHub] [solr] HoustonPutman commented on pull request #1317: SOLR-16639: Fix jq parse error of solr-exporter metrics node_thread_pool_completed_total

Posted by "HoustonPutman (via GitHub)" <gi...@apache.org>.
HoustonPutman commented on PR #1317:
URL: https://github.com/apache/solr/pull/1317#issuecomment-1430139540

   Tested this locally and it works wonderfully!


-- 
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


[GitHub] [solr] HoustonPutman merged pull request #1317: SOLR-16639: Fix jq parse error of solr-exporter metrics node_thread_pool_completed_total

Posted by "HoustonPutman (via GitHub)" <gi...@apache.org>.
HoustonPutman merged PR #1317:
URL: https://github.com/apache/solr/pull/1317


-- 
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


[GitHub] [solr] HoustonPutman commented on pull request #1317: SOLR-16639: Fix solr-exporter parse error of node_thread_pool_completed_total

Posted by "HoustonPutman (via GitHub)" <gi...@apache.org>.
HoustonPutman commented on PR #1317:
URL: https://github.com/apache/solr/pull/1317#issuecomment-1423056660

   @chlorochrule could you add a CHANGES.txt entry?


-- 
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