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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
IT之家
IT之家
Y
Y Combinator Blog
T
Tailwind CSS Blog
B
Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
InfoQ
J
Java Code Geeks
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
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
Use library injection to auto-instrument and trace your K...
2023-01-30 · via Datadog | The Monitor blog

Many organizations rely on distributed tracing in Datadog APM to gain end-to-end visibility into the performance of their Kubernetes applications. But as teams grow, it can become impractical for them to manually configure each new application with the libraries and environment variables needed for tracing. Traditionally, this manual configuration has required developers to build a new application image with the appropriate tracing library installed—a process that activates a CI/CD pipeline and brings development to a temporary halt.

To solve this problem, we’ve developed a workflow that automates instrumentation, enabling you to configure tracing for your Kubernetes application without changing or rebuilding your application image. You can now inject Java, Node.js, and Python tracing libraries directly into your pod at runtime via the Datadog Admission Controller by writing a single annotation into your application’s YAML file.

In this post, we’ll cover the following topics to help you quickly set up Datadog APM for your Kubernetes environment without needing to rebuild or redeploy your application image:

Faster time-to-value for APM with library injection

Previously, configuring your applications to send traces required building a new application image that included the library and updated configuration files. This manual method of instrumentation is lightweight when dealing with a small number of applications. However, it can amount to greater operational overhead as platforms continue to grow with new applications and features that require tracing.

Library injection via the Datadog Admission Controller enables you to configure tracing for your Kubernetes application without building a new application image. You can enable library injection by adding a single annotation in a pod’s configuration template when you configure the Datadog Agent for your Kubernetes cluster. Once you apply this new configuration, Datadog will automatically detect the annotation and inject the appropriate tracing library into your pod at runtime as a separate init container. After it’s deployed, the container will copy relevant library files from the file system to a shared path accessible by all your application containers. Because the tracing library is orchestrated as a separate container, this method does not require you to change your application code or push a new container image. This avoids the CI/CD pipeline that would launch and make you wait for your new application image to build, test, and then redeploy. As a result, you can begin collecting traces from your Kubernetes applications in just minutes.

The Admission Controller can also be used to inject environment variables and standard tags such as env, service, and version from application labels into your container tags. Because library injection relies on pod annotations, you can choose to adopt it into your instrumentation workflow or continue to send traces from your application to the Agent by using UDS or TCP ports.

How to instrument your application with library injection

To begin collecting traces with Datadog, first make sure that you’re running the Datadog Agent V7.40+ and Datadog Cluster Agent in your Kubernetes environment. Instrumenting your application through library injection then involves enabling the Admission Controller, configuring the necessary labels and annotations, and enabling unified service tags for the associated pod.

Enable the Admission Controller

If you’re managing Kubernetes with Datadog’s Helm chart (v2.35.0+), the Admission Controller is enabled by default, and you can proceed to the next step. If you’re using the Datadog Operator instead, you can follow these instructions to enable the Admission Controller for the Datadog Agent.

Annotating your pod with the correct tracing library

Once the Admission Controller is enabled, Datadog will apply changes to your pod at runtime and inject the appropriate library into a separate container. You can perform this step and annotate your pods for library injection by using the labels and annotations shown below:

...

template:

metadata:

labels:

admission.datadoghq.com/enabled: "true"

#Enable Admission Controller to mutate new pods in this deployment

admission.datadoghq.com/config.mode: "socket"

annotations:

admission.datadoghq.com/<LANGUAGE>-lib.version: "<VERSION>"

#Enable library injection for a specified tracing library.

...

Configuring unified service tagging

With the Admission Controller, you can also quickly configure your application for unified service tagging. Unified service tags enable you to identify meaningful trends by automatically cross-referencing your traces, logs, and metrics through the common reserved tags env, service, and version. Using these tags, you can quickly filter your traces to troubleshoot a new version of your application, or aggregate your services to identify those with the largest customer throughput. You can easily set unified service tags for your application by including the following labels in both your deployment metadata and pod template.

...

metadata:

labels:

tags.datadoghq.com/env: "<ENV>"

tags.datadoghq.com/service: "<SERVICE>"

tags.datadoghq.com/version: "<VERSION>"

...

Once you’ve finished configuring your deployment object, your pods will be automatically instrumented. Because Datadog uses a dedicated container for the tracing library injected named datadog-lib-init, you can check to see if your injection was successful by verifying that the pod includes that container, as shown below:

Verify that library injection was successful with the init container

Get started with Datadog today

Library injection via the Admission Controller simplifies the instrumentation process, enabling you to view APM traces in just minutes without changing or rebuilding your application. More information about library injection can be found in our documentation. You can learn more about monitoring your Kubernetes application with Datadog in this blog post.

If you don’t already have a Datadog account, you can sign up for a free 14-day trial today.