Skip to content

[9.1] (backport #9903) [EDOT] - add header setter extension#10050

Merged
VihasMakwana merged 2 commits into
9.1from
mergify/bp/9.1/pr-9903
Sep 22, 2025
Merged

[9.1] (backport #9903) [EDOT] - add header setter extension#10050
VihasMakwana merged 2 commits into
9.1from
mergify/bp/9.1/pr-9903

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Sep 19, 2025

What does this PR do?

This PR adds headersettetextension to EDOT.

Why is it important?

This extension is pretty useful to set headers based on request context/based on the configurations and can be helpful to route requests to various backends. We recently got an issue for same.

  • 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

Disruptive User Impact

How to test this PR locally

  1. Build elastic-agent from this branch.
  2. Run the following config:
receivers:
  filelog:
    include: [ /var/log/system.log ]
    start_at: beginning
    storage: file_storage/filelogreceiver

exporters:
  debug:
    verbosity: detailed
    sampling_initial: 10000
    sampling_thereafter: 10000

extensions:
  headers_setter:
    headers:
    - action: upsert
      key: User-ID
      value: user_id

service:
  extensions: [headers_setter]
  pipelines:
    logs:
      receivers: [filelog]
      exporters:
        - debug

Related issues


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

* add header setter extensions

* go.mod and notice

* revert otel.yml

* add header setter to test config

* spelling

* go.mod

* doc

(cherry picked from commit 593a8b9)

# Conflicts:
#	go.mod
#	internal/pkg/otel/components.go
@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Sep 19, 2025
@mergify mergify Bot requested a review from a team as a code owner September 19, 2025 10:45
@mergify mergify Bot added the conflicts There is a conflict in the backported pull request label Sep 19, 2025
@mergify mergify Bot requested review from michalpristas and pkoutsovasilis and removed request for a team September 19, 2025 10:45
@mergify mergify Bot added the backport label Sep 19, 2025
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Sep 19, 2025

Cherry-pick of 593a8b9 has failed:

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

You are currently cherry-picking commit 593a8b905.
  (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)

Changes to be committed:
	modified:   NOTICE-fips.txt
	modified:   NOTICE.txt
	new file:   changelog/fragments/1757668211-add-headersetter-extension-to-EDOT.yaml
	modified:   go.sum
	modified:   internal/pkg/otel/README.md
	modified:   internal/pkg/otel/testdata/all-components.yml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   go.mod
	both modified:   internal/pkg/otel/components.go

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 the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Sep 19, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Sep 22, 2025

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

Comment thread internal/pkg/otel/components.go Outdated
Copy link
Copy Markdown
Contributor

@mykola-elastic mykola-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the components.go the headersetterextension import is under "receivers" section, please move it to "extensions"

VihasMakwana
VihasMakwana previously approved these changes Sep 22, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

History

cc @VihasMakwana

@elastic-sonarqube
Copy link
Copy Markdown

@VihasMakwana VihasMakwana merged commit 42d8bb3 into 9.1 Sep 22, 2025
23 checks passed
@VihasMakwana VihasMakwana deleted the mergify/bp/9.1/pr-9903 branch September 22, 2025 09:35
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 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.

3 participants