Grafana-managed alerts vs Loki-managed rules

Grafana-managed and Loki-managed log alerts differ in where rules live, which data sources they can combine and how they fit GitOps and tenancy. This page helps you choose.

On this page

Grafana-managed alerts vs Loki-managed rules: which fits your log alerting

If you already run Loki and need alerts on log patterns, choose Grafana-managed rules when the alert must combine data sources, handle no-data states in one place or be reviewed by the team that owns Grafana. Choose data-source-managed rules in the Loki ruler when the alert belongs next to the logs, should be versioned with the Loki configuration and your platform team wants the rule to live in the data source itself. This is a decision about ownership and workflow, not a feature ranking, because both paths can detect the same log pattern.

According to the Loki alerting docs, Grafana-managed rules are the recommended rule type in Grafana Alerting. They can query several data sources in one rule, so a LogQL condition can sit beside a metric from Prometheus or Mimir in a single evaluation. Data-source-managed rules query only Prometheus-based sources such as Mimir, Loki and Prometheus, and they are stored in the data source. For Loki, that means the ruler holds the rule definitions, which suits teams that manage rule files as part of the cluster they operate.

Teams usually need Grafana-managed rules when operators already work in Grafana for notifications, contact points and silences, or when an alert compares logs with another source. Teams usually need Loki-managed rules when rule files must be stored with the cluster and deployed through the same pipeline as the rest of the Loki configuration. Confirm before you commit whether your Grafana version and Loki tenancy setup support the workflow you pick, and check how each option behaves with multi-tenant X-Scope-OrgID headers, since rules and their notifications must match the tenant that owns the logs.

How each rule type behaves in practice

Grafana-managed rules are the recommended rule type in Grafana Alerting. They are stored and evaluated by Grafana itself, and a single rule can query several data sources, so a log condition can be combined with a metric or a database lookup in one alert. That makes them a good fit when the alert depends on more than Loki data or when a central team wants one place to see every alert in the organization.

  • Multi-source conditions: One rule can combine Loki with other configured data sources, which data-source-managed rules cannot do.
  • Central review: Rules, contact points and notification policies sit in one Grafana interface, which helps teams that own alerts across many systems.
  • Notification policies: Routing, grouping and silencing are handled in Grafana, so Loki-based alerts follow the same escalation paths as other alerts.
  • No-data and error handling: Grafana exposes settings for how a rule reacts when a query returns no data or fails. Confirm the exact options and their defaults in the current Grafana Alerting documentation.
  • Weaker areas: Rule definitions live in Grafana's database and provisioning files rather than next to the Loki configuration, so teams must keep the two in step deliberately.

Before relying on a Grafana-managed rule, test how it behaves when Loki is unreachable, when a stream goes silent, and when a label changes.

Configuration options and when each fits

This table compares Grafana-managed rules with data source managed rules stored in Loki's ruler across storage, data source reach, GitOps paths, tenancy and upgrade coupling. Read each row against how your teams own alerts and how your pipeline deploys them. Exact syntax and file layouts are in the Loki and Grafana docs, so confirm them against the version you run.

Decision areaGrafana-managed rulesLoki-managed (data source) rules
Where rules are storedIn the Grafana database, with provisioning files or as-code tooling as the source of truthAs rule files in the Loki ruler's configured storage, evaluated by the ruler
Data sources one rule can combineCan query several data sources in one rule, including Loki alongside other sourcesQuery only Loki-based sources, so the rule stays within the Loki data path
GitOps and provisioning pathProvisioning files loaded at startup, plus Terraform and Git Sync options in GrafanaRule files deployed to ruler storage through your own pipeline, often without Grafana in the loop
No-data and error handlingConfigurable per rule in Grafana Alerting, which suits alerts that must fire when logs stopBehavior follows the ruler's evaluation model, so confirm how absent series are handled for your use case
Multi-tenancy handlingTenant scope depends on the Grafana data source configuration and access model used for each teamTenant identity comes from X-Scope-OrgID, so rules are scoped per tenant in the ruler
Ownership modelSuits central platform or SRE teams managing alerts in one place with Grafana rolesSuits application teams who own rule files next to their services and logs
Upgrade couplingTied to Grafana release cadence, so plan Grafana upgrades alongside alert configuration testsTied to the Loki release line, so plan ruler changes with Loki upgrades and version notes
Where to confirm detailsCheck the Grafana alerting provisioning reference for the version you runCheck the Loki alerting documentation and ruler configuration for exact rule syntax

Decision factors that should pick the rule type

Six questions decide whether a log alert belongs in Grafana Alerting or in the Loki ruler. Each card names the question, the direction it usually points and what to check in your environment before you commit to one rule type.

Combining Loki with metrics sources

If one alert must compare log counts from Loki with series from Mimir or Prometheus, the rule has to span data sources. Grafana-managed rules can query several data sources in one rule, which points toward Grafana. Data-source-managed rules only evaluate against a single Prometheus-based backend, so a cross-source condition would need to be split or rebuilt. List every alert that spans sources before deciding.

Loki alerting docs

No-data and error state handling

Consider what should happen when a log stream goes silent, because a quiet service can look healthy. Grafana-managed rules give you explicit control over no-data and error states, including whether they notify. If your team needs that behavior on every log alert, Grafana-managed rules are the more direct fit. Test a silent stream in a non-production tenant to confirm the outcome you expect.

GitOps and review workflow

Ask whether alert changes must pass through pull requests, code owners and automated checks before they reach production. Rules stored in the Loki ruler live as rule files that fit a repository workflow directly. Grafana-managed rules can also be provisioned from files, but you must confirm which export and sync path your Grafana version supports and how drift is detected.

Grafana provisioning docs

Per-team ownership in multi-tenant setups

When several teams share one Loki cluster, decide who owns the rules for each tenant. Loki-managed rules follow the tenant identifier on each request, which keeps ownership close to the data. Grafana-managed rules sit in Grafana folders and permissions, so tenant isolation depends on how you map teams to folders and data source access. Confirm that a team cannot read or edit another team's rules.

Grafana as the single alerting surface

Ask whether on-call engineers and service owners already triage every alert in Grafana. If they do, Grafana-managed rules keep rule state, history and routing in one interface. If some teams work mainly from Prometheus tooling or a separate alert console, rules stored with the data may fit them better. Count the people who would need a second place to look for alerts before choosing.

Existing Alertmanager footprint

Check how much of your alert routing already runs through Prometheus Alertmanager. Loki-managed rules send alerts to Alertmanager, so an existing silence, inhibition and receiver setup applies without change. Grafana-managed rules use Grafana's notification policies, which means a second routing layer to maintain. Review duplicate notifications as well, because the two paths can overlap during migration.

How to set up log alerts on the chosen rule type

