@cryptotaxi247 / netdata-1 / commits / 9a9e31401

add agent name and version in streaming function (#19485)

Costa Tsaousis committed Jan 25, 2025 at 09:48 UTC 9a9e314018f4ac49209b61d45f62c9f7700b1df1
1 file changed +18
src/web/api/functions/function-streaming.c
+18
@@ -91,6 +91,10 @@ int function_streaming(BUFFER *wb, const char *function __maybe_unused, BUFFER *
91 // Node
92 buffer_json_add_array_item_string(wb, rrdhost_hostname(s.host));
93
94 + // AgentName and AgentVersion
95 + buffer_json_add_array_item_string(wb, rrdhost_program_name(host));
96 + buffer_json_add_array_item_string(wb, rrdhost_program_version(host));
97 +
98 // System Info
99 rrdhost_system_info_to_streaming_function_array(wb, s.host->system_info);
100
@@ -260,6 +264,20 @@ int function_streaming(BUFFER *wb, const char *function __maybe_unused, BUFFER *
264 RRDF_FIELD_OPTS_VISIBLE | RRDF_FIELD_OPTS_UNIQUE_KEY | RRDF_FIELD_OPTS_STICKY,
265 NULL);
266
267 + buffer_rrdf_table_add_field(wb, field_id++, "AgentName", "The name of the Netdata agent",
268 + RRDF_FIELD_TYPE_STRING, RRDF_FIELD_VISUAL_VALUE, RRDF_FIELD_TRANSFORM_NONE,
269 + 0, NULL, NAN, RRDF_FIELD_SORT_ASCENDING, NULL,
270 + RRDF_FIELD_SUMMARY_COUNT, RRDF_FIELD_FILTER_MULTISELECT,
271 + RRDF_FIELD_OPTS_NONE,
272 + NULL);
273 +
274 + buffer_rrdf_table_add_field(wb, field_id++, "AgentVersion", "The version of the Netdata agent",
275 + RRDF_FIELD_TYPE_STRING, RRDF_FIELD_VISUAL_VALUE, RRDF_FIELD_TRANSFORM_NONE,
276 + 0, NULL, NAN, RRDF_FIELD_SORT_ASCENDING, NULL,
277 + RRDF_FIELD_SUMMARY_COUNT, RRDF_FIELD_FILTER_MULTISELECT,
278 + RRDF_FIELD_OPTS_NONE,
279 + NULL);
280 +
281 buffer_rrdf_table_add_field(wb, field_id++, "OSName", "The name of the host's operating system",
282 RRDF_FIELD_TYPE_STRING, RRDF_FIELD_VISUAL_VALUE, RRDF_FIELD_TRANSFORM_NONE,
283 0, NULL, NAN, RRDF_FIELD_SORT_ASCENDING, NULL,