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

Allow editing the schedule for sync_organization command #4309

Closed
gavinwoolley opened this issue May 3, 2024 · 2 comments
Closed

Allow editing the schedule for sync_organization command #4309

gavinwoolley opened this issue May 3, 2024 · 2 comments

Comments

@gavinwoolley
Copy link

gavinwoolley commented May 3, 2024

What would you like to see!

I'd like to be able to configure the frequency of when the organizations sync from Grafana to Oncall or ideally be able to hit an API to trigger the sync on demand.

Product Area

Alert Flow & Configuration, Helm, Other

Anything else to add?

We progamatically manage all of our users, teams, integrations etc
Currently we have to wait for the users to sync, before we can create integrations that are team scoped, it took 24 hrs yesterday.
Unless of course we hit the plugin screen, then it syncs.

We'd like to be able to trigger the sync, or at least configure the frequency of when it happens if possible.

v.1.4.3

Copy link
Contributor

github-actions bot commented May 3, 2024

The current version of Grafana OnCall, at the time this issue was opened, is v1.4.4. If your issue pertains to an older version of Grafana OnCall, please be sure to list it in the PR description. Thank you 😄!

@mderynck
Copy link
Contributor

mderynck commented Sep 6, 2024

Specific to this issue we added an API endpoint to trigger sync on demand (there is a timeout on it so that it does not run more frequently than 5 mins). You can use a service account token as well to call this (see Grafana docs). Also note this caches a copy locally and it will not send anything to the OnCall backend if it does not detect any changes.

curl -X POST 'http://admin:admin@localhost:3000/api/plugins/grafana-oncall-app/resources/plugin/sync'

Recently we made some changes to the way Grafana OnCall is initialized. Use 1.9.22, there were quite a few changes along the way from 1.9.0-1.9.22 to get things working.

  • If you are running Grafana 11 and newer you must have externalServiceAccounts feature toggle enabled.
    This has already been enabled in the docker compose files and helm charts in the oncall repo.
  • Plugin settings must be provided to the plugin using an API call if you are installing for the first time (Note: credentials and hostnames need to be adjusted for your configuration, stackId and orgId are expected to be the listed constants in a self-hosted configuration)
curl -X POST 'http://admin:admin@localhost:3000/api/plugins/grafana-oncall-app/settings' -H "Content-Type: application/json" -d '{"enabled":true, "jsonData":{"stackId":5, "orgId":100, "onCallApiUrl":"http://engine:8080/", "grafanaUrl":"http://grafana:3000/"}}'
  • Once settings are configured use this API call to install:
curl -X POST 'http://admin:admin@localhost:3000/api/plugins/grafana-oncall-app/resources/plugin/install'

Grafana OnCall should now be ready to use.
For additional troubleshooting see here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants