-
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
[Elastic Agent] Add elastic agent ID and version to events from filebeat and metricbeat. #21543
Conversation
Pinging @elastic/ingest-management (Team:Ingest Management) |
This looks like it could be a fix for an issue I ran into when trying to match up agent logs to agent ID: elastic/kibana#77189 (comment). @blakerouse do you think this PR is relevant to that? |
@jen-huang Yes this is the fix you need. |
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, @blakerouse are we missing heartbeat?
@ph Yes I did not add heartbeat, I didn't know if Uptime needed the same events and if the processors would work the same. If we can confirm that heartbeat needs it I can add it in. |
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
@@ -44,3 +46,13 @@ func ForceNewAgentInfo() (*AgentInfo, error) { | |||
func (i *AgentInfo) AgentID() string { | |||
return i.agentID | |||
} | |||
|
|||
// Version returns the version for this Agent. | |||
func (*AgentInfo) Version() string { |
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.
we use release.Version and release.Snapshot throughout the code, so maybe we can unify the usage of these where it's possible in a followup
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.
Yeah I would like to. I only had to add this here for testing purposes as I needed a way to mock the version for the unit tests.
…eat and metricbeat. (elastic#21543) * Add elastic agent ID and version to events from filebeat and metricbeat. * Add changelog and fix inputs. (cherry picked from commit f5d13aa)
* upstream/master: [CI] Setup git config globally (elastic#21562) docs: update generate_fields_docs.py (elastic#21359) Add support for additional fields from V2 ALB logs (elastic#21540) Move Prometheus query & remote_write to GA (elastic#21507) feat: add a new step to run the e2e tests for certain parts of Beats (elastic#21100) [Elastic Agent] Add elastic agent ID and version to events from filebeat and metricbeat. (elastic#21543) Release cloudfoundry input and processor as GA (elastic#21525) [Packetbeat] New SIP protocol (elastic#21221) [Filebeat][New Module] Add support for Microsoft MTP / 365 Defender (elastic#21446) [Beats][pytest] Asserting if filebeat logs include errors (elastic#20999) junipersrx-module initial release (elastic#20017) Add a persistent cache for cloudfoundry metadata based on badger (elastic#20775) Add missing changelog entry for cisco umbrella (elastic#21550) [Elastic Agent] Add upgrade CLI to initiate upgrade of Agent locally (elastic#21425) Enable filestream input (elastic#21533) Add filestream input reader (elastic#21481) [CI] fix 'no matches found within 10000' (elastic#21466) Fix billing.go aws.GetStartTimeEndTime (elastic#21531)
@blakerouse I think we should also have the same for heartbeat. This can come after 7.10. cc @andrewvc |
@ph I don't believe that heartbeat is also using the new index strategy either. So we have a few things that need to be updated in the spec file for Heartbeat. |
@blakerouse I think heartbeat should be disabled in 7.10, @andrewvc WDYT? |
Each process run by Elastic Agent should be "forced" to add these fields. Do we have a good place to document this? Is this field also shipped by endpoint? Mid term, these fields should not be added anymore through processors but by the processes (MB, FB, *) itself. |
What does this PR do?
Adds the
elastic.agent.id
,elastic.agent.version
, andelastic.agent.snapshot
to all events published from filebeat and metricbeat inputs. This includes when filebeat/metricbeat is monitoring the running Elastic Agent itself.Why is it important?
So it's clear which Elastic Agent sent the events. Elastic Agent has never included this information with each event.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues