Skip to content

add workload metrics#1105

Merged
kmesh-bot merged 4 commits intokmesh-net:mainfrom
LiZhenCheng9527:add-metric
Jan 21, 2025
Merged

add workload metrics#1105
kmesh-bot merged 4 commits intokmesh-net:mainfrom
LiZhenCheng9527:add-metric

Conversation

@LiZhenCheng9527
Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind enhancement

What this PR does / why we need it:
Added dimensions of Kmesh workload granularity for metrics and accesslog.
Metrics add :

	tcpConnectionTotalRetransInWorkload = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "kmesh_tcp_workload_connections_total_retrans",
			Help: "The total number of TCP connections retried to a workload.",
		}, workloadLabels)

	tcpConnectionLostOutInWorkload = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "kmesh_tcp_workload_connections_lost_out",
			Help: "The total number of packets lost by the workload over TCP connections.",
		}, workloadLabels)

accesslog add:

srtt=%dus, min_rtt=%dus,

Which issue(s) this PR fixes:
Fixes #1091

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@kmesh-bot kmesh-bot added the kind/enhancement New feature or request label Dec 10, 2024
@LiZhenCheng9527 LiZhenCheng9527 force-pushed the add-metric branch 2 times, most recently from 7b8e33d to 1bb6047 Compare December 10, 2024 07:26
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 10 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@2cf9fe1). Learn more about missing BASE report.
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/telemetry/metric.go 28.57% 10 Missing ⚠️
Files with missing lines Coverage Δ
pkg/controller/telemetry/accesslog.go 90.32% <100.00%> (ø)
pkg/controller/telemetry/utils.go 66.66% <100.00%> (ø)
pkg/controller/telemetry/metric.go 51.42% <28.57%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2cf9fe1...14c7dba. Read the comment docs.

tcpConnectionTotalRetransInWorkload = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "kmesh_tcp_workload_connections_total_retrans",
Help: "The total number of TCP connections retried to a workload.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As far as I understand, this metric describes the number of packet retransmission in a single connection, but this help message makes me feel it describes the number of connections retries sent to a workloads.

One is the packet granularity and the other is the connection granularity.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This metric adds up the number of total_retrans for every time src connect to des.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 confusing to me

Copy link
Copy Markdown
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

replace loss out with packet lost globally

Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
@LiZhenCheng9527
Copy link
Copy Markdown
Contributor Author

@hzxuzhonghu

Copy link
Copy Markdown
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/lgtm

@kmesh-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot kmesh-bot merged commit 4bfc7b7 into kmesh-net:main Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Whether to increase the dimension of the metrics

4 participants