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 userAgent for Alerts #291

Open
joe-lipson opened this issue Sep 25, 2024 · 5 comments · Fixed by #300
Open

Add userAgent for Alerts #291

joe-lipson opened this issue Sep 25, 2024 · 5 comments · Fixed by #300
Assignees
Milestone

Comments

@joe-lipson
Copy link
Contributor

Requests from the aws-alerts-prod-2022 instance are coming up with a UA of Java/11.0.24

Alerts should identify itself like our other services as service/version e.g. ozcam-hub/7.1.0

@nickdos nickdos self-assigned this Sep 25, 2024
@nickdos nickdos added this to the 4.3.0 milestone Oct 2, 2024
@nickdos
Copy link
Contributor

nickdos commented Oct 2, 2024

Added to code with config override (customUserAgent) and tested by watching the access_log for lists-test:

140.253.238.151 - - [03/Oct/2024:09:24:29 +1000] "GET /ws/speciesListInternal/dr22803 HTTP/1.1" 200 415 "-" "alerts/4.3.0-SNAPSHOT" "-" request_time=0.006 upstream_response_time=0.008 upstream_connect_time=0.004 upstream_header_time=0.008 upstream_cache_status=-

@joe-lipson - would it help to also include "ALA" in the string, so you could check for any ALA services without specifying the app names? E.g. ala-alerts/4.3.0. Or we could use qualified name au.org.ala.alerts/4.3.0.

@joe-lipson
Copy link
Contributor Author

Added to code with config override (customUserAgent) and tested by watching the access_log for lists-test:

140.253.238.151 - - [03/Oct/2024:09:24:29 +1000] "GET /ws/speciesListInternal/dr22803 HTTP/1.1" 200 415 "-" "alerts/4.3.0-SNAPSHOT" "-" request_time=0.006 upstream_response_time=0.008 upstream_connect_time=0.004 upstream_header_time=0.008 upstream_cache_status=-

@joe-lipson - would it help to also include "ALA" in the string, so you could check for any ALA services without specifying the app names? E.g. ala-alerts/4.3.0. Or we could use qualified name au.org.ala.alerts/4.3.0.

Nice! I'm totally fine with just the alerts/[version] format which is in line with other products. ala-alerts fine too but as these are our internal services making requests just to other internal services not sure it's needed, or would there be cross LA requests where this would be useful to know it's coming from ALA alerts?

@nickdos
Copy link
Contributor

nickdos commented Oct 3, 2024

@joe-lipson - I'm not sure how you'll be using these values but I thought/guessed you might want to filter all the access_logs for internal requests (or exclude them), when trying to "find stuff". So having the "ala" string might be useful??? As opposed to needing to do an ORed search for alerts OR biocache OR bie OR dashboard. I.e. setting up a filter in Elastic Search. Using the qualified name would be better, as it would avoid false positive hits - "au.org.ala" is more distinct than just "ala".

@joe-lipson
Copy link
Contributor Author

hmm yeah that would be useful, but it's not a big hassle to OR the UAs in a query if needed, we'd need to update all our services to be ala-[service] before it would work too. I'm happy to just keep it as [service]/[version]

@nickdos
Copy link
Contributor

nickdos commented Oct 3, 2024

NW. I've made this a config value, so in the future it could easily be updated, if needed. Although it would require the use of a YAML config to be able to reference the version number (properties files can't do this, AFAIK).

@nickdos nickdos linked a pull request Oct 3, 2024 that will close this issue
@nickdos nickdos reopened this Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants