Master Your Log Costs: How to Use Adaptive Logs Drop Rules

By

Welcome to the new era of log cost management with Adaptive Logs. If your platform or observability team is drowning in noisy logs—health checks, debug chatter, or verbose info from rarely used services—you know the pain of wasted storage and inflated bills. The solution? Drop rules, now in public preview, let you define custom logic to discard low-value logs before they ever reach Grafana Cloud Logs. This Q&A guide explains everything you need to know, from basic setup to advanced sampling strategies.

What are Adaptive Logs drop rules?

Drop rules are a new feature in Adaptive Logs that give you precise control over which log lines get ingested into Grafana Cloud. You create rules using any combination of log labels, detected log levels (like DEBUG or INFO), or line content patterns. When a log line matches a rule, it can be dropped entirely or sampled at a percentage you define. This is similar to the custom drop capabilities already available in Adaptive Metrics and Adaptive Traces, now extended to logs. With drop rules, you can eliminate known noise without requiring individual teams to change their logging configuration—no more toilsome infrastructure change management.

Master Your Log Costs: How to Use Adaptive Logs Drop Rules

How do drop rules help reduce waste with Adaptive Logs?

Drop rules directly reduce the volume of logs stored in Grafana Cloud, saving you money and decreasing noise. By filtering out unwanted logs at the ingestion stage, you avoid paying for storage of data you never use. For example, a single rule with a 100% drop rate can eliminate all health-check logs from every service, enforcing a company-wide standard instantly. Teams no longer need to modify their applications or struggle with complex infrastructure changes. Instead, the platform team defines the rule once, and the savings—and sanity—kick in immediately. Additionally, drop rules allow sampling of chatty logs you don't want to completely discard, keeping a representative sample while drastically reducing cost.

Can you show me examples of what drop rules can do?

Absolutely! Here are three common use cases:

  • Drop logs by level: Instantly discard all DEBUG logs that eat up your logging budget. Create a rule that matches level: DEBUG with a 100% drop rate.
  • Sample repetitive logs: If a service logs the same message thousands of times, set a rule on its stream selector (e.g., service=my-batch-job) and apply a 90% drop rate. This keeps 10% of the logs for troubleshooting while slashing cost.
  • Target a specific noisy producer: Suppose a particular service suddenly starts emitting high-volume low-value logs. Combine a label selector like service=leaky-service with a log level filter or a text pattern (e.g., "Connection timeout"). The rule drops those logs before they hit storage.

These examples show how flexible drop rules are—tailored to your specific noise.

What is the evaluation order for handling log lines in Adaptive Logs?

When a log line arrives at Grafana Cloud, it passes through three stages in a strict order:

  1. Exemptions (protected logs): If a log line matches an exemption rule, it passes through untouched—no sampling or dropping applied. Exemptions are for critical logs you never want to lose.
  2. Drop rules: Evaluated in priority order (you set the priority). The first matching rule applies its drop percentage or sampling decision. If a rule drops the log, it's gone; if it samples, only a fraction proceeds.
  3. Patterns (optimization recommendations): Any log lines that weren't exempted or dropped are then subject to the system's intelligent pattern recommendations, which suggest further sampling based on usage.

This three-layer system gives you complete control.

How do drop rules fit with exemptions and recommendations?

Drop rules are one piece of a complete log cost management system in Adaptive Logs. Each mechanism serves a distinct purpose:

  • Drop rules eliminate known noise (e.g., health checks, debug logs) and apply custom sampling to specific workloads. They are your first line of defense.
  • Exemptions protect high-value logs from any sampling or dropping—think audit trails or security logs.
  • Recommendations are automatically generated optimization suggestions based on patterns in your remaining logs. They handle ongoing cost optimization.

Together, they form a complete system. For example, you might exempt critical application logs, drop all verbose debug from a legacy service, and let recommendations sample the rest. This layered approach ensures you only pay for what matters.

How do I set up a drop rule in Grafana Cloud?

Setting up a drop rule is straightforward through the Grafana Cloud interface. Navigate to the Adaptive Logs section in your Grafana Cloud portal. Click on “Drop Rules” and then “Add Rule.” You’ll define:

  • Priority: Order of evaluation (lower number = higher priority).
  • Stream Selector: Labels like service, namespace, or source.
  • Log level: Choose from DEBUG, INFO, WARN, ERROR, etc.
  • Line content: A text pattern (e.g., /health or "heartbeat").
  • Drop percentage: 0% to 100% – 0% means keep all; 100% means drop all.

For example, to drop all DEBUG logs from a service named payment-gateway, set stream selector {service="payment-gateway"}, level = DEBUG, drop% = 100. Save the rule and it takes effect immediately. Check our documentation for detailed steps.

How does sampling work with drop rules?

Drop rules allow you to specify a drop percentage that effectively samples logs you don’t want to entirely discard. For example, if you set a 90% drop rate on a rule, 1 out of every 10 log lines that match the rule will be kept (10% ingested); the other 90% are dropped. This is ideal for repetitive or chatty logs where you still want a representative sample for debugging or trend analysis, but you don't need every single entry. The sampling is applied per rule, so you can have different rates for different log types. For instance, sample health-check logs at 5% and batch job logs at 20%. This granular control ensures you keep enough data for operations without the full cost.

What are the key cost-saving benefits of using drop rules?

The primary benefit is immediate reduction in log volume and therefore cost. By dropping noisy logs at the edge, you significantly lower your storage and ingestion bills. Beyond money, drop rules reduce noise in dashboards and alerts, making it easier to focus on real issues. Centralized teams gain a powerful tool to enforce logging standards across all services without requiring changes from individual developers. There's no infrastructure change management needed—rules are applied server-side. Finally, because drop rules can be combined with exemptions and recommendations, you can fine-tune your cost savings while retaining logs that matter. Start with a simple health-check drop rule and see your log volume plummet.

Tags:

Related Articles

Recommended

Discover More

From NYSE Setback to All-in-One Wallet: How Exodus Aims to Make Self-Custody a Daily RealityBridging the Gap: Why Good Designers Create Inaccessible Websites and How to Fix ItFrom Chore to Choice: A UX Designer’s Guide to Transforming System ToolsThe Artemis 3 Delay: A Step-by-Step Guide to Understanding the 2028 Moon Landing FeasibilityUnlocking the Future of Rooftop Solar: How 'Fingerprint' Mapping Predicts Australia's Solar Giant