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

Cannot differentiate string and numeric options #32

Closed
joshuaspence opened this issue Jul 13, 2016 · 0 comments · Fixed by #80
Closed

Cannot differentiate string and numeric options #32

joshuaspence opened this issue Jul 13, 2016 · 0 comments · Fixed by #80

Comments

@joshuaspence
Copy link
Contributor

I am using the following Puppet code:

  telegraf::input { 'statsd':
    options => {
      service_address          => '127.0.0.1:8125',
      allowed_pending_messages => 10000,
    },
  }

This results in the following Telegraf configuration:

[[inputs.statsd]]
  allowed_pending_messages = "10000"
  service_address = "127.0.0.1:8125"
  templates = ["logstash.* namespace.sender.measurement*"]

This configuration is invalid and Telegraf reports the following error:

Error parsing /etc/telegraf/telegraf.d/statsd.conf, line 2: statsd.Statsd.AllowedPendingMessages: `string' type is not assignable to `int' type

The problem here is that Puppet doesn't differentiate between numbers and strings (at least until Puppet 4, unless using the future parser). I was able to workaround this issue with the following Puppet code:

  telegraf::input { 'statsd':
    options => {
      service_address          => '127.0.0.1:8125',
      allowed_pending_messages => 0 + 10000,
    },
  }

Ideally though, the template used by telegraf::input would check if a configuration option is numeric and remove the quotes.

doomnuggets added a commit to doomnuggets/puppet-telegraf that referenced this issue Jan 29, 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 a pull request may close this issue.

1 participant