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

OpenTelemetry client optimizations #614

Merged
merged 4 commits into from
Aug 23, 2024
Merged

OpenTelemetry client optimizations #614

merged 4 commits into from
Aug 23, 2024

Conversation

ash2k
Copy link
Contributor

@ash2k ash2k commented Aug 23, 2024

ash2k added 4 commits August 23, 2024 21:47
metric.WithAttributeSet(attribute.NewSet()) is more efficient than metric.WithAttributes() as it doesn't make a copy of the argument slice.
@rueian rueian self-requested a review August 23, 2024 14:24
@@ -143,7 +149,7 @@ func newClient(opts ...Option) (*otelclient, error) {
func trackDialing(m dialMetrics, dialFn func(string, *net.Dialer, *tls.Config) (conn net.Conn, err error)) func(string, *net.Dialer, *tls.Config) (conn net.Conn, err error) {
return func(network string, dialer *net.Dialer, tlsConfig *tls.Config) (conn net.Conn, err error) {
ctx := context.Background()
m.attempt.Add(ctx, 1, m.mAttrs)
m.attempt.Add(ctx, 1, m.addOpts...)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is cool. Thank you so much!

@rueian rueian merged commit 1a30827 into redis:main Aug 23, 2024
19 checks passed
@ash2k ash2k deleted the metrics-opts branch August 23, 2024 22:42
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.

2 participants