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.
Loki-managed rules are LogQL alert rules that the Loki ruler evaluates and stores in rule files, using a format close to Prometheus rule files. The ruler sends firing alerts to an Alertmanager, so routing and silencing rely on Alertmanager configuration. This keeps alert logic beside the log data it describes and suits teams that already run Prometheus-style alerting.
- Stored with Loki: Rule files are held by the ruler, which keeps the alert definition close to the log queries it uses.
- Prometheus-style format: Rule groups,
fordurations, labels and annotations follow familiar conventions, which simplifies review by engineers who already write Prometheus rules. - Alertmanager routing: Notification logic lives in Alertmanager, a separate component that must be operated and configured.
- Single data source: Rules query Loki only, so cross-source conditions need a different design.
- Weaker areas: No-data and error behavior, rule storage backends and sharding depend on the ruler configuration, so review those settings in the Loki alerting and ruler documentation for your version.
Confirm the ruler's rule storage location, the Alertmanager endpoint and the authentication path before you commit to this model.
Both models can be kept in version control, but they differ in what gets versioned and how it reaches the running system. Loki-managed rules are plain rule files, which a pipeline can lint, test and deploy like any other configuration. Grafana-managed rules can be defined through provisioning files that Grafana loads at startup, and Grafana documents further as-code options. The practical question is which artifact your review process can actually check.
- Plain files: Loki rule files map directly onto a repository and a standard review and deployment workflow.
- Provisioned resources: Grafana alerting resources can be defined in YAML or JSON and loaded at startup, so the repository becomes the source of truth.
- Drift risk: Edits made in the Grafana interface can diverge from the repository if provisioning is not enforced.
- Environment promotion: Separate rule files or provisioning sets per environment make promotion from test to production a repeatable step.
- Tooling: Confirm which as-code tools are supported for your Grafana version before you build the pipeline around them.
Run one dry-run deployment in a non-production environment and confirm that a change in the repository produces the expected rule in the running system.
Multi-tenancy changes the decision. Loki identifies tenants with the X-Scope-OrgID header when authentication is enabled, and rule evaluation and alert routing must respect the same tenant boundaries. A Loki-managed rule belongs to a tenant context inside the ruler, which fits teams that each own their own logs. A Grafana-managed rule is evaluated by Grafana, so its access model depends on Grafana folders, permissions and the data source configuration that each team can reach.
- Tenant scoping: Confirm how the ruler isolates rules and alerts per tenant in your version before assigning ownership.
- Grafana permissions: Folder and rule permissions in Grafana decide who can edit or silence a shared alert.
- Shared versus team alerts: Platform-wide alerts often suit Grafana-managed rules, while team-owned log alerts often suit Loki-managed rules.
- Access to logs: Grafana users who can query a data source can usually see the data behind its rules, so check this against your data classification.
- Authentication: Loki has no built-in authentication layer, so a reverse proxy must enforce who can reach the ruler and its APIs.
Test a cross-tenant scenario with two test tenants and confirm that one team cannot view or silence the other's alerts.
After the rules are live, the operating model matters as much as the first deployment. Each rule type creates its own places to check when an alert fails to fire or fires without cause. Grafana-managed alerts surface their state in Grafana, while Loki-managed alerts involve the ruler, the Alertmanager and any upstream routing. Auditors and on-call teams will ask which component produced a notification, so the chosen model should leave a clear trail.
- Where failures appear: Grafana-managed rule errors show in Grafana, while Loki ruler and Alertmanager failures need their own health checks.
- Notification trail: Confirm which system records sent notifications and how long those records are kept.
- Testing: Use test queries and controlled log events to check firing, resolution and no-data behavior before go-live.
- Upgrades: Rule behavior and ruler settings can change between Loki and Grafana versions, so retest rules during each upgrade.
- Ownership: Name an owner for each rule group and for the Alertmanager or contact point configuration.
Document which component owns each alert, then confirm no-data and error handling settings in the current Grafana and Loki documentation for the versions you run.
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 area | Grafana-managed rules | Loki-managed (data source) rules |
|---|---|---|
| Where rules are stored | In the Grafana database, with provisioning files or as-code tooling as the source of truth | As rule files in the Loki ruler's configured storage, evaluated by the ruler |
| Data sources one rule can combine | Can query several data sources in one rule, including Loki alongside other sources | Query only Loki-based sources, so the rule stays within the Loki data path |
| GitOps and provisioning path | Provisioning files loaded at startup, plus Terraform and Git Sync options in Grafana | Rule files deployed to ruler storage through your own pipeline, often without Grafana in the loop |
| No-data and error handling | Configurable per rule in Grafana Alerting, which suits alerts that must fire when logs stop | Behavior follows the ruler's evaluation model, so confirm how absent series are handled for your use case |
| Multi-tenancy handling | Tenant scope depends on the Grafana data source configuration and access model used for each team | Tenant identity comes from X-Scope-OrgID, so rules are scoped per tenant in the ruler |
| Ownership model | Suits central platform or SRE teams managing alerts in one place with Grafana roles | Suits application teams who own rule files next to their services and logs |
| Upgrade coupling | Tied to Grafana release cadence, so plan Grafana upgrades alongside alert configuration tests | Tied to the Loki release line, so plan ruler changes with Loki upgrades and version notes |
| Where to confirm details | Check the Grafana alerting provisioning reference for the version you run | Check 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 docsNo-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 docsPer-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.
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.
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.
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.
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.
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.
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.
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 docsTenant 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 docsWho 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 docsSecrets 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 docsAudit 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.

