Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ct-metrics): add initial conntrack metrics for Prometheus #1057

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SRodi
Copy link
Member

@SRodi SRodi commented Nov 22, 2024

Description

Create initial metrics for conntrack:

  • packets_count_per_connection [gauge] see example below
  • bytes_count_per_connection [gauge]
  • connections_count [count] WIP

Related Issue

#806

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

This example shows a long-lived TCP connection between client src_ip="10.244.0..230 and server 10.244.1.85

image

This example shows the bytes_count_per_connection where dst_ip=10.244.0.113 which is the pod IP for metrics-server on one of the cluster nodes.

image

(WIP) Here is some initial work on Hubble metrics

image

Considerations

The number of time series increases overtime based on number of new connections in the cluster - the count of time series is the same for both packets_count_per_connection and bytes_count_per_connection metrics since both use the same labels.

image


Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

@SRodi SRodi self-assigned this Nov 22, 2024
@SRodi SRodi requested a review from a team as a code owner November 22, 2024 10:20
@SRodi SRodi marked this pull request as draft November 22, 2024 10:21
@MikeZappa87
Copy link

Did we think though around scalability, performance and stability when adding these metrics? Do we have any concerns? Do we have numbers to back this up?

@@ -140,6 +140,26 @@ func InitializeMetrics() {
dnsResponseCounterDescription,
)

// Conntrack Metrics
ConntrackPacketsCounter = exporter.CreatePrometheusGaugeVecForMetric(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you find a way to integrate these into Hubble metrics as well ?

Copy link
Member Author

Choose a reason for hiding this comment

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

still WIP, but some initial work is done, see this screenshot
image

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.

3 participants