-
Notifications
You must be signed in to change notification settings - Fork 5k
otel: fix service.name for beats receivers #44831
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
otel: fix service.name for beats receivers #44831
Conversation
Beats receivers currently use the hostname as the "service.name" logger field. Adjust it to reflect the beat name for consistency with standard beats.
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
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.
Pull Request Overview
This PR updates the service.name logger field for Beats receivers to use the beat name instead of the hostname.
- Added a new
Beatfield to theReceiverConfigstruct and tests - Updated
logpConfig.Beatto referenceInfo.Beatinstead ofInfo.Name - Extended OTEL test helpers to validate and assert the new
service.namefield
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| x-pack/metricbeat/mbreceiver/receiver_test.go | Added Beat: "metricbeat" to test receiver configurations |
| x-pack/filebeat/fbreceiver/receiver_test.go | Added Beat: "filebeat" to test receiver configurations |
| x-pack/libbeat/cmd/instance/beat.go | Changed logpConfig.Beat assignment to use b.Info.Beat |
| libbeat/otelbeat/oteltest/oteltest.go | Introduced Beat field, validation, helper, and assertions |
Comments suppressed due to low confidence (3)
libbeat/otelbeat/oteltest/oteltest.go:44
- [nitpick] Consider adding a comment for the
Configfield to match the style of other struct field comments.
Config component.Config
libbeat/otelbeat/oteltest/oteltest.go:138
- [nitpick] The function name
beatForCompIDis terse; consider renaming togetBeatForComponentIDorresolveBeatByComponentIDfor clarity.
beatForCompID := func(compID string) string {
x-pack/libbeat/cmd/instance/beat.go:113
- Ensure project and user-facing documentation is updated to reflect that
logpConfig.Beatnow usesInfo.Beatinstead ofInfo.Name.
logpConfig.Beat = b.Info.Beat
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
* otel: fix service.name for beats receivers Beats receivers currently use the hostname as the "service.name" logger field. Adjust it to reflect the beat name for consistency with standard beats. * use require.Contains before Equal * fix linter issues (cherry picked from commit df3dcad) # Conflicts: # x-pack/filebeat/fbreceiver/receiver_test.go
* otel: fix service.name for beats receivers Beats receivers currently use the hostname as the "service.name" logger field. Adjust it to reflect the beat name for consistency with standard beats. * use require.Contains before Equal * fix linter issues (cherry picked from commit df3dcad) # Conflicts: # x-pack/filebeat/fbreceiver/receiver_test.go
…44863) * otel: fix service.name for beats receivers (#44831) * otel: fix service.name for beats receivers Beats receivers currently use the hostname as the "service.name" logger field. Adjust it to reflect the beat name for consistency with standard beats. * use require.Contains before Equal * fix linter issues (cherry picked from commit df3dcad) # Conflicts: # x-pack/filebeat/fbreceiver/receiver_test.go * fix conflicts --------- Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
…4864) * otel: fix service.name for beats receivers (#44831) * otel: fix service.name for beats receivers Beats receivers currently use the hostname as the "service.name" logger field. Adjust it to reflect the beat name for consistency with standard beats. * use require.Contains before Equal * fix linter issues (cherry picked from commit df3dcad) # Conflicts: # x-pack/filebeat/fbreceiver/receiver_test.go * fix conflicts --------- Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
Proposed commit message
Beats receivers currently use the hostname as the "service.name" logger field. Adjust it to reflect the beat name for consistency with standard beats.
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Related issues