【问题标题】:Error in helm chart "cannot unmarshal TOML integer into float64"掌舵图中的错误“无法将 TOML 整数解组为 float64”
【发布时间】:2020-04-14 16:41:10
【问题描述】:

我试图将Telegraf helm chart 安装到命名空间 internet-monitor 中的 kubernetes 集群。

我想集成 InfluxDB、Telegraf 和 Grafana 来监控互联网连接。

我要集成的 Grafana 仪表板是:https://grafana.com/grafana/dashboards/2690

它说 Telegraf 输入 ping 插件应该有配置:

[[inputs.ping]]
interval = "60s"
urls = ["208.67.222.222", "208.67.220.220", "ddg.gg", "pfSense.home", "accessPoint.home", "amazon.com", "github.com"]
count = 4
ping_interval = 1.0
timeout = 2.0

我用数值文件安装了 Telegraph 图表:

config:
  agent:
    interval: "10s"
    round_interval: true
    metric_batch_size: 1000
    metric_buffer_limit: 10000
    collection_jitter: "0s"
    flush_interval: "10s"
    flush_jitter: "0s"
    precision: ""
    debug: false
    quiet: false
    logfile: ""
    hostname: "$HOSTNAME"
    omit_hostname: false
  processors:
    - enum:
        mapping:
          field: "status"
          dest: "status_code"
          value_mappings:
            healthy: 1
            problem: 2
            critical: 3
  outputs:
    - health:
        service_address: "http://:8888"
        compares:
          field: buffer_size
          lt: 5000.0
        contains:
          field: buffer_size
    - influxdb:
        urls:
          - "http://influxdb.internet-monitor.svc.cluster.local:8086"
        database: "telegraf"
  inputs:
    - statsd:
        service_address: ":8125"
        percentiles:
          - 50
          - 95
          - 99
        metric_separator: "_"
        allowed_pending_messages: 10000
        percentile_limit: 1000
    - ping:
        interval: "60s"
        count: 4
        ping_interval: 1
        timeout: 2
        urls:
          - "208.67.222.222"
          - "amazon.com"
          - "github.com"
          - "google.com"
          - "10.0.2.46"
          - "192.168.1.223"
          - "192.168.1.20"

但是安装helm chart的时候报错:

2019-12-23T11:06:25Z I! Starting Telegraf 1.12.6
2019-12-23T11:06:25Z I! Using config file: /etc/telegraf/telegraf.conf
2019-12-23T11:06:25Z E! [telegraf] Error running agent: Error parsing /etc/telegraf/telegraf.conf, line 46: (ping.Ping.PingInterval) cannot unmarshal TOML integer into float64

根据here 的规定,PingInterval 需要一个 float64 值。

我该如何解决这个问题?

【问题讨论】:

    标签: yaml kubernetes-helm telegraf toml


    【解决方案1】:

    当值文件中的电报配置指定 ping_interval 浮点值时发生这种情况:

    telegraf: 
      config:
        inputs:
          - ping:
              ping_interval: "1.0"
              timeout: "2.0"
    

    这个解析问题的解决方法是指定这两个参数(其值为float类型)作为ping命令的参数。

    telegraf: 
      config:
        inputs:
          - ping:
              arguments: ["-i", "1.0", "-W", "2.0"]
    

    【讨论】:

      猜你喜欢
      • 2019-03-15
      • 2021-08-25
      • 2020-06-12
      • 1970-01-01
      • 2020-08-26
      • 2021-06-13
      • 1970-01-01
      • 1970-01-01
      • 2019-03-05
      相关资源
      最近更新 更多