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 kinesis output support #428

Closed

Conversation

jimmystewpot
Copy link
Contributor

This is a PR to add an output plugin that writes to Kinesis.

  • It batches up 500 points per API PUT request to minimise the number of API requests.
  • Uses the Amazon aws-sdk-go libraries for underlying Kenesis support.
  • Has some supporting documentation.
  • Supports multiple forms of Authentication - Environment Variables, IAMS roles or Shared Credentials.

I have attempted to keep it as simple and small as possible. The tests pass on my local system and on other amazon instances where there are provided credentials.

@sparrc
Copy link
Contributor

sparrc commented Dec 10, 2015

Thank you @jimmystewpot! It seems like your unit test is assuming there will be some authentication credentials available? Is that true?

We may not want to have a "test connect and write" for this particular output, as it is quite a bit different than the others, unless there happens to be a docker container somewhere that can Mock the kinesis write endpoint locally.

return errors.New("Error")
}

func formatmetric(k *KinesisOutput, point *client.Point) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you could write a unit test for this function at least

Copy link
Contributor

Choose a reason for hiding this comment

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

As opposed to the full connect and write test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating unit tests now. will add another commit soon.

}

func init() {
outputs.Add("kinesis_output", func() outputs.Output {
Copy link
Contributor

Choose a reason for hiding this comment

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

One last nitpick 😅, call the output just kinesis for consistency and reduce redundancy

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 am planning to write a kinesis monitoring plugin which is why I named it output. Is this bad practise?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jimmystewpot, yes, it should just be named kinesis, in the config they will appear in two different sections outputs.kinesis and plugins.kinesis. We could also call the monitoring plugin kinesis_consumer which would be consistent with the kafka naming that we have now.

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 have updated the PR to include the rename.

@jimmystewpot
Copy link
Contributor Author

Updated the name of the plugin as per your request. I have also removed the connection unit test so that the tests can pass.
I will keep an eye out for a mock kinesis endpoint that I can use for testing.

@sparrc
Copy link
Contributor

sparrc commented Dec 11, 2015

Awesome, thank you @jimmystewpot! I'll fixup the go fmt issue when I merge this

@sparrc sparrc closed this in b91eab6 Dec 11, 2015
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.

None yet

2 participants