Skip to content

[9.0](backport #7062) Enrich otel logs to match beat process logs #7676

Merged
khushijain21 merged 8 commits into9.0from
mergify/bp/9.0/pr-7062
Apr 21, 2025
Merged

[9.0](backport #7062) Enrich otel logs to match beat process logs #7676
khushijain21 merged 8 commits into9.0from
mergify/bp/9.0/pr-7062

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Apr 2, 2025

What does this PR do?

This PR adds component.* fields for components run by the OTelManager. For more reasoning check https://github.com/elastic/ingest-dev/issues/5139

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

How to test this PR locally

Logs from normal mode

{"log.level":"info","@timestamp":"2025-02-24T10:59:43.243Z","message":"X","component":{"binary":"filebeat","dataset":"elastic_agent.filebeat","id":"filestream-monitoring","type":"filestream"},"log":{"source":"filestream-monitoring"},"log.logger":"centralmgmt.V2-manager","log.origin":{"file.line":505,"file.name":"management/managerV2.go","function":"github.com/elastic/beats/v7/x-pack/libbeat/management.(*BeatV2Manager).unitListen"},"service.name":"filebeat","ecs.version":"1.6.0","ecs.version":"1.6.0"}

Logs from components run by Otel Manager

{"log.level":"error","@timestamp":"2025-02-27T17:24:15.152+0530","log.logger":"modules","message"X","log":{"source":"elastic-agent"},"kind":"receiver","name":"filebeatreceiver/_agent-component/filestream-default","data_type":"logs","log":{"source":"filestream-default"},"component":{"binary":"filebeat","dataset":"elastic_agent.filebeat","id":"filestream-default"},"service.name":"Khushis-MacBook-Pro.local","ecs.version":"1.6.0","ecs.version":"1.6.0"}

Some Differences:

  • We have two log.source fields in the latter. It is not misleading, but two fields with same key can be confusing to users.

Related issues


This is an automatic backport of pull request #7062 done by [Mergify](https://mergify.com).

@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Apr 2, 2025
@mergify mergify bot requested a review from a team as a code owner April 2, 2025 18:36
@mergify mergify bot requested review from blakerouse and pchila and removed request for a team April 2, 2025 18:36
@mergify
Copy link
Contributor Author

mergify bot commented Apr 2, 2025

Cherry-pick of ca05561 has failed:

On branch mergify/bp/9.0/pr-7062
Your branch is up to date with 'origin/9.0'.

You are currently cherry-picking commit ca055614f.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   NOTICE.txt
	both modified:   go.mod
	both modified:   go.sum
	deleted by us:   internal/pkg/otel/configtranslate/otelconfig.go
	deleted by us:   internal/pkg/otel/configtranslate/otelconfig_test.go

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog labels Apr 2, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@mergify
Copy link
Contributor Author

mergify bot commented Apr 7, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/9.0/pr-7062 upstream/mergify/bp/9.0/pr-7062
git merge upstream/9.0
git push upstream mergify/bp/9.0/pr-7062

@mergify
Copy link
Contributor Author

mergify bot commented Apr 7, 2025

This pull request has not been merged yet. Could you please review and merge it @khushijain21? 🙏

1 similar comment
@mergify
Copy link
Contributor Author

mergify bot commented Apr 14, 2025

This pull request has not been merged yet. Could you please review and merge it @khushijain21? 🙏

* Add  fields to otel logs

(cherry picked from commit ca05561)
@ycombinator ycombinator force-pushed the mergify/bp/9.0/pr-7062 branch from 9b4f599 to 9c53f9a Compare April 15, 2025 20:39
@ycombinator
Copy link
Contributor

This PR contains changes from #7861. Once that PR is merged, this PR should be rebased on 9.0.

@pchila pchila removed their request for review April 16, 2025 12:10
@mergify
Copy link
Contributor Author

mergify bot commented Apr 16, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/9.0/pr-7062 upstream/mergify/bp/9.0/pr-7062
git merge upstream/9.0
git push upstream mergify/bp/9.0/pr-7062

@khushijain21 khushijain21 enabled auto-merge (squash) April 21, 2025 03:51
@mergify
Copy link
Contributor Author

mergify bot commented Apr 21, 2025

This pull request has not been merged yet. Could you please review and merge it @khushijain21? 🙏

@mergify
Copy link
Contributor Author

mergify bot commented Apr 21, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/9.0/pr-7062 upstream/mergify/bp/9.0/pr-7062
git merge upstream/9.0
git push upstream mergify/bp/9.0/pr-7062

@khushijain21
Copy link
Contributor

/test

@khushijain21
Copy link
Contributor

/test

@elastic-sonarqube
Copy link

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

History

cc @khushijain21

@khushijain21 khushijain21 merged commit 9969a71 into 9.0 Apr 21, 2025
9 of 12 checks passed
@khushijain21 khushijain21 deleted the mergify/bp/9.0/pr-7062 branch April 21, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts There is a conflict in the backported pull request skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants