-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/k8sobjects] use same data structure for objects received via pull
and watch
mode
#36432
Open
bacherfl
wants to merge
10
commits into
open-telemetry:main
Choose a base branch
from
bacherfl:fix/36352/k8sobjects-namespace
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[receiver/k8sobjects] use same data structure for objects received via pull
and watch
mode
#36432
bacherfl
wants to merge
10
commits into
open-telemetry:main
from
bacherfl:fix/36352/k8sobjects-namespace
+594
−468
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… and use same data structure as with pull based mode for log entries Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
github-actions
bot
requested review from
dmitryax,
hvaghani221 and
TylerHelmuth
November 19, 2024 06:14
bacherfl
changed the title
Fix/36352/k8sobjects namespace
[receiver/k8sobjects] use same data structure for objects received via Nov 19, 2024
pull
and watch
mode
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
@@ -37,6 +34,7 @@ func watchObjectsToLogData(event *watch.Event, observedAt time.Time, config *K8s | |||
if name != "" { | |||
attrs.PutStr("event.domain", "k8s") | |||
attrs.PutStr("event.name", name) | |||
attrs.PutStr("event.type", string(event.Type)) |
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.
FYI: there is an issue regarding reflecting of k8s events to the events API definition - #35857 (comment), maybe it makes sense to include event.type
to the events api convention
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR ensures that the structure of log records generated by the k8sobjects receiver is the same, regardless of the mode (
watch
orpull
) being used. This also solves the issue of thek8s.namespace.name
attribute not being set for objects retrieved withwatch
mode.Link to tracking issue
Fixes #36352
Testing
Added unit tests and adapted e2e tests