Skip to content

Add Resource Detection processor to OTel mode#4811

Merged
michalpristas merged 17 commits intoelastic:mainfrom
andrzej-stencel:add-otel-resource-detection-processor
Jun 17, 2024
Merged

Add Resource Detection processor to OTel mode#4811
michalpristas merged 17 commits intoelastic:mainfrom
andrzej-stencel:add-otel-resource-detection-processor

Conversation

@andrzej-stencel
Copy link
Contributor

@andrzej-stencel andrzej-stencel commented May 24, 2024

What does this PR do?

This PR makes the Resource Detection processor available to users running Elastic Agent in otel mode.

Why is it important?

This allows users to enrich the collected telemetry with metadata of the infrastructure, e.g. host.name, os.type, cloud.provider, cloud.region, k8s.cluster.name and many more.

Checklist

  • 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

Disruptive User Impact

No impact expected.

How to test this PR locally

  1. Build the agent locally (see docs)
  2. Unpack the .tar.gz archive in build/distributions
  3. Run the built binary with `build/distributions/elastic-agent-*/elastic-agent otel --config internal/pkg/otel/testdata/all-components.yml

For some reason the `go.sum` file contains an update to the dependency `github.com/pascaldekloe/goe`, and go-licence-detector cannot detect the license, which is CC0-1.0.

I have added an override for the package and also added CC0-1.0 to allowed licenses.
@andrzej-stencel andrzej-stencel added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels May 24, 2024
@mergify
Copy link
Contributor

mergify bot commented May 24, 2024

This pull request does not have a backport label. Could you fix it @andrzej-stencel? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@andrzej-stencel
Copy link
Contributor Author

Proposed and merged this change to resolve the dependency conflict:

Once this is released in a new version of the elastic-agent-autodiscover library, this pull request will be unblocked.

@andrzej-stencel andrzej-stencel marked this pull request as ready for review June 3, 2024 20:04
@andrzej-stencel andrzej-stencel requested a review from a team as a code owner June 3, 2024 20:04
@elasticmachine
Copy link
Contributor

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

@mergify
Copy link
Contributor

mergify bot commented Jun 4, 2024

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 add-otel-resource-detection-processor upstream/add-otel-resource-detection-processor
git merge upstream/main
git push upstream add-otel-resource-detection-processor

@ycombinator ycombinator requested review from michalpristas and pchila and removed request for kaanyalti and michel-laterman June 5, 2024 22:44
@mergify
Copy link
Contributor

mergify bot commented Jun 6, 2024

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 add-otel-resource-detection-processor upstream/add-otel-resource-detection-processor
git merge upstream/main
git push upstream add-otel-resource-detection-processor

@michalpristas
Copy link
Contributor

seems like you have to resolve som go.mod conflicts but other than that it looks ok

@ycombinator ycombinator linked an issue Jun 7, 2024 that may be closed by this pull request
1 task
@mergify
Copy link
Contributor

mergify bot commented Jun 11, 2024

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 add-otel-resource-detection-processor upstream/add-otel-resource-detection-processor
git merge upstream/main
git push upstream add-otel-resource-detection-processor

@mergify
Copy link
Contributor

mergify bot commented Jun 11, 2024

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 add-otel-resource-detection-processor upstream/add-otel-resource-detection-processor
git merge upstream/main
git push upstream add-otel-resource-detection-processor

@elastic-sonarqube
Copy link

@michalpristas michalpristas merged commit a5a4a3b into elastic:main Jun 17, 2024
@andrzej-stencel andrzej-stencel deleted the add-otel-resource-detection-processor branch June 18, 2024 13:31
@michalpristas michalpristas added backport-v8.14.0 Automated backport with mergify and removed backport-skip labels Jun 21, 2024
mergify bot pushed a commit that referenced this pull request Jun 21, 2024
* Add Resource Detection processor to OTel mode

* go mod tidy

* make notice

For some reason the `go.sum` file contains an update to the dependency `github.com/pascaldekloe/goe`, and go-licence-detector cannot detect the license, which is CC0-1.0.

I have added an override for the package and also added CC0-1.0 to allowed licenses.

* mage otel:readme

* Add changelog entry

* update `elastic-agent-autodiscover` to `v0.7.0`

* make notice

* go mod tidy

* mage update

* make notice

---------

Co-authored-by: Michal Pristas <michal.pristas@gmail.com>
(cherry picked from commit a5a4a3b)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum
#	internal/pkg/otel/README.md
#	internal/pkg/otel/components.go
#	internal/pkg/otel/testdata/all-components.yml
michalpristas added a commit to michalpristas/elastic-agent that referenced this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v8.14.0 Automated backport with mergify enhancement New feature or request 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.

Make resourcedetectionprocessor available in otel mode

4 participants