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

telegraf_agent_aws_tags creates an invalid Telegraf configuration #128

Closed
Puneeth-n opened this issue Jul 10, 2020 · 1 comment · Fixed by #129
Closed

telegraf_agent_aws_tags creates an invalid Telegraf configuration #128

Puneeth-n opened this issue Jul 10, 2020 · 1 comment · Fixed by #129

Comments

@Puneeth-n
Copy link
Contributor

Module commit: 08b1c62

Telegraf version:

root@ip-10-10-37-179:/opt/ct/jenkins# telegraf --version
Telegraf 1.14.5 (git: HEAD e77ce3d1)

Configuration:

    - role: dj-wasabi.telegraf
      tags:
        - register
      vars:
        telegraf_agent_docker: False
        telegraf_agent_package_state: latest
        telegraf_agent_interval: 60
        telegraf_agent_aws_tags: "{{ True if ansible_system_vendor in ['Xen', 'Amazon EC2'] else False }}"

        telegraf_global_tags:
          - tag_name: type
            tag_value: jenkins-node
          - tag_name: host
            tag_value: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
        telegraf_plugins_default:
          - plugin: cpu
            config:
              - percpu = true
              - totalcpu = true
          - plugin: disk
            tagpass:
              - fstype = [ "ext4", "xfs" ]
            tagdrop:
              - path = [ "/etc", "/etc/telegraf", "/etc/hostname", "/etc/hosts", "/etc/resolv.conf" ]
          - plugin: io
          - plugin: diskio
          - plugin: mem
          - plugin: system
          - plugin: swap
          - plugin: net
          - plugin: netstat
          - plugin: processes
          - plugin: docker
            config:
              - endpoint = "unix:///var/run/docker.sock"
              - timeout = "5s"

Error:

root@ip-10-10-37-179:/opt/ct/jenkins# telegraf --test
2020-07-10T12:10:18Z I! Starting Telegraf 1.14.5
2020-07-10T12:10:18Z I! Using config file: /etc/telegraf/telegraf.conf
2020-07-10T12:10:18Z E! [telegraf] Error running agent: Error parsing /etc/telegraf/telegraf.conf, line 8: invalid TOML syntax
root@ip-10-10-37-179:/opt/ct/jenkins# cat /etc/telegraf/telegraf.conf
### MANAGED BY dj-wasabi.telegraf ANSIBLE ROLE ###

[global_tags]
    type = "jenkins-node"
    host = "10.10.37.179"

   Name = "jenkins-node-packer-ami-1594382147"
   aws:ec2:fleet-id = "fleet-a220eec6-fe8b-a982-8c30-23a2263d55ae"
   aws:ec2launchtemplate:id = "lt-0fed73d26801b6895"
   aws:ec2launchtemplate:version = "1"

# Configuration for telegraf agent
[agent]
    interval = "60s"
    debug = false
    hostname = "ip-10-10-37-179.eu-west-1.compute.internal"
    round_interval = true
    flush_interval = "10s"
    flush_jitter = "0s"
    collection_jitter = "0s"
    metric_batch_size = 1000
    metric_buffer_limit = 10000
    quiet = false
    logfile = ""
    omit_hostname = false
@Puneeth-n
Copy link
Contributor Author

The issue is these tags:

   aws:ec2:fleet-id = "fleet-a220eec6-fe8b-a982-8c30-23a2263d55ae"
   aws:ec2launchtemplate:id = "lt-0fed73d26801b6895"
   aws:ec2launchtemplate:version = "1"

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