Skip to content

Conversation

ivankatliarchuk
Copy link
Contributor

@ivankatliarchuk ivankatliarchuk commented Jul 15, 2025

What does it do ?

Owning this code, will let us to instrument more metrics, for example we could add TLS handshakes or DNS resolution latencies, to further improve operational experience.

trace := &promhttp.InstrumentTrace{
	DNSStart: func(t float64) {
		dnsLatencyVec.WithLabelValues("dns_start").Observe(t)
	},
	DNSDone: func(t float64) {
		dnsLatencyVec.WithLabelValues("dns_done").Observe(t)
	},
	TLSHandshakeStart: func(t float64) {
		tlsLatencyVec.WithLabelValues("tls_handshake_start").Observe(t)
	},
	TLSHandshakeDone: func(t float64) {
		tlsLatencyVec.WithLabelValues("tls_handshake_done").Observe(t)
	},
}

Motivation

Fixes #5140

before, just enourmous amount of warning logs

Screenshot 2025-07-15 at 12 01 14

with the fix
Screenshot 2025-07-15 at 11 22 05

Tested. Metrics looks exactly same

Screenshot 2025-07-15 at 11 39 00

Namespace external_dns not added, to keep it as is

http_request_duration_seconds
http_request_duration_seconds_sum

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. provider Issues or PRs related to a provider labels Jul 15, 2025
@k8s-ci-robot k8s-ci-robot added source size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 15, 2025
@ivankatliarchuk ivankatliarchuk force-pushed the fix-instrumented-http-5140 branch from f51dfb0 to 51cdbd7 Compare July 15, 2025 11:17
@ivankatliarchuk ivankatliarchuk force-pushed the fix-instrumented-http-5140 branch from 51cdbd7 to a5141de Compare July 15, 2025 11:22
@AndrewCharlesHay
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 18, 2025
@Raffo
Copy link
Contributor

Raffo commented Jul 18, 2025

Big fan of removing that old dependency, we should have done it earlier.

/lgtm

@ivankatliarchuk
Copy link
Contributor Author

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ivankatliarchuk

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 18, 2025
@k8s-ci-robot k8s-ci-robot merged commit 48760e6 into kubernetes-sigs:master Jul 18, 2025
14 checks passed
@ivankatliarchuk ivankatliarchuk deleted the fix-instrumented-http-5140 branch July 18, 2025 17:43
troll-os pushed a commit to FiligranHQ/external-dns that referenced this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. provider Issues or PRs related to a provider size/L Denotes a PR that changes 100-499 lines, ignoring generated files. source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tons of useless warning log messages for instrumented_http.Transport
4 participants