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

Allow to set a custom Transport for MetricsClient #241

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

dvaldivia
Copy link
Contributor

Allows the MetricsClient to set a custom http.Transport so that custom certificates can be supported.

Additionally makes all the methods for the metrics client to receive pointers as the Struct MetricsClient had methods on both value and pointer receivers. Such usage is not recommended by the Go Documentation.

Copy link
Contributor

@cesnietor cesnietor left a comment

Choose a reason for hiding this comment

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

LGTM

@dvaldivia dvaldivia merged commit d822cfb into minio:main Oct 26, 2023
5 checks passed
@dvaldivia dvaldivia deleted the metrics-client-transport branch October 26, 2023 22:44
@harshavardhana
Copy link
Member

Wait this PR is wrong @dvaldivia we do not want to encourage SetCustomTransport

@harshavardhana
Copy link
Member

convert the metrics_client.go NewMetricsClient(endpoint, opts) and take the Transport as part of opts.Transport = transport

@dvaldivia
Copy link
Contributor Author

I did it this way since the madmin.Client had something similar we could update all clients at the same time to that new pattern, however madmin.Client opts doens't support transport yet @harshavardhana

@harshavardhana
Copy link
Member

I did it this way since the madmin.Client had something similar we could update all clients at the same time to that new pattern, however madmin.Client opts doens't support transport yet @harshavardhana

Yeah new clients can use newer style @dvaldivia we have to move madmin.New()

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