-
Notifications
You must be signed in to change notification settings - Fork 115
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 service name and version to User-Agent
header
#509
Comments
Sounds reasonable and quite easy to do, only thing to consider is potential abuse. |
Could you be so kind as to explain the abuse potential? The security implications would also be interesting to us when we are instructing our clients to use this feature.
Mostly Java. Which is why I opened the feature request here at first. We also have go, node.js and Python agents running. |
I can't see such, but it's the one thing that comes in mind that worth consideration.
Right, in which case we may consider moving it to the https://github.com/elastic/apm repo. |
It seems useful to me, agree that it should be something that is specified consistently across agents. I think it is fine, though, if not all agents implement that feature. @thomasklinger1234 is it important that the identifier is configurable? Or is it enough for the agent to just add the service name? Or do you need to be able to identify a particular instance of an agent? If yes, what would be the best identifier for that? The hostname? The service.node.name? The ephemeral id (UUID) of the agent? |
Maybe a good default could be |
@felixbarny For starters, I would be totally happy if the service name or any "human-readable" identifier would be sent that tells us what client sends the data. For our particular use case, the hostname or the UUID would not be useful because reverse-engineering that without knowlege about our client's environment is infeasible. Your suggestion |
Hey @felixbarny, any news on this? I may be also able to implement this and create a PR if needed :) |
Hey @thomasklinger1234, no news here. The next step would be to create a cross-agent spec for that, to make the header consistent across all agents. This is the file that needs to be modified to describe the new behavior: https://github.com/elastic/apm/blob/master/specs/agents/transport.md Also, there were some discussions in the past about the user-agent: #88 |
User-Agent
header
Hi @thomasklinger1234 ! Since there were no alternatives proposed, I wonder what you think about following approach.
And several others, like This could allow putting together dashboards to analyze which services are sending more transactions by volume as well as analyzing individual load by various APM servers (in case you provision separate APM server for separate teams). Below is a sample dashboard I created using Kibana Lens. What do you think? |
Hi @thomasklinger1234 , I've just opened a PR to implement the shared specification on all agents : #514 Once this is properly reviewed and merged, we can start doing the implementation on the Java agent side. |
@SylvainJuge @alex-fedotyev thanks for your efforts, I have been busy the last time and could not respond so sorry for that. Awesome work from both of you, that looks very helpful for us. Excited to see the PR being merged and the implementation as well :) |
Just mentioning a couple possible concerns. I don't think we need to deal with these in the spec, at least not right now. Need we guard against non-ascii chars in Another potential concern is length. Both |
Yah, I will probably do some sanitization of const apm = require('.').start({
serviceName: 'foo',
serviceVersion: 'bar\nblah'
})
apm.startTransaction('t')
apm.endTransaction() I get this error from Node's http lib when attempting the intake request:
|
Is your feature request related to a problem?
We are providing APM servers for multiple teams as a service internally. When analyzing the request logs from our APM servers, we cannot identify clients/agents easily to troubleshoot the individual APM agent. We only get two informations:
which are hard to use when performing analytics without access to the IP ranges.
It would be super helpful to optionally be able to customize the user agent header that the agent is sending (currently
elasticapm-java/1.23.0
or similar).Describe the solution you'd like
Add a new optional property to enable customization of the user agent. When sending data to APM server, the agent will now use the header
elasticapm-java/1.23.0/{my-identifier}
. The optional part could be either inferred automatically, e.g. by using an existing property likeservice_name
or be explicitly set in the configuration file with the propertyreporter_user_agent
.Describe alternatives you've considered
None.
Additional context
Here is a screenshot of our analytics tools that we use for getting insights into the requests that we receive at the APM server. As you can see, we can only distinguish on the IP range which is not useful as our clients use NAT gateways and other proxies which makes the IP not helpful.
The text was updated successfully, but these errors were encountered: