Skip to content
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

failure-exporter limited to only 50 results #304

Closed
rmarting opened this issue Jul 15, 2021 · 4 comments · Fixed by #427
Closed

failure-exporter limited to only 50 results #304

rmarting opened this issue Jul 15, 2021 · 4 comments · Fixed by #427
Assignees
Labels
backend-jira Related to the jira backend failure-exporter Related to the failure exporter kind/bug Categorizes issue or PR as related to a bug. mvr mvr as of 03/2022 needs investigation More research is necessary for this task, usually from developers of the project. Priority 1 Addressing this issue is of the highest priority. Size Medium A medium amount of work

Comments

@rmarting
Copy link
Contributor

Testing the integration with Jira Atlassian I found that exporter is limited to only 50 results.

Checking the log of failure-exporter pod you could see that the Query API endpoint add variables to limit the maximum number of results:

---> Running application from Python script (failure/app.py) ...
Initializing Logger wit LogLevel: DEBUG
07-15-2021 13:31:00 INFO     ===== Starting Failure Collector =====
07-15-2021 13:31:00 INFO     Server: https://****************
07-15-2021 13:31:00 INFO     User: **************************
07-15-2021 13:31:00 DEBUG    Starting new HTTPS connection (1): ****************:443
07-15-2021 13:31:00 DEBUG    https://****************:443 "GET /rest/api/2/serverInfo HTTP/1.1" 200 None
07-15-2021 13:31:01 DEBUG    https://****************:443 "GET /rest/api/2/field HTTP/1.1" 200 None
07-15-2021 13:31:01 DEBUG    Starting new HTTPS connection (1): ****************:443
07-15-2021 13:31:01 DEBUG    https://****************:443 "GET /rest/api/2/serverInfo HTTP/1.1" 200 None
07-15-2021 13:31:01 DEBUG    https://****************:443 "GET /rest/api/2/field HTTP/1.1" 200 None
07-15-2021 13:31:04 DEBUG    https://****************:443 "GET /rest/api/2/search?jql=type%3Dbug+and+priority%3Dhighest&startAt=0&validateQuery=True&maxResults=50 HTTP/1.1" 200 None

The number of issues found is limite to only 50 entries, but my Jira instance manages hundred of projects with thousands of issues. In my case, the issues that I want to match in Pelorus do not appear in the results, so the Failure Rate metric is not updated for my use case.

How could I set up that value? It could be great to allow to setup the maximum number of issues, or at least execute that query for each project created in Jira. Other idea could be allow to set up the projects in Jira to extract metrics.

Maybe adding some properties in the deployment such as:

  • MAX_RESULTS: Maximun number of results to query
  • PROJECT: Literal or expression to define which projects in Jira should be checked to get metrics.
@etsauer etsauer added the kind/bug Categorizes issue or PR as related to a bug. label Jul 15, 2021
@etsauer
Copy link
Collaborator

etsauer commented Jul 15, 2021

hi @rmarting yes this definitely looks like a bug to me. It appears that at one point we did add an optional PROJECT propery, but we never implemented it. https://github.com/konveyor/pelorus/blob/master/exporters/failure/app.py#L31

@rmarting
Copy link
Contributor Author

@etsauer I took some time to create a PR that could improve this issue in a simple way. I am not an python expert developer, however I think this first approach could resolve it. For my use case, it is working as expected and my Pelorus platform is getting the failure rates for the projects wanted.

HTH.

@KevinMGranger
Copy link
Collaborator

#308 adds support for PROJECTS, but we'll keep this open until the limit is fixed.

@KevinMGranger KevinMGranger added needs investigation More research is necessary for this task, usually from developers of the project. Priority 1 Addressing this issue is of the highest priority. failure-exporter Related to the failure exporter backend-jira Related to the jira backend labels Dec 21, 2021
@kpiwko
Copy link
Contributor

kpiwko commented Jan 13, 2022

I'm not familiar with JIRA client in Python, however MAX_RESULTS would not be a proper fix as this number is limited by JIRA API itself. Some kind of implementation of paging based on ResultList would be needed.

@KevinMGranger KevinMGranger added the mvr mvr as of 03/2022 label Mar 17, 2022
@mpryc mpryc added the Size Medium A medium amount of work label Apr 6, 2022
@mpryc mpryc self-assigned this Apr 21, 2022
mpryc added a commit to mpryc/pelorus that referenced this issue Apr 22, 2022
JIRA api allows to pull all issues at once, but in our case
we want to get subsequent results for two reasons:
 - some users were reporing problems gathering more then
   100 results in one query.
 - during collection we present feedback to the user that
   operation is ongoing.

As part of this change also the requested data was limited
to the data required by pelorus failure exporters, which is
summary,labels,created,resolutiondate
KevinMGranger pushed a commit that referenced this issue Apr 26, 2022
* Test to cover JIRA token and password authentication.

Added test which checks for the deprecated password authentication.

JIRA uses same method to authenticate in the cloud jira instance
for both deprecated password authentication and token based auth.

This may lead to the situation where wrong API key is actually
considered password and then failure exporter is presenting
deprecation error.

This change also moves connection func to separate private
one for easy testing and readibility + may in the future
include more sophisticated auth methods.

Added proper headers to the files which were modified.

* Fix issue #278 - failure pod crashing

We should log error rather then crash pod if JIRA is missing
type required by failure exporter. JIRA type may be added
after pelorus deployment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend-jira Related to the jira backend failure-exporter Related to the failure exporter kind/bug Categorizes issue or PR as related to a bug. mvr mvr as of 03/2022 needs investigation More research is necessary for this task, usually from developers of the project. Priority 1 Addressing this issue is of the highest priority. Size Medium A medium amount of work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants