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

Support multiple output plugins of the same type #57

Merged
merged 1 commit into from
Aug 4, 2017

Conversation

KarolisL
Copy link
Contributor

We need to write (replicate) the same metrics to 2 different influxdb servers but that's not possible with current implementation

This PR defines telegraf::output type which can be used to fulfill our needs.

Any comments/suggestions welcome. :-)

) {
include telegraf

notice("Creating: ${name} :: ${plugin_type}")
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this notice is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thx for noticing. Removed that.

@@ -0,0 +1,35 @@
# == Define: telegraf::input
Copy link
Member

Choose a reason for hiding this comment

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

::telegraf::output

@@ -0,0 +1,35 @@
# == Define: telegraf::input
#
# A Puppet wrapper for discrete Telegraf input files
Copy link
Member

Choose a reason for hiding this comment

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

'output'

# Hash. Plugin options for use the the input template.
#
# [*sections*]
# Hash. Some inputs take multiple sections.
Copy link
Member

Choose a reason for hiding this comment

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

'outputs'

# === Parameters
#
# [*options*]
# Hash. Plugin options for use the the input template.
Copy link
Member

Choose a reason for hiding this comment

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

'output'

}

Class['::telegraf::config']
->
Copy link
Contributor

Choose a reason for hiding this comment

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

If you move these chaining arrows (lines 29 & 33) to prepend the same line as their chained directives (e.g. ->\nfile {... becomes -> file {...), I think tests will pass on this PR.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@KarolisL
Copy link
Contributor Author

Tests still fail with cryptic error message. Have I made some other mistake?

define telegraf::output (
$plugin_type = $name,
$options = undef,
$suboptions = undef,
Copy link
Contributor

Choose a reason for hiding this comment

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

need to declare $sections = undef, (e.g.) here

@mxjessie
Copy link
Contributor

mxjessie commented Jul 14, 2017

I've got an open PR to fix the incomprehensible rake lint errors. If you declare $sections and pull to the latest master, I think tests will pass.

@yankcrime
Copy link
Member

@KarolisL If you want to make the changes as @mxjessie suggests then this should be good to go.

@KarolisL
Copy link
Contributor Author

KarolisL commented Aug 4, 2017

Thanks!

Should I squash the commits?

@yankcrime
Copy link
Member

@KarolisL Please - I can 'squash and merge' but it would be best if you cleaned up your history 👍

@KarolisL
Copy link
Contributor Author

KarolisL commented Aug 4, 2017

@yankcrime done

@yankcrime
Copy link
Member

Thanks @KarolisL !

@yankcrime yankcrime merged commit 98167de into voxpupuli:master Aug 4, 2017
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