-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat(lambda-promtail): Improve relabel configuration parsing and testing #16100
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
Conversation
This is required because original relabeling config only support yaml but the lambda promtail config is in json This change introduces a more robust way of parsing and handling relabel configurations in the lambda-promtail tool. Key improvements include: - Added a new `relabel.go` with custom JSON-friendly RelabelConfig - Implemented conversion to Prometheus relabel configs - Added comprehensive test suite for relabel config parsing - Simplified environment variable handling in main.go
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.
Otherwise LGTM
// UnmarshalYAML implements the yaml.Unmarshaler interface. | ||
func (rc *RelabelConfig) UnmarshalJSON(data []byte) error { |
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.
docstring does not match the function name
// UnmarshalYAML implements the yaml.Unmarshaler interface. | |
func (rc *RelabelConfig) UnmarshalJSON(data []byte) error { | |
// UnmarshalJSON implements the json.Unmarshaler interface. | |
func (rc *RelabelConfig) UnmarshalJSON(data []byte) error { |
type RelabelConfig struct { | ||
// A list of labels from which values are taken and concatenated | ||
// with the configured separator in order. | ||
SourceLabels []string `yaml:"source_labels,flow,omitempty" json:"source_labels,omitempty"` |
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.
Should we omit the yaml:
tag, since it is not supported?
Confirmed this fixes the issue. |
This is required because original relabeling config only support yaml but the lambda promtail config is in json
This change introduces a more robust way of parsing and handling relabel configurations in the lambda-promtail tool. Key improvements include:
relabel.go
with custom JSON-friendly RelabelConfig