RousselTMLEARNING

Article · Dynatrace: From Discovery to Expertise

Grail buckets

1. What is a bucket? #

Grail’s storage unit.

Definition #

In Grail, every record (log line, span, event, business event) is stored in a bucket. A bucket is a logical container with three properties: the table it feeds (logs, spans, events, bizevents…), its retention period in days, and the rights needed to read it. It is the tool that lets you handle data differently.

OpenPipeline routes each record to a bucket.
Good to know: Metrics do not use buckets in the same way: their retention and resolution are managed by the platform. Buckets mainly concern logs, spans, events and business events.

Default buckets #

Each environment has default buckets, which receive data as long as no rule sends it elsewhere, and read-only system buckets.

BucketTableContent
default_logslogsall logs not routed elsewhere
default_spansspansdistributed traces
default_eventseventsevents (deployments, Davis, custom)
default_bizeventsbizeventsbusiness events
dt_system_…, dt_…variessystem data (billing, audit): read-only
Depending on the version: The exact list and default retention (around 10 days for spans and 35 days for logs and events) depend on your contract and the platform version: check them in Storage management.

2. Why create your own buckets #

Four good reasons.

The motivations #

NeedExampleDedicated bucket
Different retentionaudit kept 1 year, debug 7 dayslogs_audit_1y, logs_debug_7d
Access rightssecurity logs visible to the security team onlylogs_security
Costnot paying 35 days of retention for verbose logslogs_debug_7d
Query performancequery a targeted bucket rather than all logsone bucket per main use
Measure, classify, create, route, control.

Measure before splitting #

Start by looking at where volumes come from: a few sources often make up most of the data.

// Volume ingested per bucket and source over 7 days (before deciding on a strategy)
fetch logs, from: -7d
| summarize lines = count(), by: { dt.system.bucket, log.source }
| sort lines desc
| limit 30
Good practice: Aim for a few well-designed buckets (by retention and audience), not one bucket per application: too many buckets complicate rights, queries and maintenance, and their number per environment is limited.

3. Creating a bucket #

UI, API or Terraform.

In the UI #

  1. Open Storage management (Manage or Settings menu, depending on the version).
  2. Choose Create bucket.
  3. Enter the technical name (lowercase letters, digits and underscores, without a reserved prefix such as dt_ or default_), the display name, the table and the retention in days.
  4. Save: the bucket becomes active after a few moments.
Common mistake: Choosing the name carelessly: it appears in routing rules, IAM policies and queries, and cannot be renamed. Adopt a convention, for example <table>_<use>_<retention> (logs_audit_1y).

With the API and Terraform #

Buckets are managed through the platform API (apps.dynatrace.com) with a platform token or an OAuth client that has rights on bucket definitions:

curl -X POST "https://abc12345.apps.dynatrace.com/platform/storage/management/v1/bucket-definitions" \
  -H "Authorization: Bearer $DT_PLATFORM_TOKEN" -H "Content-Type: application/json" \
  -d '{
    "bucketName": "logs_audit_1y",
    "displayName": "Audit logs (1 year)",
    "table": "logs",
    "retentionDays": 365
  }'
curl -H "Authorization: Bearer $DT_PLATFORM_TOKEN" \
  "https://abc12345.apps.dynatrace.com/platform/storage/management/v1/bucket-definitions"
resource "dynatrace_platform_bucket" "audit" {
  name         = "logs_audit_1y"
  display_name = "Audit logs (1 year)"
  table        = "logs"
  retention    = 365
}
Depending on the version: Exact API endpoint, permission and Terraform resource names may change: check the Storage management API and Dynatrace Terraform provider reference for your version.
Good practice: Declare buckets as code (Terraform or Monaco) together with the OpenPipeline rules and IAM policies that use them: the whole setup can be recreated identically in another environment.

4. Routing data #

OpenPipeline decides the bucket.

Storage rules #

An empty bucket is useless: data must be sent to it. In OpenPipeline, each pipeline ends with a storage step that assigns records to a bucket based on a DQL condition. Records that match no rule go to the default bucket.

// Routing condition (OpenPipeline): Linux authentication logs to the audit bucket
matchesValue(log.source, "/var/log/auth.log") or matchesValue(log.source, "/var/log/secure")

// Debug logs of a namespace to the short bucket
k8s.namespace.name == "shop" and loglevel == "DEBUG"

Details on pipelines, routing and processing in Advanced logs with OpenPipeline.

Good to know: Routing applies to data received after it is set up: data already stored stays in its original bucket until its retention ends.
Depending on the version: On environments not yet migrated to OpenPipeline for logs, assignment is done with the bucket assignment rules of log processing (Log Monitoring); the principle is the same.

5. Querying and controlling #

DQL and IAM rights.

Targeting a bucket in DQL #

Each record carries its bucket name in the dt.system.bucket field. Filtering on it reduces the volume read, and therefore response time and query cost.

// Read only the audit bucket
fetch logs, from: -30d
| filter dt.system.bucket == "logs_audit_1y"
| filter contains(content, "sudo")
| fields timestamp, host.name, content
| sort timestamp desc
// List the environment's buckets and their retention
fetch dt.system.buckets
| fields name, table, retentionDays, status
| sort name asc
Depending on the version: Listing buckets with DQL (fetch dt.system.buckets) and its fields depend on the version; the Storage management app gives the same information.

Per-bucket rights #

IAM policies can restrict reading to certain buckets, and reserve bucket creation and changes to administrators:

// Security team: read logs of the audit bucket only
ALLOW storage:logs:read, storage:buckets:read
  WHERE storage:bucket-name = "logs_audit_1y";

// Platform administrators: create and modify buckets
ALLOW storage:bucket-definitions:read, storage:bucket-definitions:write;

Principles and organisation of rights: Managing permissions.

Common mistake: Granting storage:logs:read with no condition: the person can then read every log bucket, including audit. Add the condition on the bucket name.

6. Changing, emptying, deleting #

Operations to handle with care.

The effects #

OperationEffect
Increase retentionexisting data is kept longer
Reduce retentiondata older than the new period is deleted
Empty the bucketall its data is deleted, the bucket remains
Delete the bucketthe bucket and its data disappear; rules using it must be fixed
Common mistake: Reducing a retention to save money without checking legal or contractual obligations: deletion is permanent. Document the chosen period for each bucket (see Data retention in Dynatrace).

7. Costs #

What retention costs.

What is billed #

With DPS licensing, Grail data is billed on ingestion, retention (volume kept multiplied by duration) and queries (volume read). The bucket choice therefore directly affects the bill (see Dynatrace licensing and Licensing and FinOps).

  • Send verbose logs to a short bucket rather than keeping them 35 days.
  • For a long-term indicator, extract a metric in OpenPipeline and keep the raw log briefly.
  • Drop at ingestion what is never used (health probes, chatty library logs).
Depending on the version: Depending on the contract, some retention offers include part of the queries: compare your subscription options before setting durations.

8. Commands to know and lab #

The cheat sheet and a guided exercise.

Commands to know #

ActionCommand or screen
See buckets and their retentionStorage management, or fetch dt.system.buckets
Create a bucketPOST /platform/storage/management/v1/bucket-definitions
Measure volume per bucketfetch logs | summarize count(), by: { dt.system.bucket }
Read one bucket| filter dt.system.bucket == "…"
Route to a bucketOpenPipeline, storage step with a DQL condition
Restrict readingWHERE storage:bucket-name = "…"

Lab: an audit bucket #

  1. Measure the volume of Linux authentication logs over 7 days (log.source containing auth.log or secure).
  2. Create the logs_audit_1y bucket (logs table, 365 days), in the UI or with the API.
  3. In OpenPipeline, add a storage rule that sends these logs to the new bucket.
  4. Trigger a few SSH logins on a monitored host, then check with the query in section 5 that new lines arrive in logs_audit_1y.
  5. Create an IAM policy that reserves reading this bucket to the security group, and test with an account outside it.

