Is it supported to collect static metrics and show them on dashboard?

There are many dynamic metrics collected and displayed on the dashboard with netdata. It’s really excellent.

Does netdata support collecting and displaying of static metrics?

Let me give an example.

Once I deploy netdata on a host, I can read every metrics varying in time series.

What I want to know as well is system info which won’t change as time passing, such as number of CPU sockets, the type/architecture of CPU, memory capacity, OS version and so on.

How can I add plugins to collection inofmations methioned above and show them on the dashborad?

Hello @oleotiger,

You can write an external plugin to write this kind of information, please, take a look at our documentation.
There are static information that Netdata shows trough the endpoint /api/v1/info, you can also do a simple request for http://localhost:19999/api/v1/info to verify if what you want is already present there.

Best regards!

Yeah, I see the api and got static infomation.

But it’s too simply for me. I may need more static metrics. Is there any document that how to expand this api?

Hello,

We do not have a specific documentation for this, because it is necessary to change internal code to add information for this API. Considering that the API does not have everything you need, the collector looks like the simplest road to bring the information, but I won’t let you without answer. If you want to change the internal code, you could follow the road:

1 - Use the system-info.sh script to get information, we had this PR that is a good example for you.
2 - After this, it will be necessary to change internal structures and the API itself, you can see all files that you need to change here

These two PRs that I remembered now are good start point for you, because they are changing all files you would need to change.

Please, let me know if you have any doubt in any road(collector or API).

Best regards!

Changing internal code is not my prefered way. I would rather pick collector as the way.
But according to what I understand, collector are a set of plugins that collect dynamic metrics in time series. Is it the correct way to create a plugin of collector to collect system-info?

Unfortunately the names sometimes create confusions like this, we apologize for this.

A plugin or a collector are the same thing, they can collect dynamic or static information, the difference between them is only the final result drawn on charts.

For you reach your goal, you need to write a collector that will communicate with Netdata using plugins.d language. I will use xenstat plugin to clarify a little bit:

1 - This line is sent only when the collector starts, it creates the chart inside netdata. And you will also need to create the dimensions
2- Finally to keep your collector alive, you will send the same values for Netdata every X seconds. You will use commands this way.

As example, I will give an output from ebpf.plugin. Netdata expects something like this from any collector:

CHART ebpf.file_descriptor '' 'Open and close calls' 'calls/s' 'File' '' line 21000 1
DIMENSION do_sys_open open absolute 1 1
DIMENSION __close_fd close absolute 1 1
BEGIN ebpf.file_descriptor
SET do_sys_open = 0
SET __close_fd = 513
END
BEGIN ebpf.file_descriptor
SET do_sys_open = 0
SET __close_fd = 31
END

I did not use ebpf.plugin as source code example, because I did not put the code to create the chart and the code to update the dimesions together, so I got one that was more simple for you understand.

Best regards!