MCPcopy Index your code
hub / github.com/coroot/coroot-node-agent

github.com/coroot/coroot-node-agent @v1.34.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.34.2 ↗ · + Follow
935 symbols 2,665 edges 175 files 4 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Coroot-node-agent

Go Report Card License

The agent gathers metrics related to a node and the containers running on it, and it exposes them in the Prometheus format.

It uses eBPF to track container related events such as TCP connects, so the minimum supported Linux kernel version is 5.1.

Features

TCP connection tracing

To provide visibility into the relationships between services, the agent traces containers TCP events, such as connect() and listen().

Exported metrics are useful for: * Obtaining an actual map of inter-service communications. It doesn't require integration of distributed tracing frameworks into your code. * Detecting connections errors from one service to another. * Measuring network latency between containers, nodes and availability zones.

Related blog posts: * Building a service map using eBPF * How ping measures network round-trip time accurately using SO_TIMESTAMPING * The current state of eBPF portability

Log patterns extraction

Log management is usually quite expensive. In most cases, you do not need to analyze each event individually. It is enough to extract recurring patterns and the number of the related events.

This approach drastically reduces the amount of data required for express log analysis.

The agent discovers container logs and parses them right on the node.

At the moment the following sources are supported: * Direct logging to files in /var/log/ * Journald * Dockerd (JSON file driver) * Containerd (CRI logs)

To learn more about automated log clustering, check out the blog post "Mining metrics from unstructured logs".

Delay accounting

Delay accounting allows engineers to accurately identify situations where a container is experiencing a lack of CPU time or waiting for I/O.

The agent gathers per-process counters through Netlink and aggregates them into per-container metrics: * container_resources_cpu_delay_seconds_total * container_resources_disk_delay_seconds_total

Related blog posts: * Delay accounting: an underrated feature of the Linux kernel

Out-of-memory events tracing

The container_oom_kills_total metric shows that a container has been terminated by the OOM killer.

Instance meta information

If a node is a cloud instance, the agent identifies a cloud provider and collects additional information using the related metadata services.

Supported cloud providers: AWS, GCP, Azure, Hetzner

Collected info: * AccountID * InstanceID * Instance/machine type * Region * AvailabilityZone * AvailabilityZoneId (AWS only) * LifeCycle: on-demand/spot (AWS and GCP only) * Private & Public IP addresses

Related blog posts: * Gathering cloud instance metadata in AWS, GCP and Azure

Installation

Follow the Coroot documentation

Metrics

The collected metrics are described here.

Coroot

The best way to turn metrics to answers about app issues is to use Coroot - a zero-instrumentation observability tool for microservice architectures.

A live demo of Coroot is available at demo.coroot.com

Contributing

To start contributing, check out our Contributing Guide.

License

Coroot-node-agent is licensed under the Apache License, Version 2.0.

The BPF code is licensed under the General Public License, Version 2.0.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Close
called by 97
gpu/types_windows.go
metric
called by 82
metrics/metrics.go
Counter
called by 73
metrics/metrics.go
String
called by 72
common/net.go
Gauge
called by 65
metrics/metrics.go
Path
called by 42
proc/proc.go
IP
called by 35
common/net.go
NewFromProcessCgroupFile
called by 30
cgroup/cgroup.go

Shape

Function 420
Method 273
Struct 151
Class 77
TypeAlias 13
Interface 1

Languages

Go79%
C19%
Java2%
C++1%

Modules by API surface

containers/container.go45 symbols
ebpftracer/ebpf/l7/l7.c37 symbols
ebpftracer/tracer.go34 symbols
common/net.go32 symbols
containers/registry.go22 symbols
profiling/profiling.go18 symbols
ebpftracer/elf.go18 symbols
windows/nettracer/etw.go17 symbols
tracing/tracing.go16 symbols
profiling/goheap.go16 symbols
ebpftracer/ebpf/tcp/state.c16 symbols
prom/remote_writer.go15 symbols

For agents

$ claude mcp add coroot-node-agent \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact