grafana / oncall

Developer-friendly incident response with brilliant Slack integration
GNU Affero General Public License v3.0
3.49k stars 288 forks source link

feature: Support filter by users and type for `v1/on_call_shifts` endpoint #928

Closed kavirajk closed 1 year ago

kavirajk commented 1 year ago

Checking the doc here. It doesn't looks like it currently supports it.

My basic use case here are to query

  1. "Give me next n on-call shifts that I'm part of" or
  2. "Give me next n on-call shifts for a particular user of type primary"

I believe currently it's impossible to get this data easily. Only way I can know particular users' shift is to go over all the shifts over period of time.

Bonus: Would be great to expose it as prometheus metrics as well (not sure about cardinality though)

Matvey-Kuk commented 1 year ago

Now it should be possible via this endpoint: https://grafana.com/docs/oncall/latest/oncall-api-reference/schedules/#export-a-schedules-final-shifts