Skip to content

Dynatrace

Tails the files and sends them to Dynatrace’s OTLP endpoint, which takes protobuf over HTTP only:

receivers:
file_log/artex:
include:
- /artex/audit/target.jsonl
- /artex/audit/agent.jsonl
start_at: beginning
operators:
- type: json_parser
parse_to: attributes
timestamp:
parse_from: attributes.time
layout_type: gotime
layout: "2006-01-02T15:04:05.999999999Z07:00"
severity:
parse_from: attributes.severity_text
# These describe the writer, so they go on the resource.
- type: move
from: attributes["service.name"]
to: resource["service.name"]
- type: move
from: attributes["service.version"]
to: resource["service.version"]
- type: move
from: attributes["service.instance.id"]
to: resource["service.instance.id"]
# Absent when serve runs without an engagement.
- type: move
if: 'attributes["artex.engagement_id"] != nil'
from: attributes["artex.engagement_id"]
to: resource["artex.engagement_id"]
processors:
batch: {}
transform/body:
log_statements:
- context: log
statements:
# time, severity_*, event_name and body are log record fields, not attributes.
# Lifting body also drops the parsed line, which would otherwise still carry every field.
- set(log.event_name, log.attributes["event_name"]) where log.attributes["event_name"] != nil
- set(log.body, log.attributes["body"]) where log.attributes["body"] != nil
- delete_matching_keys(log.attributes, "^(time|severity_number|severity_text|event_name|body)$")
exporters:
otlphttp/dynatrace:
endpoint: "${env:DT_ENDPOINT}/api/v2/otlp"
headers:
Authorization: "Api-Token ${env:DT_API_TOKEN}"
service:
pipelines:
logs:
receivers: [file_log/artex]
processors: [transform/body, batch]
exporters: [otlphttp/dynatrace]

The transform moves event_name and the short body summary into the log record, so attributes carry the fields and Dynatrace does not store the whole line again as content. A platform token works with Authorization: Bearer <token> and needs the openpipeline:logs:ingest scope (classic tokens: logs.ingest). Name only the active files: rotated generations (target.jsonl.<UTC time>, older ones .gz) must not match include.

On a host with OneAgent, add a custom log source for the absolute paths of the stream files and a log ingest rule (both are needed). The Log Ingest API v2 also takes JSON Lines (Content-Type: application/jsonl), so any shipper can post the files as they are. Records older than 72 hours are rejected.

  • Built-in buckets have fixed retention (default_logs is 35 days). For a 7-day copy, create a custom bucket per stream and add an OpenPipeline bucket assignment on artex.stream. A permission rule can restrict the anthropic stream to a smaller group.
  • Keep detection logic in ARTEX and alert on its records. A Davis anomaly detector with a records analyzer over this DQL fires per ARTEX alert:
fetch logs
| filter service.name == "artex-cc" and event_name == "artex.alert"
| fields timestamp, security_rule.name, artex.alert.severity, artex.identity, server.address, content
  • Rates, for example requests per attribution tag. artex.identity on target traffic is the claimed label of an attribution tag, and each web UI chat conversation’s traffic carries its own chat/<conversation id> label (capture_command_output is artex/exec), so this separates chat conversations, ARTEX’s other clients and sessions you tagged yourself:
fetch logs
| filter service.name == "artex-cc" and artex.stream == "target" and event_name == "artex.http"
| makeTimeseries requests = count(), by:{artex.identity}
  • A stream that stops sending artex.heartbeat records (every 60 seconds by default) means the writer or the shipper is down. Alert when the heartbeat count per artex.stream over five minutes drops to zero.
  • OTLP straight from ARTEX (#395) to https://<environment-id>.live.dynatrace.com/api/v2/otlp, with protobuf over HTTP and an Authorization: Api-Token <token> header, without a Collector.
  • Metrics (#396). Dynatrace rejects cumulative counters, so OTLP metrics would need delta temporality, and a scraped /metrics would need the Collector’s cumulativetodelta processor. Scopes: openpipeline:metrics:ingest (classic tokens: metrics.ingest).
  • Runner resource attributes (#392). Dynatrace’s Claude Code monitoring uses Claude Code’s own telemetry. With ARTEX’s artex.* resource attributes on the claude processes the web UI runner starts, both could be filtered by engagement in DQL.
  • Collector config: dynatrace-otel-collector validate 0.61.0 passed with placeholder endpoint and token.
  • The OneAgent setup, buckets and DQL were written from Dynatrace documentation only and were not run against a tenant.