Skip to content

Add collector for Linux kTLS statss#2950

Open
defect wants to merge 3 commits intoprometheus:masterfrom
defect:master
Open

Add collector for Linux kTLS statss#2950
defect wants to merge 3 commits intoprometheus:masterfrom
defect:master

Conversation

@defect
Copy link

@defect defect commented Mar 8, 2024

Updating github.com/prometheus/procfs to v0.13.0, and adding a collector for exporting Linux kTLS statistics. (added to prometheus/procfs in prometheus/procfs#579). The metric names and their descriptions are all based on https://docs.kernel.org/networking/tls.html#statistics.

Fixes #2290

@defect defect force-pushed the master branch 2 times, most recently from 22af13f to 890ceef Compare March 8, 2024 00:24
Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the new collector to the README.

}

ktlsCurrTxSwDesc := prometheus.NewDesc(
prometheus.BuildFQName(namespace, "ktls", "tls_curr_tx_sw"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this a const:

Suggested change
prometheus.BuildFQName(namespace, "ktls", "tls_curr_tx_sw"),
const ktlsSubsystem = "ktls"
...
prometheus.BuildFQName(namespace, ktlsSubsystem, "tls_curr_tx_sw"),

nil, nil,
)
ktlsCurrRxSwDesc := prometheus.NewDesc(
prometheus.BuildFQName(namespace, "ktls", "tls_curr_rx_sw"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These metric names are a bit confusing compared to the help text.

Maybe something like this? We try and make metric names more human friendly.

Suggested change
prometheus.BuildFQName(namespace, "ktls", "tls_curr_rx_sw"),
prometheus.BuildFQName(namespace, "ktls", "receive_sessions"),

nil, nil,
)
ktlsRxDeviceDesc := prometheus.NewDesc(
prometheus.BuildFQName(namespace, "ktls", "tls_rx_device_total"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what "device" is, this appears to be about sessions.

Suggested change
prometheus.BuildFQName(namespace, "ktls", "tls_rx_device_total"),
prometheus.BuildFQName(namespace, "ktls", "tls_rx_sessions_total"),

Signed-off-by: Felix Aronsson <felixaronsson@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: tls metrics from /proc/net/tls_stat

2 participants