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] Subtable were not correctly formed in the manifests #690

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shin71
Copy link

@shin71 shin71 commented Nov 28, 2024

Telegraf CloudWatch Input Plugin Configuration Resolution in Helm Template

Configuration

configuration:
  config:
    agent:
      interval: "10s"
      # ... other settings ...
    inputs:
      - cloudwatch:
          region: "eu-west-1"
          role_arn: $AWS_ROLE_ARN
          web_identity_token_file: $AWS_WEB_IDENTITY_TOKEN_FILE
          period: "5m"
          delay: "1m"
          namespaces:
            - "AWS/EC2"
          metrics:
            names:
              - "CPUUtilization"
              - "DiskReadOps"
              - "NetworkIn"

Initial Error

2024-11-28T11:17:01Z I! Loading config: /etc/telegraf/telegraf.conf
2024-11-28T11:17:01Z E! loading config file /etc/telegraf/telegraf.conf failed: error parsing cloudwatch, line 41: cannot unmarshal TOML table into ]*cloudwatch.cloudwatchMetric (need struct or map)
Stream closed EOF for telegraf/telegraf-7c58fdcfc8-gxx8n (telegraf)

Problematic Helm Template

[[inputs.cloudwatch]]
  delay = "1m"
  namespaces = [
    "AWS/EC2"
  ]
  period = "5m"
  region = "eu-west-1"
  role_arn = "$AWS_ROLE_ARN"
  web_identity_token_file = "$AWS_WEB_IDENTITY_TOKEN_FILE"
  [inputs.cloudwatch.metrics]
    names = [
        "CPUUtilization",
        "DiskReadOps",
        "NetworkIn"
    ]

Corrected Helm Template

[[inputs.cloudwatch]]
  delay = "1m"
  namespaces = [
    "AWS/EC2"
  ]
  period = "5m"
  region = "eu-west-1"
  role_arn = "$AWS_ROLE_ARN"
  web_identity_token_file = "$AWS_WEB_IDENTITY_TOKEN_FILE"
  [[inputs.cloudwatch.metrics]]
    names = [
        "CPUUtilization",
        "DiskReadOps",
        "NetworkIn"
    ]

Changes

  • This fixes the TOML parsing issue with the CloudWatch input plugin when generated by Helm

Reference

@shin71 shin71 changed the title Subtable were not correctly formed in the manifests [telegraf] Subtable were not correctly formed in the manifests Nov 28, 2024
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.

1 participant