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

87139 - Capture Additional Tags to be sent to Loggly #12

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

waltonr8
Copy link
Contributor

@waltonr8 waltonr8 commented Oct 24, 2023

AB#87139

Changes

  • Added a method that will check the tags for a lambda and if any start with cloudwatch_loggly_tag it will get added as a tag when the logs are sent to loggly
  • Updated tests, Readme and Rubocop.yml file

Test

  • This is deployed in the staging account for membership

  • Add a tag that starts with cloudwatch_loggly_tag to any lambda there and trigger the lambda

  • Go to loggly and search for the tag

  • I have written a detailed PR message and detailed commits explaining what is being changed and why

@zoiec zoiec force-pushed the add_additional_tags_for_loggly branch from 60c64f5 to 689e73c Compare October 25, 2023 18:35
AB#87139

Changes

- Added a method that will check the tags for a lambda and if any start with cloudwatch_loggly_tag it will get added as a tag when the logs are sent to loggly
- Updated tests, Readme and Rubocop.yml file

Test
- This is deployed in the staging account for membership
- Add a tag that starts with cloudwatch_loggly_tag to any lambda there and trigger the lambda
- Go to loggly and search for the tag
@zoiec zoiec force-pushed the add_additional_tags_for_loggly branch from 689e73c to 7a0afcd Compare October 25, 2023 18:42
@zoiec zoiec changed the title Add additional loggly tags from lambda tags 87139 - Capture Additional Tags to be sent to Loggly Oct 25, 2023
@zoiec zoiec marked this pull request as ready for review October 25, 2023 18:43
@zoiec zoiec requested a review from a team as a code owner October 25, 2023 18:43
README.md Outdated
@@ -50,6 +50,10 @@ If you wish to opt-out a Lambda function from Loggly delivery, add the `cloudwat

By default, the value from the `FilterPatternParameter` is used when subscribing to CloudWatch log events. This value can be overridden on a per-function basis by setting the Lambda function's `cloudwatch_loggly_filter_pattern` tag to the value that you prefer.

### Adding tags to cloudwatch for a lambda

By default, the only tags that will be sent to loggly are the ones specified in `LogTagsParameter`, the owner (account number) and the log group that the logs are from. If you would like to send additional tags then you must add a tag to the lambda that starts with `cloudwatch_loggly_tag`. For example a log group with the tag `cloudwatch_loggly_mfe: omninotes` will have the tag `omninotes` added to the loggly tags.

Choose a reason for hiding this comment

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

Should cloudwatch_loggly_mfe be cloudwatch_loggly_tag_mfe?

Copy link
Contributor

Choose a reason for hiding this comment

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

@DessertMonster Yes Let me fix that, because that is important

DessertMonster
DessertMonster previously approved these changes Oct 25, 2023
Copy link

@DessertMonster DessertMonster left a comment

Choose a reason for hiding this comment

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

Tested this by adding two new tags to my composite get history lambda:
image

Both showed up in Loggly when I invoked the lambda:

image

Copy link

@DessertMonster DessertMonster left a comment

Choose a reason for hiding this comment

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

🐘🐘🐘

@zoiec zoiec merged commit 5ad91a0 into master Oct 25, 2023
4 checks passed
@zoiec zoiec deleted the add_additional_tags_for_loggly branch October 25, 2023 21:24
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.

3 participants