Datadog Agent

repository·main·Indexed 25 days ago

https://github.com/datadog/datadog-agent

A monitoring tool that collects metrics, traces, and logs from infrastructure and sends them to Datadog. This repository contains source code for Agent versions 6 and 7, including the ai-usage-agent-native-host for AI usage monitoring and a config-stream-client for verifying core-agent config stream functionality. It features a diagnostic tool, `agent diagnose`, for validating installation and connectivity, and utilizes the Bazel build system.

Tokens
312.5K
Snippets
491
Records
1.3K
Agent score
86%

What's inside datadog-agent

  1. Overview of Host Profiler Command

    main

    The host-profiler command is the entry point for the standalone Datadog Host Profiler binary. It collects system-wide, low-overhead profiling data from Linux hosts using eBPF technology.

    ⚠️ Linux Only: This binary is only supported on Linux systems with eBPF capabilities (kernel 4.15+). It will not run on macOS, Windows, or other operating systems.

  2. Overview of the scheduler package

    main

    The scheduler package manages the timing and dispatching of checks to the execution pipeline. It handles multiple instance configurations for any given check, ensuring each is sent to the pipeline at its specified interval.

    Key characteristics:

    • It maintains a collection of time.Tickers associated with a list of check.Checks.
    • When a ticker fires, all checks in the associated list are dispatched to the execution pipeline.
    • Each queue operates within its own goroutine.
    • The Scheduler implementation uses channels to synchronize queues and communicate with the scheduler loop for commands like Run and Stop.
  3. Overview of Kubernetes State Core Check

    main

    The Kubernetes State Core Check is a Datadog Agent check designed to collect Kubernetes metrics. It serves as an alternative to the kubernetes_state Python check. Instead of querying the Kubernetes API directly, it leverages the kube-state-metrics project and extends its data to generate Datadog metrics.

    For detailed information on the specific metrics collected, refer to the official Datadog public documentation or the local kubernetes_state.md file within the repository.

  4. Overview of Datadog Cluster Agent

    main

    The Datadog Cluster Agent is designed for containerized environments. It provides specialized functionality for managing Datadog Agent deployments in clusters (such as Kubernetes) to improve scalability and reduce the load on the Datadog backend.

    For detailed configuration, deployment patterns, and feature explanations, refer to the official Datadog documentation.

  5. Overview of Datadog Agent RtLoader

    main

    RtLoader is a C++ wrapper around the CPython API designed to enable CPython embedding and extending. It provides a C89-compatible public API, making it suitable for use by foreign languages like Go.

    Key features include:

    • Python Version Abstraction: Decouples client applications from CPython by allowing the Python version to be decided at runtime via dlopen of the appropriate backend libraries.
    • Python 3 Support: Provided via the libdatadog-agent-three library (Python 2 is no longer supported).
    • C89 Compatibility: The API is exposed through include/datadog_agent_rtloader.h.
  6. Overview of the SafeNVML Package

    main
    The safenvml package provides a safe wrapper around NVIDIA's NVML library. It is designed to ensure compatibility with older drivers by checking for symbol availability before execution, which prevents runtime panics when attempting to use NVML functions that are not present in specific driver versions.
  7. Overview of the Remote Agent Component

    main
    The remoteagent component provides the infrastructure required to expose data from any Agent process to the Core Agent. At startup, every Remote Agent advertises its gRPC endpoint and its available services to the Core Agent. This allows the Core Agent to invoke services on the Remote Agent via gRPC.
  8. Overview of Datadog Agent Components

    main

    The comp/ directory contains the modular components that make up the Datadog Agent. These components are organized into 'Component Bundles' which group related functionalities. Key bundles include:

    • agent: Core agent runtimes and specific integrations like cloudfoundrycontainer and jmxlogger.
    • aggregator: Metric pipeline components including the demultiplexer.
    • api: Internal Agent API components, including endpoints for config, flare, or status, and grpcserver interfaces.
    • checks: Component-based agent checks (e.g., windowseventlog, winregistry).
    • collector: The collector bundle responsible for data collection.
    • core: Essential services common to all agent flavors, such as autodiscovery, config, log, telemetry, tagger, and diagnose (flare generation).
    • dogstatsd: Metric pipeline components for DogStatsD, including the HTTP server and statsd client.
  9. Overview of the Tagger Server gRPC implementation

    main

    The comp/core/tagger/server package implements a gRPC server designed to stream Tagger entities to remote tagger clients.

    Connection Behavior:

    1. Subscription: When a client connects to the gRPC server, the server creates a subscription to the local tagger to stream tags.
    2. Initial Burst: Before streaming real-time tag events, the server sends an initial burst containing a snapshot of the current tagger content.
    3. Event Streaming: Once the initial burst is processed, the server streams new tag events to the client based on the filters provided in the streaming request.
  10. Overview of the Datadog Trace Agent

    main
    The Datadog Trace Agent acts as an intermediary between instrumented applications (using Datadog APM SDKs or OpenTelemetry) and the Datadog backend. It is responsible for receiving trace payloads, normalizing and filtering data, making intelligent sampling decisions to manage volume, computing aggregated RED metrics (statistics), and forwarding the processed data to the backend.