Skip to content
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

feat(image-tag): Add image name and tag to meta object #436

Merged
merged 6 commits into from
Oct 28, 2022

Conversation

james-t-bloom
Copy link
Contributor

Summary:
Parsing out container image and tag from appropriate container, sending via _meta object

Test Plan:

Manually test on web application
Unit tests

Ref: Log-10828

Summary:
Parsing out container image and tag from appropriate container,
sending via _meta object

Test Plan:

Manually test on web application
Unit tests

Ref: Log-10828
Copy link
Collaborator

@c-nixon c-nixon left a comment

Choose a reason for hiding this comment

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

This looks great, can we get an integration test for it? Or maybe just add the check to one of the existing kubernetes ones?

Copy link
Contributor

@stsantilena stsantilena left a comment

Choose a reason for hiding this comment

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

This LGTM.

let meta_object =
extract_image_name_and_tag(parse_result.container_name, pod.as_ref());
if line.set_meta(json!(meta_object)).is_err() {
return Status::Skip;
Copy link
Contributor

Choose a reason for hiding this comment

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

just skip?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

following the pattern of how the rest of the fields are set.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Afair it's like that to avoid the metadata middleware from blocking the sending of actual log lines

Copy link
Contributor

@dkhokhlov dkhokhlov Oct 27, 2022

Choose a reason for hiding this comment

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

how about logging the error? if meta got lost then the line that gets sent is invalid.
how will we know about this issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would normally agree but the error that is returned from this is actually nothing. It would be just as helpful to not have a log for it.

However - in the spirit of this i am going to add

This looks great, can we get an integration test for it? Or maybe just add the check to one of the existing kubernetes ones?

added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dkhokhlov added some more logic around your suggestion.

@james-t-bloom james-t-bloom merged commit f325d58 into master Oct 28, 2022
@james-t-bloom james-t-bloom deleted the LOG-10828-image-name-tag branch October 28, 2022 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants