Skip to content

Commit

Permalink
chore(host_metrics): refactor docs
Browse files Browse the repository at this point in the history
Signed-off-by: Sanskar Jaiswal <[email protected]>
  • Loading branch information
aryan9600 committed Dec 23, 2024
1 parent b004032 commit 26425ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
11 changes: 2 additions & 9 deletions website/cue/reference/components/sources/base/host_metrics.cue
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ base: components: sources: host_metrics: configuration: {
"""
required: false
type: array: {
default: ["cpu", "disk", "filesystem", "load", "host", "memory", "network", "process",
"cgroups", "tcp"]
default: ["cpu", "disk", "filesystem", "load", "host", "memory", "network", "process", "cgroups"]
items: type: string: {
enum: {
cgroups: """
Expand All @@ -89,14 +88,8 @@ base: components: sources: host_metrics: configuration: {
memory: "Metrics related to memory utilization."
network: "Metrics related to network utilization."
process: "Metrics related to Process utilization."
tcp: """
Metrics related to TCP connections.
Only available on Linux.
"""
}
examples: ["cgroups", "cpu", "disk", "filesystem", "load", "host", "memory",
"network", "tcp"]
examples: ["cgroups", "cpu", "disk", "filesystem", "load", "host", "memory", "network"]
}
}
}
Expand Down
18 changes: 8 additions & 10 deletions website/cue/reference/components/sources/host_metrics.cue
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,19 @@ components: sources: host_metrics: {
network_transmit_errs_total: _host & _network_gauge & {description: "The number of errors encountered during transmits on this interface."}
network_transmit_packets_drop_total: _host & _network_nomac & {description: "The number of packets dropped during transmits on this interface."}
network_transmit_packets_total: _host & _network_nomac & {description: "The number of packets transmitted on this interface."}

// Host tcp
tcp_connections_total: _host & _tcp_linux & _tcp_gauge & {description: "The number of TCP connections."}
tcp_tx_queued_bytes_total: _host & _tcp_linux & {
network_tcp_connections_total: _host & _network_linux & _network_tcp_state_gauge & {description: "The number of TCP connections."}
network_tcp_tx_queued_bytes_total: _host & _network_linux & {
description: "The number of bytes in the send queue across all connections."
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["tcp"]
collector: examples: ["network"]
}
}
tcp_rx_queued_bytes_total: _host & _tcp_linux & {
network_tcp_rx_queued_bytes_total: _host & _network_linux & {
description: "The number of bytes in the receive queue across all connections."
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["tcp"]
collector: examples: ["network"]
}
}

Expand Down Expand Up @@ -291,11 +289,11 @@ components: sources: host_metrics: {
}
}

_tcp_linux: {relevant_when: "OS is Linux"}
_tcp_gauge: {
_network_linux: {relevant_when: "OS is Linux"}
_network_tcp_state_gauge: {
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["tcp"]
collector: examples: ["network"]
state: {
description: "The connection state."
required: true
Expand Down

0 comments on commit 26425ec

Please sign in to comment.