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

Change default user agent #557

Merged

Conversation

nikonhub
Copy link

Hello.

According to prometheus scrape behavior here Change default go http client user-agent
from "Go-http-client/1.1" to "BlackBox Exporter/{{ version }}"

Issue : #555
Maintainers : @brian-brazil

According to prometheus scrape behavior. Change default go http client user-agent
from "Go-http-client/1.1" to "{{ project_name }}/{{ version }}"

Signed-off-by: nikosmonaut <nikosmonaut@protonmail.ch>
@nikonhub nikonhub force-pushed the feature-change_default_http_user_agent branch from ff2a54a to 305e88c Compare December 12, 2019 12:34
prober/http.go Outdated Show resolved Hide resolved
prober/http.go Outdated Show resolved Hide resolved
Signed-off-by: nikosmonaut <nikosmonaut@protonmail.ch>
@nikonhub nikonhub force-pushed the feature-change_default_http_user_agent branch from 51d7044 to 36b2245 Compare December 12, 2019 15:35
@nikonhub
Copy link
Author

By the way I checked the case of null value.
I think it goes beyond the simple test of key exists because it's not in module.HTTP.

I tried to remove the omitempty but no changes
I found that a nil value can not be assigned to a string.

Headers                      map[string]string       `yaml:"headers,omitempty"`

@brian-brazil
Copy link
Contributor

omitempty affects marshalling, not unmarshalling. Null values are fun, we've had many bugs due to them.

@edevil
Copy link
Contributor

edevil commented Oct 12, 2020

This seems like a useful change. Is there some work to do besides fixing the conflicts?

@brian-brazil
Copy link
Contributor

Hmm, looks like that's the case. Better handling of not sending the header at all would also be good.

@nikonhub
Copy link
Author

nikonhub commented Oct 13, 2020

Yo.

Would you like me to do anything ? Honestly I'm not sure what to do about this PR. I followed this issue #555, and it's been one year with no update on this PR nor the issue. Is it still useful ?

Personnaly I just set the User-Agent to BlackBox in config yml to get the same behaviour.

Edit : Sentence meaning

@brian-brazil
Copy link
Contributor

It is still useful. It's technically breaking, but it doesn't hurt to help track where requests are coming from.

Resolving the conflicts, and allowing for no header to be set if practical, would be good.

@cofyc
Copy link

cofyc commented Jun 28, 2021

any progress?

@megamorf
Copy link

I'd also like to see this merged.

Use case:
Identify monitoring traffic and exclude it from application logs.

@SuperQ
Copy link
Member

SuperQ commented Jan 22, 2022

Going to close and re-open this to see if the tests still pass.

@SuperQ SuperQ closed this Jan 22, 2022
@SuperQ SuperQ reopened this Jan 22, 2022
@SuperQ
Copy link
Member

SuperQ commented Jan 22, 2022

Seems like this is ready to go.

@SuperQ SuperQ merged commit e34a36b into prometheus:master Jan 22, 2022
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.

None yet

6 participants