Expected result: authentication logs are kept for one year, readable by the security team only, and other logs keep the default retention.

📄 Grail buckets in Dynatrace: creation, routing, retention, rights and costs →

My progress

  • ⏱ Estimated time : ≈ 15 min

Sign in to track your progress and take notes. Sign in

💬 Recent discussions about this course

Ask a question about this lesson →See all discussions about this course

Course Glossary

AIOps (Artificial Intelligence for IT Operations)

The use of artificial intelligence and machine learning to automate and improve IT operations (e.g., anomaly detection, reducing alert noise).

OpenTelemetry

An open source framework providing standards, APIs, and SDKs to collect and export observability data (traces, metrics, logs) in an agnostic way.

Core Web Vitals

Set of three metrics defined by Google to measure the real experience of a web page: loading (LCP (Largest Contentful Paint)), responsiveness (INP (In...

LCP (Largest Contentful Paint)

Time until the largest visible element of the page (image, video or text block) is rendered: it shows when the main content appears. Loading metric of...

INP (Interaction to Next Paint)

Latency of interactions (click, tap, key press) observed over the whole visit: the delay between the user's action and the next paint. The reported va...

CLS (Cumulative Layout Shift)

Measure of visual stability: the sum of unexpected layout shifts (a button moving just as you click, text pushed down by an ad). Unitless, computed ov...

FCP (First Contentful Paint)

Time until the first content (text, image, SVG) is rendered: the moment the user sees the page start loading. It is not a Core Web Vital, but it helps...

TTFB (Time to First Byte)

Time between the start of navigation and the arrival of the first byte of the response: it adds up redirects, DNS, TCP/TLS connection and server proce...

FID (First Input Delay)

Former responsiveness metric of the Core Web Vitals: the delay before the browser starts handling the first interaction (good ≤ 100 ms). It ignored la...

TBT (Total Blocking Time)

Lab metric (Lighthouse): the sum, between FCP (First Contentful Paint) and the end of loading, of the blocking part of each long task (over 50 ms) on ...

CrUX (Chrome UX Report)

Google's public dataset aggregating the Core Web Vitals measured from real Chrome users (at the 75th percentile, per origin and URL, over a rolling 28...

Lighthouse

Google's free audit tool, built into Chrome DevTools and PageSpeed Insights: it loads the page in a simulated environment and scores performance, acce...

Apdex

Application Performance Index: a satisfaction score between 0 and 1 based on a time threshold T. Requests under T are “satisfied”, between T and 4T “t...

Recommended Articles

Advanced logs with OpenPipeline: processing, masking, buckets and retention

Manage logs in Dynatrace with OpenPipeline: ingestion, routing, DQL processing (parsing, enrichme...

Grail: the Dynatrace data lakehouse and the DQL language

Grail stores all Dynatrace SaaS observability data (logs, metrics, traces, events, entities) with...

Data retention in Dynatrace: Grail, buckets and durations by data type

Understand how long Dynatrace keeps logs, traces, metrics, sessions and events, manage retention ...

Advanced Grail and DQL: performance, parse, joins, time series, entities and correlation

Writing fast, low-cost DQL queries, parsing text with DPL and JSON, combining sources with lookup...

DQL in practice: exploring logs and events, notebooks, dashboards and performance

Use the Dynatrace Query Language day to day: explore logs and events, chain commands, parse field...

The Dynatrace Investigations app: investigating Grail data

Discover the Investigations app: DQL queries, extraction with DPL Architect, enrichment, query tr...

Using the Dynatrace API v2: a complete guide to automation

Learn how to use the Dynatrace API to automate your observability: managing scopes, routing throu...

License consumption types

Understand the evolution of billing in Dynatrace: the difference between the old licensing model ...

Differences between Technologies and Services in Dynatrace

In Dynatrace, the concepts of 'Technology' and 'Services' help organize and monitor application p...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!