DataDog / puppet-datadog-agent

Puppet module to install the Datadog agent
Other
52 stars 261 forks source link

Logs still treated as an integration #612

Open devinmatte opened 4 years ago

devinmatte commented 4 years ago

I would love to be able to configure the logs block of each of my integrations like postfix, like the docs tell me to do https://docs.datadoghq.com/integrations/postfix/#log-collection however the puppet module doesn't appear to currently support this use case

gmccue commented 4 years ago

I believe you should be able to do this (untested) using the logs integration: https://github.com/DataDog/puppet-datadog-agent/blob/master/manifests/integrations/logs.pp#L23

Edit: scratch that! re-read the description here, and this is about supporting creation of custom paths like postfix.d/conf.yaml instead of relying on the logs integration (conf.d/logs.yaml).

albertvaka commented 4 years ago

Unfortunately, adding all possible fields to all integrations doesn't scale, so many integrations are missing options (like logs in this case).

To circumvent this problem, we recommend you use the free-form integrations hash in the datadog_agent class. There you can specify any integration you want with any fields you want, like this:

class { "datadog_agent":
    < your other arguments to the class >,
    integrations => {
        postfix => {
            init_config => {
                postfix_user => 'postfix',
            },
            instances => [
                {
                    directory => '/var/spool/postfix',
                    queues => [ 'incoming', 'active', 'deferred' ],
                }
            ],
            logs => [
                {
                    type => 'file',
                    path => '/var/log/mail.log',
                    source => 'postfix',
                    service => 'myapp',
                }
            ],
        },
    },
}

Let me know if this solves your issues!