feat: lambda-promtail; ensure messages to Kinesis are usable by refactoring parsing of KinesisEvent to match parsing of CWEvents + code cleanup - #13098
Merged
cstyan merged 7 commits intoJul 19, 2024
Conversation
Contributor
|
hey @HatiCode there are some lambda promtail tests failing |
Contributor
Author
cstyan
reviewed
Jul 16, 2024
Comment on lines
+93
to
+99
| model.LabelName("__aws_cloudwatch_log_group"): model.LabelValue(recordData.LogGroup), | ||
| model.LabelName("__aws_cloudwatch_owner"): model.LabelValue(recordData.Owner), | ||
| } | ||
|
|
||
| if keepStream { | ||
| labels[model.LabelName("__aws_cloudwatch_log_stream")] = model.LabelValue(recordData.LogStream) | ||
| } |
Contributor
There was a problem hiding this comment.
should these not be prefixed with __aws_kinesis instead of __aws_cloudwatch?
Contributor
Author
There was a problem hiding this comment.
@cstyan depending on the pov. The values are coming from cloudwatch, not from the K stream. K is a data stream not the source so I believe you want to have a filter that's a reflection of what your actual cloudwatch looks like, not the tool you used in the middle to stream that data.
Contributor
There was a problem hiding this comment.
that makes sense, thanks for the context 👍
cstyan
approved these changes
Jul 19, 2024
This was referenced Aug 15, 2024
This was referenced Oct 14, 2024
This was referenced Oct 21, 2024
This file contains hidden or 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
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.
Refactor parsing of KinesisEvent to match parsing of CWEvents + code cleanup
What this PR does / why we need it:
This PR refactors the kinesis.go parsing code to match the way CWEvents are sent to Promtail.
When Kinesis is chosen as a delivery method it should still have a simple and usable log format. So far the message in the DATA_MESSAGE is unusable. This is solved by assigning labels to the logEvents in the DATA_MESSAGE the same way it's done in cw.go
Which issue(s) this PR fixes:
Fixes #10544
Special notes for your reviewer:
Checklist
CONTRIBUTING.mdguide (required)featPRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.mdproduction/helm/loki/Chart.yamland updateproduction/helm/loki/CHANGELOG.mdandproduction/helm/loki/README.md. Example PRdeprecated-config.yamlanddeleted-config.yamlfiles respectively in thetools/deprecated-config-checkerdirectory. Example PR