-
Notifications
You must be signed in to change notification settings - Fork 116
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
[agents] Standardize on user-agent header set by (backend) agents #88
Comments
Just a little background of the funky looking Node.js user-agent:
It's not uncommon in user-agent headers to concatenate The names used here are the actual names of the npm packages, where I guess we're just "lucky" that the Node.js agent has to have the word The names are not hardcoded. I get the name of the npm package at runtime, so if someone forks the agent and releases it under another name, we'll see that new name. But if we feel it's best, I can change it to be hardcoded as I'm not sure this is possible with the other languages, but following the logic of chainging
|
Probably best if we're consistent, in case we want to do some analysis on the headers. It wouldn't be hard to clean the data, but the less needed the better. Do you think it would be useful to check the package name and only use "elasticapm-node" if it matches "elastic-apm-node"? That way if someone does change the package name for some reason, then we would still see it.
👍 I think I'll do the same for the Go agent. |
So are we agreeing on |
I think we're agreeing on |
relates to elastic/apm#88
relates to elastic/apm#88
Issues created for all backend agents, closing this now. |
Sorry that I'm a little late to the party here, but the decision to change the name of the Node.js library in the user-agent to not match the name of the actual library seems confusing. I appreciate where the incentive comes from (being able to have one common name across all official agents), but I also think it's useful information to know the name and version of the library being used. So shouldn't E.g. the user-agent in Node.js agent has now been changed to |
If we assume the module and language names are 1:1, then I don't see how it's confusing. I personally have been thinking of the user-agent as relating to the agent name/version, not the package or module name. The only reason it wouldn't be 1:1 is if someone forked the agent, but is that really something we need to deal with? Go package paths include slashes, so it would look like Although it's duplicating the version, I think we should go with the common |
True, but they are not 1:1, right? Or maybe I misunderstood what you mean by module and language.
I've always personally thought of it the opposite. I.e. that it's mainly a debugging tool, so I want to know the name and version of the libraries involved. But I'm 100% on board with the use-case of wanting to add the "official" agent name as well 👍
Good point, though I don't think parsing is going to be a normal use-case?
Sounds good to me. My main concern was that the npm package name was no longer part of the Node user-agent string. Duplicating the version is not a big problem for me. |
I meant that it's probably safe to assume that if the user-agent is "elasticapm-node", the agent module used is "elastic-apm-node"; and the versions are the same. Anyways, fine if we include both.
Hypothetically could be useful as a means of basic telemetry, without having to reach into the stream contents to pull out the agent metadata. Agreed that it's not a normal/typical use case though. |
Description of the issue
Currently, we have a hodgepodge of
user-agent
headers set by the backend agents:(Thanks @graphaelli for compiling the list)
As a minimum, the
user-agent
should contain the language and the agent version. Preferably (IMO) it should also contain the product name (Elastic APM) in some form, which helps with discerning official agents from unofficial implementations.Having both the language and the agent version is extremely helpful for debugging issues between agents and APM Servers.
I propose
elasticapm-$language/$version
.There might also be some merit in including the name/version of the HTTP library used, e.g.
The RUM agent is not included in the examples and vote, as it can't set the user-agent itself.
What we are voting on
Nothing yet, let's agree on a format first.
Vote
The text was updated successfully, but these errors were encountered: