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

Add WithStatsdClient StartOption for tracer #2766

Open
brahimyacine opened this issue Jul 1, 2024 · 1 comment
Open

Add WithStatsdClient StartOption for tracer #2766

brahimyacine opened this issue Jul 1, 2024 · 1 comment
Labels
enhancement quick change/addition that does not need full team approval waiting-for-info waiting for answer from issue creator

Comments

@brahimyacine
Copy link

I need to pass a custom statsdClient (to have freedom of configuration in order to reduce the memory footprint) to the tracer, but I realise that this is not possible, and I'll have to make do with the one created at this level with the default values.
By doing a little research in the repo, I discovered that the option i am looking for does exist but only for test purposes and it's not exported. Is there a reason for this?

func withStatsdClient(s globalinternal.StatsdClient) StartOption {
	return func(c *config) {
		c.statsdClient = s
	}
}
@brahimyacine brahimyacine added the enhancement quick change/addition that does not need full team approval label Jul 1, 2024
@github-actions github-actions bot added the needs-triage New issues that have not yet been triaged label Jul 1, 2024
@felixge
Copy link
Member

felixge commented Jul 5, 2024

Thanks for reporting this and sorry for the delay.

Could you share a bit more on the memory footprint issues you're facing and how you'd like to configure your statsd client to mitigate them?

Generally speaking, we're not opposed to the idea of allowing you to inject your own statsd client. But it does create some challenges:

  1. If we use an interface type for accepting the client, we can't add new methods to this interface in the future without breaking existing users.
  2. If we use a concrete type for the client, we'll have to provide one injection method for every major version of the statsd library (currently at v5).

So I'd like to learn more about your use case before considering any of these options.

@darccio darccio added waiting-for-info waiting for answer from issue creator and removed needs-triage New issues that have not yet been triaged labels Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement quick change/addition that does not need full team approval waiting-for-info waiting for answer from issue creator
Projects
None yet
Development

No branches or pull requests

3 participants