Using grafana.com with a personal org

I’m trying to use prometheus metrics from my personal org with an externally hosted grafana (grafana.com instance) I followed the documentation but got stuck on organisation slug, which according to fly orgs list is just ‘personal’ - if I use a token I create ( flyctl tokens create org -n prom) with curl or grafana

https://api.fly.io/prometheus/personal/
Authorization: Bearer <output of fly tokens create … )
I get 401:
something went wrong resolving organization, I also tried using my full org id as the slug and the value I got from checking fly-metrics prometheus data source. What should I be using?

Looks like I figured this out myself - using $(fly auth token) for the token.

Hi,

You can use an org or read-only token but you need to change the format a little bit.

The fly tokens create created token looks like this:

FlyV1 b64_gibberish.........

so what you’re sending in the header looks like:

Authorization: Bearer FlyV1 b64_.....

you need to make it look like this:

Authorization: FlyV1 b64_.....

this means removing the “Bearer” part, I think you can do this with a custom header in your data source configuration.

Another option is to remove the Authorization header and use “Basic” HTTP authentication. In here, you need to pass a username of “token” and the password is the entire, verbatim token Flyv1 b64_.....

Let me know if either of these options works in case you don’t want to use the full auth token.

Regards,

  • Daniel
1 Like

From How To to Questions / Help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.