Function docs edits (#17390)

Co-authored-by: Hugo Valente <82235632+hugovalente-pm@users.noreply.github.com>
Co-authored-by: ilyam8 <ilya@netdata.cloud>
This commit is contained in:
Fotis Voutsas 2024-04-16 09:46:32 +03:00 committed by GitHub
parent 98a851fb8d
commit 9d9fbfbdbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 52 additions and 86 deletions

View File

@ -21,7 +21,7 @@
<a href="https://scan.coverity.com/projects/netdata-netdata?tab=overview"><img alt="Coverity Scan" src="https://img.shields.io/coverity/scan/netdata"></a>
<a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPL%20v3%2B-blue.svg" alt="License: GPL v3+"></a>
<br />
<a href="https://discord.com/invite/mPZ6WZKKG2"><img alt="Discord" src="https://img.shields.io/discord/847502280503590932?logo=discord&logoColor=white&label=chat%20on%20discord"></a>
<a href="https://discord.com/invite/2mEmfW735j"><img alt="Discord" src="https://img.shields.io/discord/847502280503590932?logo=discord&logoColor=white&label=chat%20on%20discord"></a>
<a href="https://community.netdata.cloud"><img alt="Discourse topics" src="https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.netdata.cloud%2F&logo=discourse&label=discourse%20forum"></a>
<a href="https://github.com/netdata/netdata/discussions"><img alt="GitHub Discussions" src="https://img.shields.io/github/discussions/netdata/netdata?logo=github&label=github%20discussions"></a>
</p>
@ -798,7 +798,7 @@ to collect metrics, troubleshoot via charts, export to external databases, and m
## :tada: Community
<p align="center">
<a href="https://discord.com/invite/mPZ6WZKKG2"><img alt="Discord" src="https://img.shields.io/discord/847502280503590932?logo=discord&logoColor=white&label=chat%20on%20discord"></a>
<a href="https://discord.com/invite/2mEmfW735j"><img alt="Discord" src="https://img.shields.io/discord/847502280503590932?logo=discord&logoColor=white&label=chat%20on%20discord"></a>
<a href="https://community.netdata.cloud"><img alt="Discourse topics" src="https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.netdata.cloud%2F&logo=discourse&label=discourse%20forum"></a>
<a href="https://github.com/netdata/netdata/discussions"><img alt="GitHub Discussions" src="https://img.shields.io/github/discussions/netdata/netdata?logo=github&label=github%20discussions"></a>
</p>
@ -807,7 +807,7 @@ Netdata is an inclusive open-source project and community. Please read our [Code
Join the Netdata community:
- Chat with us and other community members on [Discord](https://discord.com/invite/mPZ6WZKKG2).
- Chat with us and other community members on [Discord](https://discord.com/invite/2mEmfW735j).
- Start a discussion on [GitHub discussions](https://github.com/netdata/netdata/discussions).
- Open a topic to our [community forums](https://community.netdata.cloud).

View File

@ -1,37 +1,25 @@
<!--
title: "Netdata Functions"
sidebar_label: "Netdata Functions"
custom_edit_url: "https://github.com/netdata/netdata/blob/master/docs/cloud/netdata-functions.md"
sidebar_position: "2800"
learn_status: "Published"
learn_topic_type: "Concepts"
learn_rel_path: "Concepts"
learn_docs_purpose: "Present the Netdata Functions what these are and why they should be used."
-->
# Netdata Functions
# Top Monitoring (Netdata Functions)
Netdata Agent collectors are able to expose functions that can be executed in run-time and on-demand. These will be
executed on the node - host where the function is made
available.
executed on the node/host where the function is made available.
#### What is a function?
## What is a function?
Collectors besides the metric collection, storing, and/or streaming work are capable of executing specific routines on
request. These routines will bring additional information
to help you troubleshoot or even trigger some action to happen on the node itself.
Collectors besides the metric collection, storing, and/or streaming work are capable of executing specific routines on request. These routines will bring additional information to help you troubleshoot or even trigger some action to happen on the node itself.
A function is a `key` - `value` pair. The `key` uniquely identifies the function within a node. The `value` is a
function (i.e. code) to be run by a data collector when
the function is invoked.
For more details please check out documentation on how we use our internal collector to get this from the first collector that exposes functions - [plugins.d](https://github.com/netdata/netdata/blob/master/src/collectors/plugins.d/README.md#function).
For more details please check out documentation on how we use our internal collector to get this from the first collector that exposes
functions - [plugins.d](https://github.com/netdata/netdata/blob/master/src/collectors/plugins.d/README.md#function).
## Prerequisites
#### What functions are currently available?
The following is required to be able to run Functions from Netdata Cloud.
| Function | Description | Alternative to CLI tools | Require Cloud | plugin - module |
|:-------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|:--------------|:-----------------------------------------------------------------------------------------------------------|
- At least one of the nodes claimed to your Space should be on a Netdata agent version higher than `v1.37.1`
- Ensure that the node has the collector that exposes the function you want enabled
## What functions are currently available?
| Function | Description | Alternative to CLI tools | Require Cloud | plugin - module |
|:-------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|:--------------|:---------------------------------------------------------------------------------------------------------------|
| Block-devices | Disk I/O activity for all block devices, offering insights into both data transfer volume and operation performance. | `iostat` | no | [proc](https://github.com/netdata/netdata/tree/master/src/collectors/proc.plugin#readme) |
| Containers-vms | Insights into the resource utilization of containers and QEMU virtual machines: CPU usage, memory consumption, disk I/O, and network traffic. | `docker stats`, `systemd-cgtop` | no | [cgroups](https://github.com/netdata/netdata/tree/master/src/collectors/cgroups.plugin#readme) |
| Ipmi-sensors | Readings and status of IPMI sensors. | `ipmi-sensors` | no | [freeipmi](https://github.com/netdata/netdata/tree/master/src/collectors/freeipmi.plugin#readme) |
@ -41,38 +29,23 @@ functions - [plugins.d](https://github.com/netdata/netdata/blob/master/src/colle
| Systemd-journal | Viewing, exploring and analyzing systemd journal logs. | `journalctl` | yes | [systemd-journal](https://github.com/netdata/netdata/tree/master/src/collectors/systemd-journal.plugin#readme) |
| Systemd-list-units | Information about all systemd units, including their active state, description, whether or not they are enabled, and more. | `systemctl list-units` | yes | [systemd-journal](https://github.com/netdata/netdata/tree/master/src/collectors/systemd-journal.plugin#readme) |
| Systemd-services | System resource utilization for all running systemd services: CPU, memory, and disk IO. | `systemd-cgtop` | no | [cgroups](https://github.com/netdata/netdata/tree/master/src/collectors/cgroups.plugin#readme) |
| Streaming | Comprehensive overview of all Netdata children instances, offering detailed information about their status, replication completion time, and many more. | | yes | |
| Streaming | Comprehensive overview of all Netdata children instances, offering detailed information about their status, replication completion time, and many more. | | yes | |
| Netdata-api-calls | Real-time tracing of API calls made to the Netdata Agent. It provides information on query, source, status, elapsed time, and more. | | yes | |
## How do functions work with streaming?
Via streaming, the definitions of functions are transmitted to a parent node, so it knows all the functions available on any children connected to it. If the parent node is the one connected to Netdata Cloud it is capable of triggering the call to the respective children node to run the function.
## Why are some functions only available on Netdata Cloud?
Since these functions are able to execute routines on the node and due to the potential use cases that they can cover, our concern is to ensure no sensitive information or disruptive actions are exposed through the Agent's API.
With the communication between the Netdata Agent and Netdata Cloud being through [ACLK](https://github.com/netdata/netdata/blob/master/src/aclk/README.md) this concern is addressed.
## Feedback
If you have ideas or requests for other functions:
* Participate in the relevant [GitHub discussion](https://github.com/netdata/netdata/discussions/14412)
* Open a [feature request](https://github.com/netdata/netdata-cloud/issues/new?assignees=&labels=feature+request%2Cneeds+triage&template=FEAT_REQUEST.yml&title=%5BFeat%5D%3A+) on Netdata Cloud repo
* Join the Netdata community on [Discord](https://discord.com/invite/mPZ6WZKKG2) and let us know.
#### How do functions work with streaming?
Via streaming, the definitions of functions are transmitted to a parent node, so it knows all the functions available on
any children connected to it.
If the parent node is the one connected to Netdata Cloud it is capable of triggering the call to the respective children
node to run the function.
#### Why are some functions only available on Netdata Cloud?
Since these functions are able to execute routines on the node and due to the potential use cases that they can cover, our
concern is to ensure no sensitive information or disruptive actions are exposed through the Agent's API.
With the communication between the Netdata Agent and Netdata Cloud being
through [ACLK](https://github.com/netdata/netdata/blob/master/src/aclk/README.md) this
concern is addressed.
## Related Topics
### **Related Concepts**
- [ACLK](https://github.com/netdata/netdata/blob/master/src/aclk/README.md)
- [plugins.d](https://github.com/netdata/netdata/blob/master/src/collectors/plugins.d/README.md)
### Related Tasks
- [Run-time troubleshooting with Functions](https://github.com/netdata/netdata/blob/master/docs/cloud/runtime-troubleshooting-with-functions.md)
- Participate in the relevant [GitHub discussion](https://github.com/netdata/netdata/discussions/14412)
- Open a [feature request](https://github.com/netdata/netdata-cloud/issues/new?assignees=&labels=feature+request%2Cneeds+triage&template=FEAT_REQUEST.yml&title=%5BFeat%5D%3A+) on Netdata Cloud repo
- Join the Netdata community on [Discord](https://discord.com/invite/2mEmfW735j) and let us know.

View File

@ -1,34 +1,27 @@
# Run-time troubleshooting with Functions
# Top tab
Netdata Functions feature allows you to execute on-demand a pre-defined routine on a node where a Netdata Agent is running. These routines are exposed by a given collector.
These routines can be used to retrieve additional information to help you troubleshoot or to trigger some action to happen on the node itself.
The Top tab allows you to run [Netdata Functions](https://github.com/netdata/netdata/blob/master/docs/cloud/netdata-functions.md) on a node where a Netdata Agent is running. These routines are exposed by a given collector.
They can be used to retrieve additional information to help you troubleshoot or to trigger some action to happen on the node itself.
> **Tip**
>
> You can also execute a Function from the [Nodes tab](https://github.com/netdata/netdata/blob/master/docs/dashboard/nodes-tab.md), by pressing the `f(x)` button.
### Prerequisites
> **Note**
>
> If you get an error saying that your node can't execute Functions please check the [prerequisites](https://github.com/netdata/netdata/blob/master/docs/cloud/netdata-functions.md#prerequisites).
The following is required to be able to run Functions from Netdata Cloud.
* At least one of the nodes claimed to your Space should be on a Netdata agent version higher than `v1.37.1`
* Ensure that the node has the collector that exposes the function you want enabled ([see current available functions](https://github.com/netdata/netdata/blob/master/docs/cloud/netdata-functions.md#what-functions-are-currently-available))
The main view of this tab provides you with (depending on the Function) two elements: a visualization on the top and a table on the bottom.
### Execute a function (from the Functions tab)
Visualizations vary depending on the Function and most allow for user customization.
1. From the right-hand bar select the **Function** you want to run
2. Still on the right-hand bar select the **Node** where you want to run it
3. Results will be displayed in the central area for you to interact with
4. Additional filtering capabilities, depending on the function, should be available on right-hand bar
On the top right-hand corner you can:
### Execute a function (from the Nodes tab)
- Refresh the results (Given that the dashboard is on `Paused` mode)
- Set the update interval of the results.
1. Click on the functions icon for a node that has this active
2. You are directed to the **Functions** tab
3. Follow the above instructions from step 3.
## Functions bar
> ⚠️ If you get an error saying that your node can't execute Functions please check the [prerequisites](#prerequisites).
The bar on the right-hand side allows you to select which Function to run, on which node, and then depending on the Function, there might be more fine-grained filtering available.
## Related Topics
### **Related Concepts**
- [Netdata Functions](https://github.com/netdata/netdata/blob/master/docs/cloud/netdata-functions.md)
#### Related References documentation
- [External plugins overview](https://github.com/netdata/netdata/blob/master/src/collectors/plugins.d/README.md#function)
For example the `Block-devices` Function allows you to filter per Device, Type, ID, Model and Serial number or the Block devices on your node.

View File

@ -151,7 +151,7 @@ charts, or use Netdata's health watchdog to send notifications whenever an anoma
Netdata is an inclusive open-source project and community. Please read our [Code of Conduct](https://github.com/netdata/.github/blob/main/CODE_OF_CONDUCT.md).
Find most of the Netdata team in our [community forums](https://community.netdata.cloud). It's the best place to
ask questions, find resources, and engage with passionate professionals. The team is also available and active in our [Discord](https://discord.com/invite/mPZ6WZKKG2) too.
ask questions, find resources, and engage with passionate professionals. The team is also available and active in our [Discord](https://discord.com/invite/2mEmfW735j) too.
You can also find Netdata on:

View File

@ -145,5 +145,5 @@ The next step is based on the collector's orchestrator.
```
The output from the relevant command will provide valuable troubleshooting information. If you can't figure out how to
enable the collector using the details from this output, feel free to [join our Discord server](https://discord.com/invite/mPZ6WZKKG2),
enable the collector using the details from this output, feel free to [join our Discord server](https://discord.com/invite/2mEmfW735j),
to get help from our experts.