0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-10 16:17:36 +00:00

Observability cent points improved ()

* Observability cent points improved

* Observability cent points 2

* fix formatting

* fixes

---------

Co-authored-by: ilyam8 <ilya@netdata.cloud>
This commit is contained in:
kanelatechnical 2025-04-05 16:40:50 +03:00 committed by GitHub
parent 05f564b4e5
commit 86eb74af33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 317 additions and 632 deletions
docs
nodes-ephemerality.md
observability-centralization-points
README.mdbest-practices.md
metrics-centralization-points
src/streaming

View file

@ -1,90 +1,83 @@
# Nodes Ephemerality in Netdata
## Overview
Netdata v2.3.0 changes how ephemeral nodes are defined and managed in distributed monitoring environments. This update enhances monitoring reliability while providing flexibility for dynamic infrastructure management.
**Key Changes**:
Netdata now defines ephemeral nodes as "nodes that are expected to disconnect without raising alerts," replacing the previous definition of forgotten nodes after one day of disconnection. This change provides three major benefits:
1. **Improved Permanent Node Monitoring**: Disconnection alerts are triggered only for permanent nodes, reducing alert noise and helping teams focus on genuine operational issues.
2. **Better Support for Dynamic Infrastructure**: Organizations using auto-scaling cloud instances, containers, and other dynamic resources can now designate nodes as ephemeral, preventing unnecessary alerts.
3. **Automated Node Management**: The system automatically removes ephemeral nodes based on configurable retention periods, maintaining clean and relevant monitoring dashboards.
## Node Types
Netdata supports two types of nodes:
Netdata categorizes nodes into two types:
| Type | Description | Common Examples |
|-----------|------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Ephemeral | Nodes expected to disconnect or reconnect frequently | • Auto-scaling cloud instances<br/>• Dynamic containers and VMs<br/>• IoT devices with intermittent connectivity<br/> Development/test environments with frequent restarts |
| Permanent | Nodes expected to maintain continuous connectivity | • Production servers<br/>• Core infrastructure nodes<br/>• Critical monitoring systems<br/> Stable database servers |
| Type | Description | Common Use Cases |
|---------------|------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Ephemeral** | Expected to disconnect or reconnect frequently | - Auto-scaling cloud instances<br>- Dynamic containers and VMs<br>- IoT devices with intermittent connectivity<br>- Development/test environments with frequent restarts |
| **Permanent** | Expected to maintain continuous connectivity | - Production servers<br>- Core infrastructure nodes<br>- Critical monitoring systems<br>- Stable database servers |
> **Note**: Disconnections in permanent nodes indicate potential system failures requiring immediate attention.
> **Note:** Disconnections in permanent nodes indicate potential system failures and require immediate attention.
## Setting Up Ephemeral Nodes
### Key Benefits
1. **Reduced Alert Noise**: Disconnection alerts now apply only to permanent nodes, helping teams focus on actual issues.
2. **Improved Dynamic Infrastructure Support**: Auto-scaling cloud instances, containers, and other temporary resources can be designated as ephemeral to prevent unnecessary alerts.
3. **Automated Node Cleanup**: Ephemeral nodes are removed based on configurable retention periods, keeping dashboards relevant and uncluttered.
## Configuring Ephemeral Nodes
By default, Netdata treats all nodes as permanent. To mark a node as ephemeral:
1. Open `netdata.conf` on the target node
1. Open the `netdata.conf` file on the target node.
2. Add the following configuration:
```ini
[global]
is ephemeral node = yes
```
3. Restart the node
3. Restart the node.
This configuration sets the `_is_ephemeral` host label which propagates to Netdata Parents and Netdata Cloud.
This setting applies the `_is_ephemeral` host label, which propagates to Netdata Parents and Netdata Cloud.
## Alerts: Parent Node Alerts
## Alerts for Parent Nodes
Netdata v2.3.0 adds [two alerts](https://github.com/netdata/netdata/blob/master/src/health/health.d/streaming.conf) specifically for permanent nodes:
Netdata v2.3.0 introduces two new alerts specifically for permanent nodes:
| Alert | Triggers |
|---------------------------|---------------------------------------------------------------|
| streaming_never_connected | When permanent nodes have never connected to a Netdata Parent |
| streaming_disconnected | When previously connected permanent nodes disconnect |
| Alert | Trigger Condition |
|-----------------------------|-----------------------------------------------------------|
| `streaming_never_connected` | A permanent node has never connected to a Netdata Parent. |
| `streaming_disconnected` | A previously connected permanent node has disconnected. |
## Monitoring Child Node Status
To investigate alert:
To investigate an alert:
1. Navigate to the `Top` tab in your dashboard
2. Select the `Netdata-streaming` function
3. Review the detailed node status table:
- Red lines: Node connection problems (when nodes attempt to connect to this Parent)
- Yellow lines: Restreaming issues (when this Parent attempts to stream data to other Parent nodes)
- Color highlighting applies only to permanent nodes
- Filter by `Ephemerality` to focus on permanent nodes
- Use `InStatus`, `InReason`, and `InAge` columns to analyze node connections to the parent node
- Use `OutStatus`, `OutReason`, and `OutAge` columns to analyze this Parent's restreaming to other Parent nodes
1. Open the `Top` tab in your Netdata dashboard.
2. Select the `Netdata-streaming` function.
3. Review the node status table:
- **Red lines**: Connection issues when nodes attempt to connect to a Parent.
- **Yellow lines**: Restreaming issues when a Parent streams data to another Parent.
- **Color highlighting applies only to permanent nodes**.
- Use the `Ephemerality` filter to view only permanent nodes.
- Check `InStatus`, `InReason`, and `InAge` for incoming connection status.
- Check `OutStatus`, `OutReason`, and `OutAge` for outgoing streaming status.
## Managing Archived Nodes
## Managing Offline Nodes
To clear alerts for permanently offline nodes:
To clear alerts for permanently offline nodes, run:
```bash
netdatacli mark-stale-nodes-ephemeral <node_id | machine_guid | hostname | ALL_NODES>
```
> **Note**: Nodes will revert to permanent status if they reconnect unless configured as ephemeral in their `netdata.conf`.
> **Note:** Nodes will revert to permanent status if they reconnect unless explicitly configured as ephemeral in `netdata.conf`.
## Cloud Integration
Starting with v2.3.0, Netdata Cloud sends node-unreachable notifications **exclusively for permanent nodes**, improving alert relevance.
From v2.3.0 onward, Netdata Cloud sends unreachable-node notifications **only for permanent nodes**, reducing unnecessary alerts.
## Automatic Ephemeral Nodes Cleanup
## Automatically Removing Ephemeral Nodes
The automatic removal of disconnected ephemeral nodes is disabled by default in v2.3.0+. To enable this feature:
By default, Netdata does not automatically remove disconnected ephemeral nodes. To enable automatic cleanup:
1. Edit the `netdata.conf` file on Netdata Parent nodes
1. Open the `netdata.conf` file on Netdata Parent nodes.
2. Add the following configuration:
```ini
[db]
cleanup ephemeral hosts after = 1d
```
3. Restart the node
3. Restart the node.
This setting removes ephemeral nodes from queries 24 hours after disconnection. When all parent nodes remove a node, Netdata Cloud automatically deletes it too.
This setting removes ephemeral nodes from queries after 24 hours of disconnection. Once all parent nodes remove a node, Netdata Cloud automatically deletes it as well.

View file

@ -1,18 +1,26 @@
# Observability Centralization Points
# **Observability Centralization Points**
Netdata supports the creation of multiple independent **Observability Centralization Points**, aggregating metric samples, logs and metadata within an infrastructure.
Netdata allows you to set up multiple **Observability Centralization Points** to aggregate metrics, logs, and metadata across your infrastructure.
Observability Centralization Points are crucial for ensuring comprehensive monitoring and observability across an infrastructure, particularly under the following conditions:
## **Why Use Centralization Points?**
1. **Ephemeral Systems**: For systems like Kubernetes nodes or ephemeral VMs that may not be persistently available, centralization points ensure that metrics and logs are not lost when these systems go offline. This is essential for maintaining historical data for analysis and troubleshooting.
- **Ephemeral Systems**:
- Ideal for **Kubernetes nodes or temporary VMs** that frequently go offline.
- Ensures metrics and logs remain available for analysis and troubleshooting.
2. **Resource Constraints**: In scenarios where the monitored systems lack sufficient resources (disk space or I/O bandwidth, CPU, RAM) to handle observability tasks effectively, centralization points offload these responsibilities, ensuring that production systems can operate efficiently without compromise.
- **Limited Resources**:
- Offloads observability tasks from systems with **low disk space, CPU, RAM, or I/O bandwidth**.
- Keeps production systems running efficiently without performance trade-offs.
3. **Multi-node Dashboards without Netdata Cloud**: For environments requiring aggregated views across multiple nodes but without the use of Netdata Cloud, Netdata Parents can aggregate this data to provide comprehensive dashboards, similar to what Netdata Cloud offers.
- **Multi-Node Dashboards Without Netdata Cloud**:
- Aggregates data from multiple nodes for **centralized dashboards**, similar to Netdata Cloud.
4. **Netdata Cloud Access Restrictions**: In cases where monitored systems cannot connect to Netdata Cloud (due to a firewall policy), a Netdata Parent can serve as a bridge, aggregating data and interfacing with Netdata Cloud on behalf of these restricted systems.
- **Restricted Netdata Cloud Access**:
- Acts as a **bridge** when monitored systems cant connect to Netdata Cloud due to **firewall restrictions**.
When multiple independent centralization points are available:
## **How Multiple Centralization Points Work**
- Netdata Cloud provides a unified infrastructure view by querying all points in parallel.
- Parent nodes without Cloud access provide consolidated views of their connected infrastructure's metrics and logs.
- **With Netdata Cloud**:
- Queries all centralization points in parallel for a unified view of the infrastructure.
- **Without Netdata Cloud**:
- Parent nodes consolidate data from connected systems, providing a local view of metrics and logs.

View file

@ -1,44 +1,35 @@
# Best Practices for Observability Centralization Points
When planning the deployment of Observability Centralization Points, the following factors need consideration:
## Critical factors to consider
1. **Volume of Monitored Systems**: The number of systems being monitored dictates the scaling and number of centralization points required. Larger infrastructures may require multiple centralization points to manage the volume of data effectively and maintain performance.
When setting up Observability Centralization Points, consider the following:
2. **Cost of Data Transfer**: Particularly in multi-cloud or hybrid environments, the location of centralization points can significantly impact egress bandwidth costs. Strategically placing centralization points in each data center or cloud region can minimize these costs by reducing the need for cross-network data transfer.
1. **System Volume**: The number of monitored systems impacts scaling. Larger infrastructures may need multiple centralization points to maintain performance.
2. **Data Transfer Costs**: In multi-cloud or hybrid environments, placing centralization points strategically reduces egress bandwidth costs.
3. **Usability Without Netdata Cloud**: Using fewer centralization points simplifies access and management when Netdata Cloud is not in use.
4. **Optimized Deployment with Netdata Cloud**: Netdata Cloud provides a complete infrastructure view, allowing you to optimize based on:
- **Security** (internet access controls)
- **Cost** (bandwidth and resource allocation)
- **Operational needs** (regional, service, or team-based isolation)
3. **Usability without Netdata Cloud**: When not using Netdata Cloud, observability with Netdata is simpler when there are fewer centralization points, making it easier to remember where observability is and how to access it.
## Cost Optimization Strategies
4. Netdata Cloud provides infrastructure-wide views regardless of centralization points, allowing you to optimize your setup based on:
- Security requirements (such as internet access controls)
- Cost management (including bandwidth and resource allocation)
- Operational needs (like regional, service, or team isolation)
Netdata is designed to keep observability efficient and cost-effective. To manage costs:
## Cost Optimization
- **Scale Out**: Use multiple smaller centralization points to improve efficiency and performance.
- **Use Existing Resources**: Leverage spare capacity before dedicating new resources to observability.
- **Centralized or Separate Logs & Metrics**: Choose whether to store logs and metrics together or separately based on access needs, retention policies, and compliance.
- **Flexible Configuration Management**: Each centralization point can have unique retention and alert settings, helping to control costs and tailor observability for different teams or services.
Netdata has been designed for observability cost optimization. For optimal cost, we recommend using Netdata Cloud and multiple independent observability centralization points:
## Advantages of Netdata's Approach
- **Scale out**: add more, smaller centralization points to distribute the load. This strategy provides the least resource consumption per unit of workload, maintaining optimal performance and resource efficiency across your observability infrastructure.
Netdata provides several benefits over other observability solutions:
- **Use existing infrastructure resources**: use spare capacities before allocating dedicated resources for observability. This approach minimizes additional costs and promotes an economically sustainable observability framework.
- **Scalability & Flexibility**: Multiple independent centralization points allow for customized observability by region, service, or team.
- **Resilience & Reliability**: Built-in replication ensures that observability continues even if a centralization point fails.
- **Optimized Cost & Performance**: Distributing workloads prevents bottlenecks and improves resource efficiency.
- **Ease of Use**: Netdata Agents require minimal setup and maintenance, reducing complexity.
- **On-Prem Control**: Centralization points remain on-prem even when using Netdata Cloud, keeping data within your infrastructure.
- **Comprehensive Observability**: Netdata enables deep visibility by segmenting infrastructure into independent observability points with tailored retention, alerts, and machine learning, while Netdata Cloud provides a unified view.
- **Unified or separate centralization for logs and metrics**: Netdata allows centralizing metrics and logs together or separately. Consider factors such as access frequency, data retention policies, and compliance requirements to enhance performance and reduce costs.
- **Decentralized configuration management**: each Netdata centralization point can have its own unique configuration for retention and alerts. This enables:
- Finer control on infrastructure costs
- Localized control for separate services or teams
## Pros and Cons
Compared to other observability solutions, the design of Netdata offers:
- **Enhanced Scalability and Flexibility**: Netdata's support for multiple independent observability centralization points allows for a more scalable and flexible architecture. This feature is particularly helpful in distributed and complex environments, enabling tailored observability strategies that can vary by region, service, or team requirements.
- **Resilience and Fault Tolerance**: The ability to deploy multiple centralization points also contributes to greater system resilience and fault tolerance. Replication is a native feature of Netdata centralization points, so in the event of a failure at one centralization point, others can continue to function, ensuring continuous observability.
- **Optimized Cost and Performance**: By distributing the load across multiple centralization points, Netdata can optimize both performance and cost. This distribution allows for the efficient use of resources and help mitigate the bottlenecks associated with a single centralization point.
- **Simplicity**: Netdata Agents (Children and Parents) require minimal configuration and maintenance, usually less than the configuration and maintenance required for the Agents and exporters of other monitoring solutions. This provides an observability pipeline that has less moving parts and is easier to manage and maintain.
- **Always On-Prem**: Netdata centralization points are always on-prem. Even when Netdata Cloud is used, Netdata Agents and parents are queried to provide the data required for the dashboards.
- **Bottom-Up Observability**: Netdata is designed to monitor systems, containers and applications bottom-up, aiming to provide the maximum resolution, visibility, depth and insights possible. Its ability to segment the infrastructure into multiple independent observability centralization points with customized retention, machine learning and alerts on each of them, while providing unified infrastructure level dashboards at Netdata Cloud, provides a flexible environment that can be tailored per service or team, while still being one unified infrastructure.
Following these best practices helps maintain a **cost-effective**, **high-performance** observability setup with Netdata.

View file

@ -11,37 +11,54 @@ flowchart BT
C3 -->|stream| P1
```
Netdata **Streaming and Replication** copies the recent past samples (replication) and in real-time all new samples collected (streaming) from production systems (Netdata Children) to metrics centralization points (Netdata Parents). The Netdata Parents then maintain the database for these metrics, according to their retention settings.
- **Netdata Streaming and Replication**:
- Copies **recent past samples** (replication) and **real-time new samples** (streaming) from production systems (**Netdata Children**) to **metrics centralization points** (**Netdata Parents**).
- **Netdata Parents** store the database for these metrics based on **retention settings**.
Each production system (Netdata Child) can stream to **only one** Netdata Parent at a time. The configuration allows configuring multiple Netdata Parents for high availability, but only the first found working will be used.
- **Netdata Child Behavior**:
- Each **Netdata Child** can stream to **only one** Netdata Parent at a time.
- Multiple **Netdata Parents** can be configured for **high availability**, but only the **first working one** will be used.
Netdata Parents receive metric samples **from multiple** production systems (Netdata Children) and can re-stream them to another Netdata Parent. This allows building an infinite hierarchy of Netdata Parents. It also enables the configuration of Netdata Parents Clusters, for high availability.
- **Netdata Parent Capabilities**:
- Receives metric samples **from multiple Netdata Children**.
- Can **re-stream** received metrics to another **Netdata Parent**, forming an **infinite hierarchy** of Parents.
- Supports **Netdata Parents Clusters** for **high availability**.
| Feature | Netdata Child (production system) | Netdata Parent (centralization point) |
|:---------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------:|
| Metrics Retention | Can be minimized, or switched to mode `ram` or `alloc` to save resources. Some retention is required in case network errors introduce disconnects. | Common retention settings for all systems aggregated to it. |
| Machine Learning | Can be disabled (enabled by default). | Runs Anomaly Detection for all systems aggregated to it. |
| Alerts & Notifications | Can be disabled (enabled by default). | Runs health checks and sends notifications for all systems aggregated to it. |
| API and Dashboard | Can be disabled (enabled by default). | Serves the dashboard for all systems aggregated to it, using its own retention. |
| Exporting Metrics | Not required (enabled by default). | Exports the samples of all metrics collected by the systems aggregated to it. |
| Netdata Functions | Netdata Child must be online. | Forwards Functions requests to the Children connected to it. |
| Connection to Netdata Cloud | Not required. | Each Netdata Parent registers to Netdata Cloud all systems aggregated to it. |
| Feature | Netdata Child (Production System) | Netdata Parent (Centralization Point) |
|----------------------------|---------------------------------------------------|-------------------------------------------------------|
| **Metrics Retention** | Minimal retention; can use `ram` or `alloc` mode. | Stores metrics for all connected systems. |
| **Machine Learning** | Can be disabled (default: enabled). | Runs anomaly detection for all connected systems. |
| **Alerts & Notifications** | Can be disabled (default: enabled). | Monitors health and sends alerts for all systems. |
| **API & Dashboard** | Can be disabled (default: enabled). | Hosts the dashboard using its own retention settings. |
| **Exporting Metrics** | Optional (default: enabled). | Exports all collected metrics. |
| **Netdata Functions** | Child must be online to function. | Forwards function requests to connected Children. |
| **Netdata Cloud** | Not required. | Registers all connected systems to Netdata Cloud. |
## Supported Configurations
## **Supported Configurations**
For Netdata Children:
### **For Netdata Children**
1. **Full**: Full Netdata functionality is available at the Children. This means running machine learning, alerts, notifications, having the local dashboard available, and generally all Netdata features enabled. This is the default.
2. **Thin**: The Children are only collecting and forwarding metrics to a Parent. Some local retention may exist to avoid missing samples in case of network issues or Parent maintenance, but everything else is disabled.
- **Full Mode (Default)**:
- All Netdata features are enabled (machine learning, alerts, notifications, dashboard, etc.).
- **Thin Mode**:
- Only collects and forwards metrics to a Parent.
- Some local retention is kept to handle network issues, but all other features are disabled.
For Netdata Parents:
### **For Netdata Parents**
1. **Standalone**: The Parent is standalone, either the only Parent available in the infrastructure, or the top-most of a hierarchy of Parents.
2. **Cluster**: The Parent is part of a cluster of Parents, all having the same data from the same Children. A Cluster of Parents offers high-availability.
3. **Proxy**: The Parent receives metrics and stores them locally, but it also forwards them to a Grand Parent.
- **Standalone**:
- A single Parent in the infrastructure or the top-most Parent in a hierarchy.
- **Cluster**:
- A group of Parents that share the same data from the same Children.
- Provides **high availability**.
- **Proxy**:
- Stores received metrics locally and **forwards them** to a higher-level Parent (Grand Parent).
A Cluster consists of nodes configured as circular **Proxies**, where each node acts as a Parent to all others. When using multiple levels of centralization, only the top level can be configured as a cluster.
### **Cluster Configuration**
## Best Practices
- A Cluster consists of **circular Proxy nodes**, where each Parent acts as a Parent to the others.
- Only the **top level** of a multi-level hierarchy can be configured as a cluster.
Refer to [Best Practices for Observability Centralization Points](/docs/observability-centralization-points/best-practices.md).
## **Best Practices**
For detailed guidelines, check [Best Practices for Observability Centralization Points](/docs/observability-centralization-points/best-practices.md).

View file

@ -1,553 +1,247 @@
# Streaming and replication reference
# Streaming and Replication Reference
This document contains advanced streaming options and suggested deployment options for production.
If you haven't already done so, we suggest you first go through the
[quick introduction to streaming](/docs/observability-centralization-points/README.md)
, for your first, basic parent child setup.
This guide covers advanced streaming options and recommended deployment strategies for production environments. If you're new to Netdata streaming, start with the [quick introduction to streaming](/docs/observability-centralization-points/README.md) to set up a basic parent-child configuration.
## Configuration
## Configuration Overview
There are two files responsible for configuring Netdata's streaming capabilities: `stream.conf` and `netdata.conf`.
Netdata's streaming capabilities are configured through two key files:
From within your Netdata config directory (typically `/etc/netdata`), [use `edit-config`](/docs/netdata-agent/configuration/README.md) to
open either `stream.conf` or `netdata.conf`.
- **`stream.conf`** Controls streaming behavior, including parent and child configurations.
- **`netdata.conf`** Contains global settings that can impact streaming.
```
To edit these files, navigate to your Netdata configuration directory (typically `/etc/netdata`) and run:
```sh
sudo ./edit-config stream.conf
sudo ./edit-config netdata.conf
```
### `stream.conf`
## Configuring `stream.conf`
The `stream.conf` file contains three sections. The `[stream]` section is for configuring child nodes.
The `stream.conf` file has three main sections:
The `[API_KEY]` and `[MACHINE_GUID]` sections are both for configuring parent nodes, and share the same settings.
`[API_KEY]` settings affect every child node using that key, whereas `[MACHINE_GUID]` settings affect only the child
node with a matching GUID.
- **`[stream]`** Configures child nodes.
- **`[API_KEY]`** Defines settings for all child nodes using the same API key.
- **`[MACHINE_GUID]`** Sets configurations for a specific child node matching the given GUID.
The file `/var/lib/netdata/registry/netdata.public.unique.id` contains a random GUID that **uniquely identifies each
node**. This file is automatically generated by Netdata the first time it is started and remains unaltered forever.
### Identifying a Node's GUID
#### `[stream]` section
Each Netdata node has a unique identifier stored in:
This section is used by the sending Netdata.
```sh
/var/lib/netdata/registry/netdata.public.unique.id
```
| Setting | Default | Description |
|-------------------------------------------------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `enabled` | `no` | Whether this node streams metrics to any parent. Change to `yes` to enable streaming. |
| [`destination`](#destination) | | A space-separated list of parent nodes to attempt to stream to, with the first available parent receiving metrics, using the following format: `[PROTOCOL:]HOST[%INTERFACE][:PORT][:SSL]`. [Read more &rarr;](#destination) |
| `ssl skip certificate verification` | `yes` | If you want to accept self-signed or expired certificates, set to `yes` and uncomment. |
| `CApath` | `/etc/ssl/certs/` | The directory where known certificates are found. Defaults to OpenSSL's default path. |
| `CAfile` | `/etc/ssl/certs/cert.pem` | Add a parent node certificate to the list of known certificates in `CAPath`. |
| `api key` | | The `API_KEY` to use as the child node. |
| `timeout` | `1m` | The timeout to connect and send metrics to a parent. |
| `default port` | `19999` | The port to use if `destination` does not specify one. |
| [`send charts matching`](#send-charts-matching) | `*` | A space-separated list of [Netdata simple patterns](/src/libnetdata/simple_pattern/README.md) to filter which charts are streamed. [Read more &rarr;](#send-charts-matching) |
| `buffer size bytes` | `10485760` | The size of the buffer to use when sending metrics. The default `10485760` equals a buffer of 10MB, which is good for 60 seconds of data. Increase this if you expect latencies higher than that. The buffer is flushed on reconnect. |
| `reconnect delay` | `5s` | How long to wait until retrying to connect to the parent node. |
| `initial clock resync iterations` | `60` | Sync the clock of charts for how many seconds when starting. |
| `parent using h2o` | `no` | Set to yes if you are connecting to parent trough it's h2o webserver/port. Currently there is no reason to set this to `yes` unless you are testing the new h2o based netdata webserver. When production ready this will be set to `yes` as default. |
This file is generated automatically the first time Netdata starts and remains unchanged.
### `[API_KEY]` sections
## Recommended Deployment Strategies
This section defines an API key for other Agents to connect to this Netdata.
For a production-ready streaming setup, consider the following best practices:
| Setting | Default | Description |
|------------------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `enabled` | `no` | Whether this API KEY enabled or disabled. |
| `type` | `api` | This section defines an API key. |
| [`allow from`](#allow-from) | `*` | A space-separated list of [Netdata simple patterns](/src/libnetdata/simple_pattern/README.md) matching the IPs of nodes that will stream metrics using this API key. [Read more &rarr;](#allow-from) |
| `retention` | `1h` | The default amount of child metrics history to retain when using the `ram` db. |
| [`db`](#default-memory-mode) | `dbengine` | The [database](/src/database/README.md) to use for all nodes using this `API_KEY`. Valid settings are `dbengine`, `ram`, or `none`. [Read more &rarr;](#default-memory-mode) |
| `health enabled` | `auto` | Whether alerts and notifications should be enabled for nodes using this `API_KEY`. `auto` enables alerts when the child is connected. `yes` enables alerts always, and `no` disables alerts. |
| `postpone alerts on connect` | `1m` | Postpone alerts and notifications for a period of time after the child connects. |
| `health log retention` | `5d` | History of health log events (in seconds) kept in the database. |
| `proxy enabled` | | Route metrics through a proxy. |
| `proxy destination` | | Space-separated list of `IP:PORT` for proxies. |
| `proxy api key` | | The `API_KEY` of the proxy. |
| `send charts matching` | `*` | See [`send charts matching`](#send-charts-matching). |
| `enable compression` | `yes` | Enable/disable stream compression. |
| `enable replication` | `yes` | Enable/disable replication. |
| `replication period` | `1d` | Limits the maximum window that will be replicated from each child. |
| `replication step` | `10m` | The duration we want to replicate per each replication step. |
| `is ephemeral node` | `no` | Indicate whether this child is an ephemeral node. An ephemeral node will become unavailable after the specified duration of "cleanup ephemeral hosts after" from the time of the node's last connection. |
- **Use Multiple Parent Nodes** Ensures redundancy and improves resilience.
- **Optimize Data Retention** Configure retention periods to balance storage costs and data availability.
- **Secure Communications** Enable encryption and authentication to protect data streams.
- **Monitor Performance** Regularly review logs and metrics to ensure efficient streaming operations.
By following these guidelines, you can set up a scalable and reliable Netdata streaming environment.
### `[MACHINE_GUID]` sections
## `stream.conf`
This section is about customizing configuration for specific Agents. It allows many Agents to share the same API key, while providing customizability per remote Agent.
The `stream.conf` file consists of three main sections:
| Setting | Default | Description |
|------------------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `enabled` | `no` | Whether this MACHINE_GUID enabled or disabled. |
| `type` | `machine` | This section defines the configuration for a specific Agent. |
| [`allow from`](#allow-from) | `*` | A space-separated list of [Netdata simple patterns](/src/libnetdata/simple_pattern/README.md) matching the IPs of nodes that will stream metrics using this API key. [Read more &rarr;](#allow-from) |
| `retention` | `3600` | The default amount of child metrics history to retain when using the `ram` db. |
| [`db`](#default-memory-mode) | `dbengine` | The [database](/src/database/README.md) to use for all nodes using this `API_KEY`. Valid settings are `dbengine`, `ram`, or `none`. [Read more &rarr;](#default-memory-mode) |
| `health enabled` | `auto` | Whether alerts and notifications should be enabled for nodes using this `API_KEY`. `auto` enables alerts when the child is connected. `yes` enables alerts always, and `no` disables alerts. |
| `postpone alerts on connect` | `1m` | Postpone alerts and notifications for a period of time after the child connects. |
| `health log retention` | `5d` | History of health log events (in seconds) kept in the database. |
| `proxy enabled` | | Route metrics through a proxy. |
| `proxy destination` | | Space-separated list of `IP:PORT` for proxies. |
| `proxy api key` | | The `API_KEY` of the proxy. |
| `send charts matching` | `*` | See [`send charts matching`](#send-charts-matching). |
| `enable compression` | `yes` | Enable/disable stream compression. |
| `enable replication` | `yes` | Enable/disable replication. |
| `replication period` | `1d` | Limits the maximum window that will be replicated from each child. |
| `replication step` | `10m` | The duration we want to replicate per each replication step. |
| `is ephemeral node` | `no` | Indicate whether this child is an ephemeral node. An ephemeral node will become unavailable after the specified duration of "cleanup ephemeral hosts after" from the time of the node's last connection. |
1. **`[stream]`** Configures child nodes (data senders).
2. **`[API_KEY]`** Defines API keys for parent nodes (data receivers).
3. **`[MACHINE_GUID]`** Customizes settings for specific child nodes.
### `[stream]` Section (Child Node Settings)
This section configures a child node to send metrics to a parent.
| Setting | Default | Description |
|-------------------------------------------------|---------------------------|---------------------------------------------------------------------|
| `enabled` | `no` | Enables streaming. Set to `yes` to allow this node to send metrics. |
| [`destination`](#destination) | (empty) | Defines one or more parent nodes to send data to. |
| `ssl skip certificate verification` | `yes` | Accepts self-signed or expired SSL certificates. |
| `CApath` | `/etc/ssl/certs/` | Directory for trusted SSL certificates. |
| `CAfile` | `/etc/ssl/certs/cert.pem` | File containing trusted certificates. |
| `api key` | (empty) | API key used by the child to authenticate with the parent. |
| `timeout` | `1m` | Connection timeout duration. |
| `default port` | `19999` | Default port for streaming if not specified in `destination`. |
| [`send charts matching`](#send-charts-matching) | `*` | Filters which charts are streamed. |
| `buffer size bytes` | `10485760` | Buffer size (10MB by default). Increase for higher latencies. |
| `reconnect delay` | `5s` | Time before retrying connection to the parent. |
| `initial clock resync iterations` | `60` | Syncs chart clocks during startup. |
| `parent using h2o` | `no` | Set to `yes` if connecting to a parent using the H2O web server. |
### `[API_KEY]` Section (Parent Node Authentication)
This section allows parent nodes to accept streaming data from child nodes using an API key.
| Setting | Default | Description |
|------------------------------|------------|-------------------------------------------------------------|
| `enabled` | `no` | Enables or disables this API key. |
| `type` | `api` | Defines the section as an API key configuration. |
| [`allow from`](#allow-from) | `*` | Specifies which child nodes (IP addresses) can connect. |
| `retention` | `1h` | How long to keep child node metrics in RAM-based storage. |
| [`db`](#db) | `dbengine` | Specifies the database type for this API key. |
| `health enabled` | `auto` | Controls alerts and notifications (`auto`, `yes`, or `no`). |
| `postpone alerts on connect` | `1m` | Delay alerts for a period after the child connects. |
| `health log retention` | `5d` | Duration (in seconds) to keep health log events. |
| `proxy enabled` | (empty) | Enables routing metrics through a proxy. |
| `proxy destination` | (empty) | IP and port of the proxy server. |
| `proxy api key` | (empty) | API key for the proxy server. |
| `send charts matching` | `*` | Defines which charts to stream. |
| `enable compression` | `yes` | Enables or disables data compression. |
| `enable replication` | `yes` | Enables or disables data replication. |
| `replication period` | `1d` | Maximum time window replicated from each child. |
| `replication step` | `10m` | Time interval for each replication step. |
| `is ephemeral node` | `no` | Marks the child as ephemeral (removes it after inactivity). |
### `[MACHINE_GUID]` Section (Per-Node Customization)
This section customizes settings for specific child nodes using their unique Machine GUID.
| Setting | Default | Description |
|------------------------------|------------|----------------------------------------------------------|
| `enabled` | `no` | Enables or disables this specific nodes configuration. |
| `type` | `machine` | Defines the section as a machine-specific configuration. |
| [`allow from`](#allow-from) | `*` | Lists IP addresses allowed to stream metrics. |
| `retention` | `3600` | Retention period for child metrics in RAM-based storage. |
| [`db`](#db) | `dbengine` | Database type for this node. |
| `health enabled` | `auto` | Controls alerts (`auto`, `yes`, `no`). |
| `postpone alerts on connect` | `1m` | Delay alerts for a period after connection. |
| `health log retention` | `5d` | Duration to keep health log events. |
| `proxy enabled` | (empty) | Routes metrics through a proxy if enabled. |
| `proxy destination` | (empty) | Proxy server IP and port. |
| `proxy api key` | (empty) | API key for the proxy. |
| `send charts matching` | `*` | Filters streamed charts. |
| `enable compression` | `yes` | Enables or disables compression. |
| `enable replication` | `yes` | Enables or disables replication. |
| `replication period` | `1d` | Maximum replication window. |
| `replication step` | `10m` | Time interval for each replication step. |
| `is ephemeral node` | `no` | Marks the node as ephemeral (removes after inactivity). |
### Additional Settings
#### `destination`
A space-separated list of parent nodes to attempt to stream to, with the first available parent receiving metrics, using
the following format: `[PROTOCOL:]HOST[%INTERFACE][:PORT][:SSL]`.
Defines parent nodes for streaming using the format:
`[PROTOCOL:]HOST[%INTERFACE][:PORT][:SSL]`
- `PROTOCOL`: `tcp`, `udp`, or `unix`. (only tcp and unix are supported by parent nodes)
- `HOST`: A IPv4, IPv6 IP, or a hostname, or a unix domain socket path. IPv6 IPs should be given with brackets
`[ip:address]`.
- `INTERFACE` (IPv6 only): The network interface to use.
- `PORT`: The port number or service name (`/etc/services`) to use.
- `SSL`: To enable TLS/SSL encryption of the streaming connection.
- **PROTOCOL**: `tcp`, `udp`, or `unix` (only `tcp` and `unix` are supported for parents).
- **HOST**: IPv4, IPv6 (in brackets `[ ]`), hostname, or Unix domain socket path.
- **INTERFACE** (IPv6 only): Network interface to use.
- **PORT**: Port number or service name.
- **SSL**: Enables TLS/SSL encryption.
To enable TCP streaming to a parent node at `203.0.113.0` on port `20000` and with TLS/SSL encryption:
Example (TCP connection with SSL to `203.0.113.0` on port `20000`):
```text
```ini
[stream]
destination = tcp:203.0.113.0:20000:SSL
```
#### `send charts matching`
A space-separated list of [Netdata simple patterns](/src/libnetdata/simple_pattern/README.md) to filter which charts are streamed.
Controls which charts are streamed.
The default is a single wildcard `*`, which streams all charts.
- `*` (default) Streams all charts.
- Specific charts:
To send only a few charts, list them explicitly, or list a group using a wildcard. To send _only_ the `apps.cpu` chart
and charts with contexts beginning with `system.`:
```ini
[stream]
send charts matching = apps.cpu system.*
```
```text
[stream]
send charts matching = apps.cpu system.*
```
- Exclude charts using `!`:
To send all but a few charts, use `!` to create a negative match. To send _all_ charts _but_ `apps.cpu`:
```text
[stream]
send charts matching = !apps.cpu *
```
```ini
[stream]
send charts matching = !apps.cpu *
```
#### `allow from`
A space-separated list of [Netdata simple patterns](/src/libnetdata/simple_pattern/README.md) matching the IPs of nodes that
will stream metrics using this API key. The order is important, left to right, as the first positive or negative match is used.
Defines which child nodes (by IP) can connect.
The default is `*`, which accepts all requests including the `API_KEY`.
- Allow a single IP:
To allow from only a specific IP address:
```ini
[API_KEY]
allow from = 203.0.113.10
```
```text
[API_KEY]
allow from = 203.0.113.10
```
- Allow a range but exclude one:
To allow all IPs starting with `10.*`, except `10.1.2.3`:
```text
[API_KEY]
allow from = !10.1.2.3 10.*
```
> If you set specific IP addresses here, and also use the `allow connections` setting in the `[web]` section of
> `netdata.conf`, be sure to add the IP address there so that it can access the API port.
```ini
[API_KEY]
allow from = !10.1.2.3 10.*
```
#### `db`
The [database](/src/database/README.md) to use for all nodes using this `API_KEY`.
Valid settings are `dbengine`, `ram`, , or `none`.
Defines the database mode:
- `dbengine`: The default, recommended time-series database (TSDB) for Netdata. Stores recent metrics in memory, then
efficiently spills them to disk for long-term storage.
- `ram`: Stores metrics _only_ in memory, which means metrics are lost when Netdata stops or restarts. Ideal for
streaming configurations that use ephemeral nodes.
- `none`: No database.
- `dbengine` Stores recent metrics in RAM and writes older data to disk.
- `ram` Stores metrics only in RAM (lost on restart).
- `none` No database.
### `netdata.conf`
| Setting | Default | Description |
|------------------------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `[db]` section | | |
| `mode` | `dbengine` | Determines the [database type](/src/database/README.md) to be used on that node. Other options settings include `none`, and `ram`. `none` disables the database at this host. This also disables alerts and notifications, as those can't run without a database. |
| `[web]` section | | |
| `mode` | `static-threaded` | Determines the [web server](/src/web/server/README.md) type. The other option is `none`, which disables the dashboard, API, and Registry. |
| `accept a streaming request every` | `off` | Set a limit on how often a parent node accepts streaming requests from child nodes. `0` equals no limit. If this is set, you may see `... too busy to accept new streaming request. Will be allowed in X secs` in Netdata's `error.log`. |
### Basic use cases
This is an overview of how the main options can be combined:
| target | memory<br/>mode | web<br/>mode | stream<br/>enabled | exporting | alerts | dashboard |
|--------------------|:---------------:|:------------:|:------------------:|:-------------------------------------:|:------------:|:---------:|
| headless collector | `none` | `none` | `yes` | only for `data source = as collected` | not possible | no |
| headless proxy | `none` | not `none` | `yes` | only for `data source = as collected` | not possible | no |
| proxy with db | not `none` | not `none` | `yes` | possible | possible | yes |
| central netdata | not `none` | not `none` | `no` | possible | possible | yes |
### Per-child settings
While the `[API_KEY]` section applies settings for any child node using that key, you can also use per-child settings
with the `[MACHINE_GUID]` section.
For example, the metrics streamed from only the child node with `MACHINE_GUID` are saved in memory, not using the
default `dbengine` as specified by the `API_KEY`, and alerts are disabled.
```text
```ini
[API_KEY]
enabled = yes
db = dbengine
health enabled = auto
allow from = *
[MACHINE_GUID]
enabled = yes
db = ram
health enabled = no
```
### Streaming compression
[![Supported version Netdata Agent release](https://img.shields.io/badge/Supported%20Netdata%20Agent-v1.33%2B-brightgreen)](https://github.com/netdata/netdata/releases/latest)
[![Supported version Netdata Agent release](https://img.shields.io/badge/Supported%20Netdata%20stream%20version-v5%2B-blue)](https://github.com/netdata/netdata/releases/latest)
#### OS dependencies
* Streaming compression is based on [lz4 v1.9.0+](https://github.com/lz4/lz4). The [lz4 v1.9.0+](https://github.com/lz4/lz4) library must be installed in your OS in order to enable streaming compression. Any lower version will disable Netdata streaming compression for compatibility purposes between the older versions of Netdata Agents.
To check if your Netdata Agent supports stream compression run the following GET request in your browser or terminal:
```
curl -X GET http://localhost:19999/api/v1/info | grep 'Stream Compression'
```
**Output**
```
"buildinfo": "dbengine|Native HTTPS|Netdata Cloud|ACLK Next Generation|New Cloud Protocol Support|ACLK Legacy|TLS Host Verification|Machine Learning|Stream Compression|protobuf|JSON-C|libcrypto|libm|LWS v3.2.2|mosquitto|zlib|apps|cgroup Network Tracking|EBPF|perf|slabinfo",
```
> Note: If your OS doesn't support Netdata compression the `buildinfo` will not contain the `Stream Compression` statement.
To check if your Netdata Agent has stream compression enabled, run the following GET request in your browser or terminal:
```
curl -X GET http://localhost:19999/api/v1/info | grep 'stream-compression'
```
**Output**
```
"stream-compression": "enabled"
```
Note: The `stream-compression` status can be `"enabled" | "disabled" | "N/A"`.
A compressed data packet is determined and decompressed on the fly.
#### Limitations
This limitation will be withdrawn asap and is work-in-progress.
The current implementation of streaming data compression can support only a few number of dimensions in a chart with names that cannot exceed the size of 16384 bytes. In case your instance hit this limitation, the Agent will deactivate compression during runtime to avoid stream corruption. This limitation can be seen in the error.log file with the sequence of the following messages:
```
netdata INFO : STREAM_SENDER[child01] : STREAM child01 [send to my.parent.IP]: connecting...
netdata INFO : STREAM_SENDER[child01] : STREAM child01 [send to my.parent.IP]: initializing communication...
netdata INFO : STREAM_SENDER[child01] : STREAM child01 [send to my.parent.IP]: waiting response from remote netdata...
netdata INFO : STREAM_SENDER[child01] : STREAM_COMPRESSION: Compressor Reset
netdata INFO : STREAM_SENDER[child01] : STREAM child01 [send to my.parent.IP]: established communication with a parent using protocol version 5 - ready to send metrics...
...
netdata ERROR : PLUGINSD[go.d] : STREAM_COMPRESSION: Compression Failed - Message size 27847 above compression buffer limit: 16384 (errno 9, Bad file descriptor)
netdata ERROR : PLUGINSD[go.d] : STREAM_COMPRESSION: Deactivating compression to avoid stream corruption
netdata ERROR : PLUGINSD[go.d] : STREAM_COMPRESSION child01 [send to my.parent.IP]: Restarting connection without compression
...
netdata INFO : STREAM_SENDER[child01] : STREAM child01 [send to my.parent.IP]: connecting...
netdata INFO : STREAM_SENDER[child01] : STREAM child01 [send to my.parent.IP]: initializing communication...
netdata INFO : STREAM_SENDER[child01] : STREAM child01 [send to my.parent.IP]: waiting response from remote netdata...
netdata INFO : STREAM_SENDER[child01] : Stream is uncompressed! One of the Agents (my.parent.IP <-> child01) does not support compression OR compression is disabled.
netdata INFO : STREAM_SENDER[child01] : STREAM child01 [send to my.parent.IP]: established communication with a parent using protocol version 4 - ready to send metrics...
netdata INFO : WEB_SERVER[static4] : STREAM child01 [send]: sending metrics...
```
#### How to enable stream compression
Netdata Agents are shipped with data compression enabled by default. You can also configure which streams will use compression.
With enabled stream compression, a Netdata Agent can negotiate streaming compression with other Netdata Agents. During the negotiation of streaming compression both Netdata Agents should support and enable compression in order to communicate over a compressed stream. The negotiation will result into an uncompressed stream, if one of the Netdata Agents doesn't support **or** has compression disabled.
To enable stream compression:
1. Edit `stream.conf` by using the `edit-config` script:
`/etc/netdata/edit-config stream.conf`.
2. In the `[stream]` section, set `enable compression` to `yes`.
```
# This is the default stream compression flag for an Agent.
[stream]
enable compression = yes | no
```
| Parent | Stream compression | Child |
|--------------------------------------|--------------------|--------------------------------------|
| Supported & Enabled | compressed | Supported & Enabled |
| (Supported & Disabled)/Not supported | uncompressed | Supported & Enabled |
| Supported & Enabled | uncompressed | (Supported & Disabled)/Not supported |
| (Supported & Disabled)/Not supported | uncompressed | (Supported & Disabled)/Not supported |
In case of parents with multiple children you can select which streams will be compressed by using the same configuration under the `[API_KEY]`, `[MACHINE_GUID]` section.
This configuration uses AND logic with the default stream compression configuration under the `[stream]` section. This means the stream compression from child to parent will be enabled only if the outcome of the AND logic operation is true (`default compression enabled` && `api key compression enabled`). So both should be enabled to get stream compression otherwise stream compression is disabled.
```
[API_KEY]
enable compression = yes | no
```
Same thing applies with the `[MACHINE_GUID]` configuration.
```
[MACHINE_GUID]
enable compression = yes | no
```
### Securing streaming with TLS/SSL
Netdata does not activate TLS encryption by default. To encrypt streaming connections, you first need to [enable TLS
support](/src/web/server/README.md#enabling-tls-support) on the parent. With encryption enabled on the receiving side, you
need to instruct the child to use TLS/SSL as well. On the child's `stream.conf`, configure the destination as follows:
```
[stream]
destination = host:port:SSL
```
The word `SSL` appended to the end of the destination tells the child that connections must be encrypted.
> While Netdata uses Transport Layer Security (TLS) 1.2 to encrypt communications rather than the obsolete SSL protocol,
> it's still common practice to refer to encrypted web connections as `SSL`. Many vendors, like Nginx and even Netdata
> itself, use `SSL` in configuration files, whereas documentation will always refer to encrypted communications as `TLS`
> or `TLS/SSL`.
#### Certificate verification
When TLS/SSL is enabled on the child, the default behavior will be to not connect with the parent unless the server's
certificate can be verified via the default chain. In case you want to avoid this check, add the following to the
child's `stream.conf` file:
```
[stream]
ssl skip certificate verification = yes
```
#### Trusted certificate
If you've enabled [certificate verification](#certificate-verification), you might see errors from the OpenSSL library
when there's a problem with checking the certificate chain (`X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY`). More
importantly, OpenSSL will reject self-signed certificates.
Given these known issues, you have two options. If you trust your certificate, you can set the options `CApath` and
`CAfile` to inform Netdata where your certificates, and the certificate trusted file, are stored.
For more details about these options, you can read about [verify
locations](https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_load_verify_locations.html).
Before you changed your streaming configuration, you need to copy your trusted certificate to your child system and add
the certificate to OpenSSL's list.
On most Linux distributions, the `update-ca-certificates` command searches inside the `/usr/share/ca-certificates`
directory for certificates. You should double-check by reading the `update-ca-certificate` manual (`man
update-ca-certificate`), and then change the directory in the below commands if needed.
If you have `sudo` configured on your child system, you can use that to run the following commands. If not, you'll have
to log in as `root` to complete them.
```
# mkdir /usr/share/ca-certificates/netdata
# cp parent_cert.pem /usr/share/ca-certificates/netdata/parent_cert.crt
# chown -R netdata.netdata /usr/share/ca-certificates/netdata/
```
First, you create a new directory to store your certificates for Netdata. Next, you need to change the extension on your
certificate from `.pem` to `.crt` so it's compatible with `update-ca-certificate`. Finally, you need to change
permissions so the user that runs Netdata can access the directory where you copied in your certificate.
Next, edit the file `/etc/ca-certificates.conf` and add the following line:
```
netdata/parent_cert.crt
```
Now you update the list of certificates running the following, again either as `sudo` or `root`:
```
# update-ca-certificates
```
> Some Linux distributions have different methods of updating the certificate list. For more details, please read this
> guide on [adding trusted root certificates](https://github.com/Busindre/How-to-Add-trusted-root-certificates).
Once you update your certificate list, you can set the stream parameters for Netdata to trust the parent certificate.
Open `stream.conf` for editing and change the following lines:
```
[stream]
CApath = /etc/ssl/certs/
CAfile = /etc/ssl/certs/parent_cert.pem
```
With this configuration, the `CApath` option tells Netdata to search for trusted certificates inside `/etc/ssl/certs`.
The `CAfile` option specifies the Netdata parent certificate is located at `/etc/ssl/certs/parent_cert.pem`. With this
configuration, you can skip using the system's entire list of certificates and use Netdata's parent certificate instead.
#### Expected behaviors
With the introduction of TLS/SSL, the parent-child communication behaves as shown in the table below, depending on the
following configurations:
- **Parent TLS (Yes/No)**: Whether the `[web]` section in `netdata.conf` has `ssl key` and `ssl certificate`.
- **Parent port TLS (-/force/optional)**: Depends on whether the `[web]` section `bind to` contains a `^SSL=force` or
`^SSL=optional` directive on the port(s) used for streaming.
- **Child TLS (Yes/No)**: Whether the destination in the child's `stream.conf` has `:SSL` at the end.
- **Child TLS Verification (yes/no)**: Value of the child's `stream.conf` `ssl skip certificate verification`
parameter (default is no).
| Parent TLS enabled | Parent port SSL | Child TLS | Child SSL Ver. | Behavior |
|:-------------------|:-----------------|:----------|:---------------|:-----------------------------------------------------------------------------------------------------------------------------------------|
| No | - | No | no | Legacy behavior. The parent-child stream is unencrypted. |
| Yes | force | No | no | The parent rejects the child connection. |
| Yes | -/optional | No | no | The parent-child stream is unencrypted (expected situation for legacy child nodes and newer parent nodes) |
| Yes | -/force/optional | Yes | no | The parent-child stream is encrypted, provided that the parent has a valid TLS/SSL certificate. Otherwise, the child refuses to connect. |
| Yes | -/force/optional | Yes | yes | The parent-child stream is encrypted. |
### Proxy
A proxy is a node that receives metrics from a child, then streams them onward to a parent. To configure a proxy,
configure it as a receiving and a sending Netdata at the same time.
Netdata proxies may or may not maintain a database for the metrics passing through them. When they maintain a database,
they can also run health checks (alerts and notifications) for the remote host that is streaming the metrics.
In the following example, the proxy receives metrics from a child node using the `API_KEY` of
`66666666-7777-8888-9999-000000000000`, then stores metrics using `dbengine`. It then uses the `API_KEY` of
`11111111-2222-3333-4444-555555555555` to proxy those same metrics on to a parent node at `203.0.113.0`.
```text
[stream]
enabled = yes
destination = 203.0.113.0
api key = 11111111-2222-3333-4444-555555555555
[66666666-7777-8888-9999-000000000000]
enabled = yes
db = dbengine
```
### Ephemeral nodes
Heres an optimized version of the `netdata.conf` structure with clearer, more direct language. I've broken down the key sections for readability and made the content less dense:
Netdata can help you monitor ephemeral nodes, such as containers in an auto-scaling infrastructure, by always streaming
metrics to any number of permanently-running parent nodes.
## `netdata.conf`
On the parent, set the following in `stream.conf`:
The `netdata.conf` file is the primary configuration file for the Netdata agent. It controls the agents settings, including networking, data collection, logging, and resource usage.
```text
[11111111-2222-3333-4444-555555555555]
# enable/disable this API key
enabled = yes
### Sections
# one hour of data for each of the child nodes
history = 1h
#### [global]
# do not save child metrics on disk
default memory = ram
This section defines global settings for the Netdata agent.
# alerts checks, only while the child is connected
health enabled = auto
```
- **hostname**: The hostname used by the agent.
- **memory mode**: Choose the memory mode for data collection (e.g., `ram` or `swap`).
- **error log file**: Path to the file where error logs are saved.
On the child nodes, set the following in `stream.conf`:
#### [web]
```bash
[stream]
# stream metrics to another Netdata
enabled = yes
Configure the web interface settings here.
# the IP and PORT of the parent
destination = 10.11.12.13:19999
- **bind to**: Define the network address to which Netdata binds.
- **port**: Set the port for the web interface (default: 19999).
- **disable SSL**: Set to `yes` to disable SSL support.
# the API key to use
api key = 11111111-2222-3333-4444-555555555555
```
#### [plugin]
In addition, edit `netdata.conf` on each child node to disable the database and alerts.
This section configures individual plugins for data collection.
```bash
[db]
# disable the local database
db = none
- **enabled**: Enable or disable the plugin.
- **update every**: Define the update frequency (in seconds).
[health]
# disable health checks
enabled = no
```
#### [database]
## Replication
Manage database settings for data storage and retention.
Netdata streaming automatically replicates data from child nodes to parent nodes, ensuring that the parent node has a complete and up-to-date view of all metrics.
This replication process ensures data continuity even if child nodes temporarily disconnect.
- **memory mode**: Choose between in-memory or disk-based storage.
- **data retention**: Set how long to keep historical data.
- **compression**: Enable or disable data compression.
Replication is enabled by default in Netdata, but you can customize the replication behavior by modifying the `[API_KEY]` section of the `stream.conf` file. Here's an example configuration:
#### [logging]
```text
[11111111-2222-3333-4444-555555555555]
# Enable replication for all hosts using this api key. Default: yes.
enable replication = yes
Configure logging behavior for Netdata.
# How many seconds of data to replicate from each child at a time. Default: a day.
replication period = 1d
# The duration we want to replicate per each replication step. Default: 10 minutes.
replication step = 10m
```
You can monitor the replication process in two ways:
1. **Netdata Monitoring**: access the Netdata Monitoring section and look for the Replication charts.
2. **Streaming Function**: use the Streaming function (Top) to see the replication status of children nodes. This function provides real-time insights into the replication status of each child node.
### Replication history
Replication history in [dbengine](/src/database/README.md#modes) mode is limited
by [Tier 0 retention](/src/database/README.md#tiers):
- Child instances replicate only Tier 0 data.
- Parent instance calculates higher-level tiers using Tier 0 as the basis.
Extend replication history by increasing Tier 0 retention.
Checking Tier 0 retention:
- Using a web browser:
- Navigate to `http://{CHILD_IP}:19999/api/v2/node_instances`.
- Locate the `expected_retention` value for Tier 0 of your Agent.
- Convert the value from seconds to days for a more meaningful representation.
- Using `curl` and `jq`:
- Execute the following command:
```bash
$ curl -s "http://{CHILD_IP}:19999/api/v2/node_instances" | jq '.agents[] | {nm, retention: (.db_size[0].retention / 86400 | .*100 | round/100) }'
```
- Example output:
```json
{
"nm": "myhost",
"retention": 12.73
}
```
- **log file**: Define the log file location.
- **log level**: Set the verbosity of logs (e.g., `info`, `debug`).
## Troubleshooting
Both parent and child nodes log information at `/var/log/netdata/error.log`.
Both parent and child nodes log information in `/var/log/netdata/error.log`.
If the child manages to connect to the parent you will see something like (on the parent):
If the child successfully connects to the parent, youll see logs similar to the following on the parent:
```
2017-03-09 09:38:52: netdata: INFO : STREAM [receive from [10.11.12.86]:38564]: new client connection.
@ -557,7 +251,7 @@ If the child manages to connect to the parent you will see something like (on th
2017-03-09 09:38:52: netdata: INFO : STREAM xxx [receive from [10.11.12.86]:38564]: receiving metrics...
```
and something like this on the child:
On the child side, you might see:
```
2017-03-09 09:38:28: netdata: INFO : STREAM xxx [send to box:19999]: connecting...
@ -566,93 +260,75 @@ and something like this on the child:
2017-03-09 09:38:28: netdata: INFO : STREAM xxx [send to box:19999]: established communication - sending metrics...
```
The following sections describe the most common issues you might encounter when connecting parent and child nodes.
The following sections cover common issues when connecting parent and child nodes.
### Slow connections between parent and child
### Slow Connections Between Parent and Child
When you have a slow connection between parent and child, Netdata raises a few different errors. Most of the
errors will appear in the child's `error.log`.
Slow connections may lead to several errors, mainly logged in the childs `error.log`:
```bash
netdata ERROR : STREAM_SENDER[CHILD HOSTNAME] : STREAM CHILD HOSTNAME [send to PARENT IP:PARENT PORT]: too many data pending - buffer is X bytes long,
Y unsent - we have sent Z bytes in total, W on this connection. Closing connection to flush the data.
netdata ERROR : STREAM_SENDER[CHILD HOSTNAME] : STREAM CHILD HOSTNAME [send to PARENT IP:PARENT PORT]: too many data pending - buffer is X bytes long, Y unsent - we have sent Z bytes in total, W on this connection. Closing connection to flush the data.
```
On the parent side, you may see various error messages, most commonly the following:
On the parent side, you might see:
```
netdata ERROR : STREAM_PARENT[CHILD HOSTNAME,[CHILD IP]:CHILD PORT] : read failed: end of file
```
Another common problem in slow connections is the child sending a partial message to the parent. In this case, the
parent will write the following to its `error.log`:
Another issue in slow connections is the child sending partial messages to the parent. In this case, the parent will log:
```
ERROR : STREAM_RECEIVER[CHILD HOSTNAME,[CHILD IP]:CHILD PORT] : sent command 'B' which is not known by netdata, for host 'HOSTNAME'. Disabling it.
```
In this example, `B` was part of a `BEGIN` message that was cut due to connection problems.
Slow connections can also cause problems when the parent misses a message and then receives a command related to the
missed message. For example, a parent might miss a message containing the child's charts, and then doesn't know
what to do with the `SET` message that follows. When that happens, the parent will show a message like this:
Slow connections can also cause the parent to miss a message. For example, if the parent misses a message about the childs charts and then receives a `SET` command for a chart, the parent might log:
```
ERROR : STREAM_RECEIVER[CHILD HOSTNAME,[CHILD IP]:CHILD PORT] : requested a SET on chart 'CHART NAME' of host 'HOSTNAME', without a dimension. Disabling it.
```
### Child cannot connect to parent
### Child Cant Connect to Parent
When the child can't connect to a parent for any reason (misconfiguration, networking, firewalls, parent
down), you will see the following in the child's `error.log`.
If the child can't connect to the parent (due to misconfiguration, networking issues, firewalls, or the parent being down), the child will log:
```
ERROR : STREAM_SENDER[HOSTNAME] : Failed to connect to 'PARENT IP', port 'PARENT PORT' (errno 113, No route to host)
```
### 'Is this a Netdata?'
### 'Is This a Netdata?'
This question can appear when Netdata starts the stream and receives an unexpected response. This error can appear when
the parent is using SSL and the child tries to connect using plain text. You will also see this message when
Netdata connects to another server that isn't Netdata. The complete error message will look like this:
This error typically occurs when the parent is using SSL and the child attempts a plain-text connection, or if the child tries to connect to a non-Netdata server. The error message looks like this:
```
ERROR : STREAM_SENDER[CHILD HOSTNAME] : STREAM child HOSTNAME [send to PARENT HOSTNAME:PARENT PORT]: server is not replying properly (is it a netdata?).
```
### Stream charts wrong
### Stream Charts Wrong
Chart data needs to be consistent between child and parent nodes. If there are differences between chart data on
a parent and a child, such as gaps in metrics collection, it most often means your child's `[db].db` setting
does not match the parent's. To learn more about the different ways Netdata can store metrics, and thus keep chart
data consistent, read our [db documentation](/src/database/README.md).
If chart data is inconsistent between the parent and child (e.g., gaps in metrics collection), it likely indicates a mismatch in the `[db].db` settings between the parent and child. Refer to our [db documentation](/src/database/README.md) for more information on how Netdata stores metrics to ensure data consistency.
### Forbidding access
### Forbidding Access
You may see errors about "forbidding access" for a number of reasons. It could be because of a slow connection between
the parent and child nodes, but it could also be due to other failures. Look in your parent's `error.log` for errors
that look like this:
Access might be forbidden for several reasons, such as slow connections or other failures. Look for the following errors in the parents `error.log`:
```
STREAM [receive from [child HOSTNAME]:child IP]: `MESSAGE`. Forbidding access."
```
`MESSAGE` will have one of the following patterns:
Possible causes for this error include:
- `request without KEY` : The message received is incomplete and the KEY value can be API, hostname, machine GUID.
- `API key 'VALUE' is not valid GUID`: The UUID received from child does not have the format defined in [RFC
4122](https://tools.ietf.org/html/rfc4122)
- `machine GUID 'VALUE' is not GUID.`: This error with machine GUID is like the previous one.
- `API key 'VALUE' is not allowed`: This stream has a wrong API key.
- `API key 'VALUE' is not permitted from this IP`: The IP is not allowed to use STREAM with this parent.
- `machine GUID 'VALUE' is not allowed.`: The GUID that is trying to send stream is not allowed.
- `Machine GUID 'VALUE' is not permitted from this IP. `: The IP does not match the pattern or IP allowed to connect to
use stream.
- `request without KEY`: Incomplete message, missing API key, hostname, or machine GUID.
- `API key 'VALUE' is not valid GUID`: Invalid UUID format.
- `machine GUID 'VALUE' is not GUID.`: Invalid machine GUID.
- `API key 'VALUE' is not allowed`: Invalid API key.
- `API key 'VALUE' is not permitted from this IP`: IP not allowed to use STREAM with this parent.
- `machine GUID 'VALUE' is not allowed.`: GUID not permitted.
- `Machine GUID 'VALUE' is not permitted from this IP.`: IP not matching the allowed pattern.
### Netdata could not create a stream
### Netdata Could Not Create a Stream
The connection between parent and child is a stream. When the parent can't convert the initial connection into
a stream, it will write the following message inside `error.log`:
If the parent cant convert the initial connection into a stream, it will log the following error:
```
file descriptor given is not a valid stream