This sequence takes a team from confirming its Loki version and tenant model to a tested alert that fires and reports no-data correctly, using either Grafana-managed rules or Loki ruler files. Each step closes with a check so the chosen rule owner is proven before rules reach production.

  1. Confirm Loki version, auth and tenant model

    Record the running Loki version, whether auth_enabled is true, and how tenants map to teams, customers or environments. Confirm the version against the Loki releases page and your upgrade plan, since the ruler behavior you depend on can change between releases. Ask the platform owner to confirm that the authenticating reverse proxy in front of Loki sets the X-Scope-OrgID header correctly for each caller. The check is a written inventory listing Loki version, auth_enabled value, tenant IDs and the proxy that enforces them.

  2. Choose the rule owner for each tenant

    Decide, tenant by tenant, whether alerts live in Grafana-managed rules or in the Loki ruler. Grafana-managed rules can combine several data sources in one rule and carry explicit no-data handling, while data source managed rules are stored with Loki and only query Prometheus-based sources. Record the decision alongside the owning team, since mixing owners for the same tenant makes review and deletion harder. The check is a decision record that names one owner per tenant and the reason for it.

  3. Write LogQL alert expressions and for durations

    Draft each alert as a LogQL metric expression that counts or rates matching lines over a fixed window, then set a for duration so brief spikes do not page anyone. Keep label selectors narrow so the expression stays fast and does not create high-cardinality series. Test the expression in Grafana Explore against the chosen tenant before writing any rule. The check is an expression that returns the expected series on a recent time range and returns nothing on a quiet one.

  4. Configure the rules in the chosen location

    For Grafana-managed rules, create the rule against a Loki data source, set the evaluation group and the no-data and error states deliberately, and keep the rule scoped to the tenant. For Loki-managed rules, write rule files organized by tenant and group, with alert names, for durations, labels and annotations, and load them into the ruler's rule storage. The check is a rule that appears in the Grafana Alerting list or in the ruler API output for the correct tenant, with its evaluation state visible.

  5. Provision rules through the GitOps path

    Store the rule definitions in Git and deliver them with the mechanism your team already runs, such as Grafana provisioning files loaded at startup or the Terraform and Git Sync options Grafana documents, or a CI job that pushes ruler files to the tenant's rule store. Review changes through merge requests and deploy only from the protected branch. The check is a clean sync: a commit changes one rule, the change appears in the target system, and a rollback commit removes it.

  6. Wire notification routing and ownership labels

    Connect each alert to a contact point or Alertmanager route using labels that carry the tenant, service and severity. Confirm that duplicate notifications are controlled if Grafana runs in high availability, since the Grafana docs note that alerting needs extra configuration in that case. Send a test notification through the route to the on-call destination. The check is a delivered test message that shows the expected labels and reaches only the responsible team.

  7. Test firing and no-data behavior with a controlled sample

    Push a short, labeled test log sample for the tenant that matches the alert expression, then wait for the for duration to elapse and confirm the alert fires and notifies. Stop sending the sample and confirm the no-data state behaves as configured, whether that means silence, a no-data alert or a resolved state. Record both outcomes and remove the test data afterward. The check is a written test record with timestamps for firing, resolution and no-data, signed off by the team that owns the rule.

Two rule paths converge on one notification route

The diagram starts with application and system logs arriving at Loki through an authenticating reverse proxy, which sets the tenant header. From there, Grafana-managed rules query the Loki data source (and can query other sources in the same rule), while the Loki ruler evaluates rules stored in Loki itself. Check where each rule is stored, which tenant it runs under, and that both paths reach the same Alertmanager route.

Two evaluation paths meet at alert routing, behind one tenant-aware proxy.

Questions teams ask before choosing a rule type

Can Grafana-managed alert rules alert on Loki logs alone?

Yes. Grafana-managed rules can query Loki as a data source, and the Loki alerting documentation describes them as the recommended rule type in Grafana Alerting. The rule is evaluated and stored in Grafana, not in Loki's ruler. The practical difference shows up when a rule needs more than logs. Because a Grafana-managed rule can query several data sources in one rule, you can combine a LogQL expression with a metrics query from Prometheus or Mimir in the same condition. Data-source-managed rules, by contrast, query only Prometheus-based sources such as Loki, Mimir and Prometheus, and they are stored in that data source. For a log-only alert, both options work. Confirm the exact rule behavior you need, including no-data handling, against the current Loki alerting documentation before you commit.

What access and tooling does the team need before starting?

Plan for three things. First, Grafana administrator access, so someone can create folders, contact points, notification policies and rule groups. Second, access to the Loki tenants the alerts will read, which in a multi-tenant cluster means knowing the tenant IDs sent in the X-Scope-OrgID header and having credentials that reach them through your authenticating reverse proxy. Third, a Git workflow, so alert definitions can be reviewed, versioned and promoted between environments. Grafana provisioning loads alerting resources from YAML or JSON files at startup, and it documents further as-code options, including Terraform and Git Sync. Your team also needs to decide who owns each rule, because an alert nobody owns usually goes quiet without anyone noticing. Ask any partner to list these prerequisites in the written scope so gaps are found before build time.

Can our own team build this in-house?

Often yes, if you already run Grafana and Loki and have someone comfortable with LogQL, provisioning files and your notification tools. The work is mostly configuration and review rather than new software. The harder parts are the ones that take experience: choosing thresholds that do not flood on-call staff, setting no-data behavior so a broken log shipper does not look like a quiet system, keeping alert definitions in Git in step with the live Grafana state, and separating tenants so one team's rules cannot read another team's logs. Grafana's high availability guidance also says alerting needs extra configuration to avoid duplicate notifications when two or more Grafana servers run behind a load balancer. If your team has not run that setup before, a short external review of the design, or a fixed-scope build with written deliverables, can shorten the learning curve. Decide based on who will maintain the rules after handover.

What drives the cost of a log alerting setup?

Cost has two sides: what you pay for the platform and what you pay people to build and run it. Platform costs depend on your Grafana edition, where Loki is hosted and how much object storage you use. Grafana's authentication documentation states that SAML, team sync, active sync and SCIM provisioning are available only in Grafana Enterprise and Grafana Cloud, so identity needs can change the edition you pick. Grafana Cloud pricing is published on the Grafana pricing page, where the Pro tier begins with a 19 US dollar monthly platform fee plus usage and the Enterprise tier has a 25,000 US dollar yearly minimum commitment. People costs grow with the number of tenants, the number of rules, how often rules change and how many notification paths you run. Ask any quote to separate one-time build effort from recurring review, upgrades and on-call tuning.

How long does a pilot take to prove the approach?

The honest answer depends on scope, so ask for it in writing rather than accepting a generic duration. A useful pilot covers one tenant, a small set of rules, one notification route and one no-data scenario tested on purpose. It also needs a working Loki and Grafana, log data flowing into the tenant, and a review of how the rules are stored and promoted. The main variables are how many Grafana and Loki environments already exist, whether identity and notification integrations are ready, and whether the team has agreed on rule ownership. DeployOpen plans most engagements as fixed-scope work, with scope, deliverables and timelines agreed in writing before work starts, so a pilot should be described as explicit milestones with acceptance checks. Request those milestones, the environments they touch and who signs off each step.

What changes when we replace Promtail with Grafana Alloy?

Promtail reached end of life on March 2, 2026, with no further updates or commercial support, and Grafana directs users to migrate to Grafana Alloy. For alerting, the key point is that the rules themselves do not depend on the shipper, but the data they read does. Labels, stream selectors and parsing can change when a new agent attaches labels or handles structured fields differently, so a rule that matched on a label may silently stop matching. Plan a side-by-side period in which the old and new pipelines run, compare the label sets for the same log sources and check that each alert still fires in a controlled test. Keep the migration and alert review in one change record so that anyone reviewing an alert can see which shipper produced the data. Ask your migration plan to name each rule it touches and the test that proves it still works.

How do the two rule types fit GitOps and multi-tenancy?

Grafana-managed rules live in Grafana, so GitOps usually means provisioning alerting resources from versioned YAML or JSON files, or using a supported as-code tool, and deploying them to each Grafana environment. Data-source-managed rules live in the Loki ruler, so their rule files and tenant configuration can be managed alongside Loki's own configuration. In a multi-tenant cluster, Loki identifies tenants with the X-Scope-OrgID header, so each rule set should be tied to one tenant ID and reviewed as such. Grafana-managed rules add a permission layer inside Grafana through folders and access roles, which must be aligned with tenant boundaries in Loki. Because Loki has no built-in authentication layer, the reverse proxy in front of it has to enforce which tenant each user or service can reach. Ask for a diagram that maps each team to a tenant, a Grafana folder and a Git path before implementation begins.

Security and operational considerations for alert ownership

Whichever rule type you choose, alerts inherit the security posture of the systems that evaluate and route them. The four to six controls below cover the authenticating proxy in front of Loki, tenant boundaries, who can change rules and contact points, Grafana high availability, notification secrets and change auditing.

Authenticating proxy in front of Loki

Loki has no built-in authentication layer, so the documentation requires an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of it. For Loki-managed rules, the ruler API is reachable through the same path, so a missing or misconfigured proxy exposes rule creation as well as queries. Confirm which endpoints the proxy forwards and who can reach the ruler API directly inside your network.

Loki authentication docs

Tenant isolation through X-Scope-OrgID

Loki is multi-tenant only when auth_enabled is true, and it identifies each tenant from the X-Scope-OrgID header on every request. Rules and alerts stored per tenant inherit that boundary, but the header is only trustworthy if the proxy sets or validates it. Check that clients cannot supply a tenant ID belonging to another team, and test this with a request from a second tenant before relying on the separation.

Loki multi-tenancy docs

Who can edit rules and contact points

Grafana-managed rules and contact points are edited through Grafana roles, while Loki-managed rules change through files or the ruler API, so the two paths have separate permission models. Map who may create, silence or delete alerts and who may change where notifications go. Routing changes are often the most sensitive, because a changed receiver can quietly stop pages from reaching anyone.

Grafana high availability alert duplication

Grafana high availability runs two or more active-active servers behind a load balancer sharing MySQL or PostgreSQL. The Grafana documentation notes that alerting needs additional configuration to avoid duplicate notifications, so each node evaluating the same rule can send the same page. Confirm the alerting HA settings in your version and test a failover while a rule is firing.

Grafana HA setup docs

Secrets for notification channels

Webhook URLs, API tokens and SMTP credentials for contact points are secrets that must not sit in dashboards or version-controlled rule files in plain text. Grafana provisioning can load alerting resources from files, so decide where those secrets are injected at deploy time. Review the security hardening settings for cookies, Content Security Policy and metrics endpoint authentication as part of the same review.

Security hardening docs

Audit of rule and routing changes

Whichever owner you choose, record who changed a rule, threshold, label or receiver and when. Git history covers file-based Loki rules and provisioned Grafana resources, while UI edits need Grafana's own change records and access logs. Ask how each path is audited, which logs are retained and where they are stored, since an alert change without a trail is hard to explain in an incident review.

How GitOps and multi-tenancy change the choice

Your delivery model often decides the rule type before anyone compares features. Grafana-managed rules fit teams that already keep Grafana configuration in code. Grafana's provisioning feature loads data sources, dashboards and alerting resources from YAML or JSON files at startup, and the Grafana docs list further as-code options including Terraform and Git Sync. Put Grafana-managed alert definitions in the same repository and pipeline that deploys Grafana, and one change review covers the alert, its contact points and its data sources. Ruler rule files suit the opposite arrangement: when the team versions LogQL rules alongside the Loki configuration, the rules ship with the same deployment and are reviewed with the same people. Confirm with your Loki version how rules are loaded and reloaded in your environment before you commit a pipeline to either path.

Multi-tenancy changes who may edit which rule. Loki is multi-tenant when auth_enabled is true, and every request identifies its tenant with the X-Scope-OrgID header, so ruler rules belong to a tenant and are only evaluated against that tenant's data. A pilot that gives one team rights over another team's tenant has a data boundary problem, not just a review problem. Loki has no built-in authentication layer, so the authenticating reverse proxy in front of it decides which identities can send which tenant header. Grafana-managed rules sit in Grafana's own permission model, where folder and role settings control who edits them. Label-based access control that limits queries by label is part of Grafana Enterprise Logs, not open-source Loki, so confirm with your vendor whether any restriction you need is available in your edition.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.