Skip to content

Pipeline rule recipes

Each recipe is a single rule for one kind of data. Copy it for traces or metrics where the same problem applies, and test the conditions on a live sample before you publish.

GoalType and dataConditionsNotes
Drop health-check logsDrop, logsbody matches regex health|readiness|livenessAdd a service.name condition if the words also appear in real messages.
Drop debug logs from one serviceDrop, logsservice.name equals alarms-service and severity is below INFOKeeps the service’s info, warning, and error logs.
Drop a namespace’s logs in devDrop, logsk8s.namespace.name is one of kube-system, cert-managerApply it to a group such as env = dev, so production keeps those logs.
Drop health-check spansDrop, traceshttp.route is one of /health, /ready, /metricsThe endpoint’s request rate and latency also disappear from APM.
Drop spans of static assetsDrop, tracesspan.name matches regex ^(GET|HEAD) /static/
Drop metrics from a test environmentDrop, metricsdeployment.environment equals testOr apply a rule with no conditions to a group of test hosts.
Drop one kind of JSON logDrop, logsA top-level key of the JSON body, such as type equals http-logAdd the condition from a sampled record.

Not sure what a drop catches? Publish it in shadow mode and check Activity before you drop anything.

GoalType and dataSettingsNotes
Mask payment and contact dataMask, logsCard numbers, email addresses, and phone numbers, replaced with ****. Enforce on.Enforce keeps the mask even when an agent has a custom config override.
Keep users countable but unreadableMask, logsEmail addresses, replaced with Keyed hash (HMAC)The same email always produces the same hash. Needs a redaction key on the agent.
Mask India identifiersMask, logsAadhaar numbers and PAN (India)Add IBANs for banking payloads.
Mask your own token formatMask, tracesCustom regex, for example sk_live_[A-Za-z0-9]{24}Masked values show a lock in the sample preview.
Mask personal data in metric attributesMask, metricsEmail addresses and IP addressesSeries that become identical after masking are merged.
GoalType and dataSettingsNotes
Strip auth headers from spansEdit attributes, tracesRemove http.request.header.authorization and http.request.header.cookie
Rename to the standard nameEdit attributes, tracesRename userId to user.idDashboards and alerts that use user.id then work across services.
Label data with its ownerEdit attributes, logsSet team to paymentsApply it to the group of that team’s hosts.
Remove a high-cardinality metric labelEdit attributes, metricsRemove user.id, merge series with SumUse Max, Min, or Mean for gauges.
GoalType and dataSettingsNotes
Keep 10% of traces, all errors, and slow requestsSample, tracesKeep 10%, always keep traces with errors, keep traces slower than 2000 msTail sampling, on the sampling gateway.
Head-sample a busy environmentSample, tracesKeep 20%, no keep optionsOne head-sampling rate per environment.
Sample one service’s tracesSample, tracesservice.name equals checkout, keep 25%, always keep traces with errorsConditions need tail sampling, so turn on a keep option first.