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

Add default fallback log group and stream names #111

Merged
merged 4 commits into from
Oct 30, 2020
Merged

Add default fallback log group and stream names #111

merged 4 commits into from
Oct 30, 2020

Conversation

davidnewhall
Copy link
Contributor

@davidnewhall davidnewhall commented Oct 13, 2020

Issue #, if available: #99

Description of changes:
This adds two new input variables to the plugin with defaulted static values. These variables represent fallback group and stream names that get used any time a $(variable) in one of the templated inputs fails to parse.

The build failed with these errors:

cloudwatch/helpers.go:75: Errorf format %w has unknown verb w
cloudwatch/helpers.go:98: Errorf format %w has unknown verb w
cloudwatch/helpers.go:116: Errorf format %w has unknown verb w

The %w verb requires go 1.13 or newer. Requires this: aws/aws-for-fluent-bit#87

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@davidnewhall davidnewhall requested a review from a team as a code owner October 13, 2020 14:57
@PettitWesley
Copy link
Contributor

We can update the go version.

We should first update it here and check the build: https://github.com/aws/aws-for-fluent-bit/blob/master/Dockerfile.plugins#L1

And then update the build.yml for all the plugins: https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit/blob/mainline/.github/workflows/build.yml#L19

@davidnewhall
Copy link
Contributor Author

davidnewhall commented Oct 20, 2020

very strange....

verifying github.com/aws/[email protected]/go.mod: checksum mismatch
	downloaded: h1:LV5vSM9R3vODyhZM9jdUWLThms4Chcio46SUff6XfBY=
	go.sum:     h1:2hixxBh6Xygvxe6x/PSUTphh8dZ0WptVty98ftZIhAU=

SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

I'm not sure what was causing the above error, but amazon-kinesis-firehose-for-fluent-bit had a newer version, so I updated go.mod/sum to this newer version and the error went away. I also made a PR for aws-for-fluent-bit to utilize go 1.15.


if len(e.group) > maxGroupStreamLength {
e.group = output.defaultLogGroupName
logrus.Errorf("[cloudwatch %d] parsing log_group_name template '%s': %v",
Copy link
Contributor

Choose a reason for hiding this comment

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

may be add- "will use default group name" ?

Copy link
Contributor

@PettitWesley PettitWesley left a comment

Choose a reason for hiding this comment

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

LGTM, one nit on an error string.

I am going to wait to merge this till after our planned release this Thursday for arm64 support, just to be safe.

We will need to update the other plugins to go 1.15, I'll add a note in our oncall log for that.

@PettitWesley PettitWesley merged commit b7471be into aws:mainline Oct 30, 2020
@davidnewhall davidnewhall deleted the dn2_defaults branch November 10, 2020 01:23
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.

2 participants