惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
博客园 - 司徒正美
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
L
LangChain Blog

Datadog | The Monitor blog

Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure Annotate traces to improve LLM quality with Datadog LLM Observability What’s new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis
Introducing DogStatsD Mapper
2020-02-18 · via Datadog | The Monitor blog

Since StatsD was introduced by Etsy in 2011, it has become a mainstay of infrastructure monitoring. But as dev and ops teams rely more and more on containerized microservices, they have pushed the limits of StatsD’s design. One major shortcoming is that StatsD has no built-in support for tagging your metrics with key-value pairs. If you want to get context into different slices of your infrastructure but are using software that can only generate metrics in StatsD format, you’ll need some way to process your StatsD metrics into tags.

To make this task quicker and easier, Datadog has introduced DogStatsD Mapper, which automatically generates tags for StatsD metrics based on user-configured rules. By using DogStatsD Mapper, you can convert parts of your StatsD metric names into tags without having to re-instrument your code, and without having to run a separate server (like statsd exporter) to transform your metrics.

In a typical StatsD setup, application code is instrumented to send metrics as single-line datagrams to a StatsD server. StatsD then flushes these metrics periodically to a storage backend. The names of StatsD metrics are designed to work with Graphite’s hierarchical directory structure, and take the form of dot-delimited namespaces. Since there are no keys, only values, the only way to group or filter metrics by different combinations of metadata is to use a dedicated tag processing server such as Graphite’s Carbon.

statsd2

Some tools generate metrics only as StatsD datagrams. Apache Airflow, for example, emits metrics using Python’s StatsD library. If parts of your infrastructure are instrumented to emit metrics in StatsD format, and you want to group and filter your metrics by tag, you’ll need a way to generate tags downstream from your StatsD client. The airflow-exporter plugin for Airflow attempts something like this, but exposes only two Airflow metrics.

How DogStatsD Mapper works

The Datadog Agent can ingest StatsD metrics as well as metrics in the DogStatsD format, which extends StatsD to include tags. DogStatsD Mapper runs as part of the Agent’s built-in DogStatsD server. When the Agent receives an untagged metric in StatsD format, it uses rules to map segments of the metric’s namespace to a list of tags. It then gives the metric a new name and processes it like any other tagged metric. (If you’re curious as to how this works behind the scenes, the Agent is open source.)

mapper-rule2

Tag any StatsD metric

To create a rule, specify the namespace of a StatsD metric, replacing all or part of each namespace segment with wildcards or regular expressions. Then indicate the name of the metric as it will appear within Datadog and where in the metric’s namespace DogStatsD Mapper will look for tags. If DogStatsD Mapper detects that the namespace of a StatsD metric matches a rule, it will extract tags and rename the metric.

For example, you can generate tags for your Airflow StatsD metrics by copying rules we provide in our documentation and pasting them into your Datadog Agent configuration file:

dogstatsd_mapper_profiles:

- name: airflow

prefix: "airflow."

mappings:

# [...]

- match: "airflow.dag.*.*.duration"

name: "airflow.dag.task.duration"

tags:

dag_id: "$1"

task_id: "$2"

# [...]

Using this configuration, DogStatsD Mapper will transform any StatsD metric matching the pattern airflow.dag.*.*.duration into a metric called airflow.dag.task.duration with the dag_id tag set to the name of the Airflow DAG and the task_id tag set to the name of the Airflow task.

airflow2

Start mapping your StatsD metrics

If you’re a Datadog customer, you can start defining mapping rules right away to extract tags from your StatsD metrics and get insight into different slices of your environment. With DogStatsD Mapper built into the Datadog Agent (version 7.17+), you can enjoy the full power of Datadog tagging with your own StatsD-instrumented legacy code as well as with infrastructure tools written with StatsD in mind (e.g., Airflow). If you’re new to Datadog, sign up for a 14-day free trial.