Giter VIP home page Giter VIP logo

Comments (5)

htj avatar htj commented on September 25, 2024

+1 for having this use case. We often have hosts that need to collect some service specific metrics, and adding those is a bit cumbersome.

We ended up doing this in inputs in the resource spec:

    inputs              => {
      ...
      mem    => [ {} ],
      io     => [ {} ],
      net    => [ {} ],
      system => [ {} ]
    } + lookup('ndn::telegraf.inputs', {default_value => [{}], merge => deep}),

So we could add additional inputs per host.

from puppet-telegraf.

alexjfisher avatar alexjfisher commented on September 25, 2024

@htj The ability to configure merge behaviour was added in #134
Does this work for you?

from puppet-telegraf.

htj avatar htj commented on September 25, 2024

@alexjfisher

I had several issues getting this to work. Having:
merge_hash_arrays: true
Option in common.yaml as listen in:
https://github.com/voxpupuli/puppet-telegraf/pull/99/commits
Make it possible to have multiple inputs of the same type (we often have multiple inputs.exec for custom collections)

However this did not make it possible to have multiple
telegraf::inputs:
As one would always wine. I suspect it has something to do with look hiarchy, but I don't understand Puppet well enough to debug it.

from puppet-telegraf.

alexjfisher avatar alexjfisher commented on September 25, 2024

The lookup_options in https://github.com/voxpupuli/puppet-telegraf/blob/777e608c000655781179913d9ee41aacd216c8c0/data/defaults.yaml are just the defaults. You can override lookup_options in your environments hiera, for example in your node specific hiera data. See https://puppet.com/docs/puppet/latest/hiera_merging.html#overriding-merge-behavior

If you still can't make it merge the way you need it to, could you provide some specific examples of what you're trying to achieve?

from puppet-telegraf.

danielsreichenbach avatar danielsreichenbach commented on September 25, 2024

Changing lookup_options in the module to this:

---
lookup_options:
  'telegraf::inputs':
    merge:
      strategy: deep
      merge_hash_arrays: true
  'telegraf::outputs':
    merge:
      strategy: deep
      merge_hash_arrays: true

resolves the issue.

from puppet-telegraf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.