Skip to Content
How-to guidesConnect Grafana

Connect Grafana

Connect Grafana and your agents can investigate production the way you do: search logs in Loki, query Prometheus metrics, Tempo traces and Pyroscope profiles, and read dashboards, alert rules, incidents and on-call schedules. It works with Grafana Cloud and with your own Grafana.

Before you start

  • The Grafana package is installed from the Marketplace and is in the manifest your space uses. See Install a package into a manifest.
  • Your Grafana is reachable over HTTPS from the internet. Marshal verifies the server’s TLS certificate on every MCP tool call. Use a publicly trusted certificate, or declare your private CA in the Grafana package’s egress.root_cas field so the egress proxy trusts it. You can restrict Grafana to Marshal’s outbound addresses.
  • You can create a service account in Grafana, or your Grafana admin can create one for you.

Connect with a service account token

This sign-in works with Grafana Cloud and self-hosted Grafana.

  1. In Grafana, open Administration → Users and access → Service accounts.
  2. Click Add service account, name it (for example “Marshal”) and give it the Viewer role.
  3. Click Add service account token, generate the token and copy it right away.
  4. In Marshal, open Connections in the left rail.
  5. On the Grafana card, click Connect, then pick the Service account token tab.
  6. Enter your Grafana address, for example https://acme.grafana.net or https://grafana.example.com. If your admin set the address, it is already filled in and locked.
  7. Paste the token into Service account token.
  8. Click Save.

The agent can read what the service account can read, so give the service account the Viewer role and nothing more.

Connect with Sign in with Grafana

This sign-in is for Grafana Cloud. You create and paste nothing.

  1. Ask an owner or admin to set the Grafana address once. See the next section.
  2. Open Connections and click Connect on the Grafana card.
  3. Pick Sign in with Grafana.
  4. Sign in with your Grafana Cloud account and approve read and query access.

Set the Grafana address once for your organization

An owner or admin can enter the Grafana address once, and everyone connects without typing it.

  1. Open the organization menu in the top bar and choose Organization settings.
  2. Open Configuration.
  3. Under Package settings, find the Grafana card.
  4. Enter the Grafana address, for example https://acme.grafana.net.
  5. Click Save.

Members then only paste a token. The address shows locked in their connect dialog with the note “Set by your org admin in Package settings.” Sign in with Grafana uses the same address. See Set package settings for your organization.

What your agents can do

Grafana is read-only. Your agents can:

  • Search Loki logs and list their labels.
  • Query Prometheus metrics, Tempo traces and Pyroscope profiles through Grafana.
  • Read dashboards and the queries behind their panels.
  • Read alert rules, alert groups and silences.
  • Read incidents.
  • See on-call schedules, teams and who is on call.

Your agents cannot create or change anything in Grafana.

Your token stays private

The token never reaches the agent. Marshal adds it to requests for you. A space’s Grafana connection can reach only the one Grafana address you entered, so a session cannot send your token or its queries anywhere else.

What you should see

  • The Grafana card on Connections shows your connection.
  • Ask an agent “list my Grafana datasources”. It answers with the datasources your service account can see.