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

API: List a Project's Issues: Expose "Matching Events" in "stats" field - just like in the UI #24043

Closed
Nowaker opened this issue Feb 23, 2021 · 11 comments

Comments

@Nowaker
Copy link

Nowaker commented Feb 23, 2021

Summary

Search query: user.id:someuser. In UI:

image

In API (example):

    "stats": {
      "14d": [
        [1612915200, 0],
        [1613001600, 13]
      ]
    }

1613001600 is the timestamp, and 13 is Total Events.

Matching Events is not available. Searches via API are therefore extremely limited. I cannot find issues that a given user was actually affected by in a given time period.

Motivation

The UI exposes this data because not doing so would be detrimental to the experience.

API should expose this data too.

    "stats": {
      "14d": [
        [1612915200, 0, 0],
        [1613001600, 13, 4]
      ]
    }

1613001600 is the timestamp, and 13 is Total Events, 4 is Matching Events.

@github-actions
Copy link
Contributor

Sorry, friend. As far as this ol' bot can tell, your issue does not properly use one of this repo's available issue templates. Please try again, if you like. (And if I'm confused, please let us know. 😬)


Did you see the memo about this?

(log)

@Nowaker
Copy link
Author

Nowaker commented Feb 23, 2021

@chadwhitacre Can you reopen? Thanks.

@chadwhitacre
Copy link
Member

Sure thing @Nowaker, sorry for the noise and thanks for the ticket. Routing to @getsentry/ecosystem for triage [internal].

@manuzope
Copy link
Contributor

Hmmm, I don't think we'll be able to make this exact change because it'll be a breaking API change. But maybe we can offer another public API or some other attribute within this API to facilitate this. @getsentry/workflow is probably a better team to address that.

@Nowaker
Copy link
Author

Nowaker commented Feb 23, 2021

@manuzope For it to be non-breaking, it would be as easy as keeping "stats" the same, and adding "stats_matching" as a new field.

@scttcper
Copy link
Member

scttcper commented Feb 24, 2021

The matching events the ui is using can be found under $.filtered.stats via the search api where you'll find the same stats array but with the matching counts. Make sure you are not passing the collapse=stats query parameter to the search api.

@Nowaker
Copy link
Author

Nowaker commented Feb 24, 2021

@scttcper Not sure how to interpret your answer. What is search API and is there a link to the reference? It's not here https://docs.sentry.io/api/

@scttcper
Copy link
Member

@Nowaker I was referring to the endpoint used on the page you screenshotted /api/0/organizations/:orgId/issues/?statsPeriod=14d&project=123&limit=25&query=xx

@Nowaker
Copy link
Author

Nowaker commented Feb 24, 2021

@scttcper Oh! An undocumented API endpoint! And it works!

curl -H "Authorization: Bearer ${SENTRY_TOKEN}" 'https://sentry.io/api/0/organizations/ORGID/issues/?project=PROJECTID&query=user.id%3Anowaker&statsPeriod=14d' | jq

Can you guys review all your available API endpoints and make sure they're all listed at https://docs.sentry.io/api/? Thanks!

@BYK
Copy link
Contributor

BYK commented Mar 4, 2021

@Nowaker we are doing that slowly but certain endpoints are still in flux so we don't want to make them public until we know they are stable.

Do you think we can close this issue now?

@chadwhitacre maybe we can have a "tips and tricks" section in docs or something for things like these?

@chadwhitacre
Copy link
Member

Can you guys review all your available API endpoints and make sure they're all listed at https://docs.sentry.io/api/?

we are doing that slowly but certain endpoints are still in flux so we don't want to make them public until we know they are stable.

If this is true then @manuzope @jonesphillip would this be a good candidate for a "Share the Roadmap" long-lived epic/issue to gather input and track progress with the community? Something like "Roll out API v1"? Let's discuss at our next weekly sync.

maybe we can have a "tips and tricks" section in docs or something for things like these?

Could do as a bandaid, otoh this thread is public so maybe it suffices?

One way or another, I agree let's close here.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants