-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 logic for beats User-Agent
#39403
Add logic for beats User-Agent
#39403
Conversation
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I agree with Craig's suggestion. Once it's implemented I'll approve the PR.
Did we also want to add |
Not to pile on... But distinguishing managed from standalone might be nice too... |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
@amitkanfer As we are already having this information in the local metadata, do you have a specific case you want to cover by adding it to User-Agent? For Telemetry only? @strawgate We discussed this quickly during our meeting on Thursday and I think this is a great idea to user the User-Agent for that! @fearful-symmetry WDYT? |
@pierrehilbert I think that's a good idea. I'm not sure if there's any way for beats to know what mode agent is running under? Never heard of anything like that. If we're interested in telemetry, I wonder if we can add that string to some headers sent by agent itself somehow? |
@fearful-symmetry @pierrehilbert can we piggy back on this to also tackle elastic/elastic-agent#3065? |
@jlind23 that issue seems largely the same as https://github.com/elastic/ingest-dev/issues/3202, with the addition of also reporting the agent version. I'm not sure it's possible for the agent version to differ from the beats version? |
For now and with independent releases they'll always be the same major.minor, the patch may differ. |
This pull request is now in conflicts. Could you fix it? 🙏
|
Alright, PR updated with all the feature requests; elastic-agent PR incoming... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still believe the test can be simpler and not rely on the current implementation details from mock-es
. See #39403 (comment) for more details.
I think the CI errors are unrelated? |
Looks like we are all green. |
Proposed commit message
This adds a bit of logic to change the beats ES connection user agent if the beat is running under agent, dependent upon both the fleet status and the underlying management mode of agent itself.
In order for this to be fully functional, we'll need a PR from
elastic-agent
to add support for theAgentManagedMode
enum. That PR is incoming.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related
Closes elastic/elastic-agent#3065