Skip to content

telegraf run a period, report goroutine error #8626

@zhanghongxia4725

Description

@zhanghongxia4725

2020-12-30T07:50:00Z I! Loaded inputs: cpu disk diskio gbase jolokia kernel kingbase mem processes redis swap system
2020-12-30T07:50:00Z I! Loaded aggregators:
2020-12-30T07:50:00Z I! Loaded processors:
2020-12-30T07:50:00Z I! Loaded outputs: influxdb
2020-12-30T07:50:00Z I! Tags enabled: host=test5-centos7.5
2020-12-30T07:50:00Z I! [agent] Config: Interval:20s, Quiet:false, Hostname:"test5-centos7.5", Flush Interval:20s
2020-12-30T07:50:20Z W! DEPRECATED: the jolokia plugin has been deprecated in favor of the jolokia2 plugin (https://github.com/influxdata/telegraf/tree/master/plugins/inputs/jolokia2)
panic: reflect: Field index out of range

goroutine 681 [running]:
reflect.Value.Field(0x281aea0, 0xc0003c00a0, 0x199, 0xffffffff, 0xc00030c2f8, 0x101, 0x1)
/usr/local/go/src/reflect/value.go:853 +0xd9
encoding/json.(*decodeState).object(0xc000b80188, 0x2647a80, 0xc0003c00a0, 0x16, 0xc000b801b0, 0x7b)
/usr/local/go/src/encoding/json/decode.go:733 +0x14bd
encoding/json.(*decodeState).value(0xc000b80188, 0x2647a80, 0xc0003c00a0, 0x16, 0xc000175c90, 0x790079)
/usr/local/go/src/encoding/json/decode.go:370 +0x6d
encoding/json.(*decodeState).unmarshal(0xc000b80188, 0x2647a80, 0xc0003c00a0, 0x0, 0x1)
/usr/local/go/src/encoding/json/decode.go:180 +0x1ea
encoding/json.(*Decoder).Decode(0xc000b80160, 0x2647a80, 0xc0003c00a0, 0x7f98bfded7c8, 0xc0003c0080)
/usr/local/go/src/encoding/json/stream.go:73 +0x16b
github.com/influxdata/telegraf/plugins/outputs/influxdb.(*httpClient).CreateDatabase(0xc000305b00, 0x317e5c0, 0xc00011c000, 0xc0001d48a1, 0x8, 0x0, 0x0)
/root/go-odbc/telegraf/plugins/outputs/influxdb/http.go:221 +0x30d
github.com/influxdata/telegraf/plugins/outputs/influxdb.(*InfluxDB).Write(0xc0000bea80, 0xc00013e240, 0x23, 0x23, 0xc00037b6d8, 0x823432)
/root/go-odbc/telegraf/plugins/outputs/influxdb/influxdb.go:225 +0x342
github.com/influxdata/telegraf/models.(*RunningOutput).write(0xc0000a6300, 0xc00013e240, 0x23, 0x23, 0x23, 0xc00056e800)
/root/go-odbc/telegraf/models/running_output.go:246 +0x99
github.com/influxdata/telegraf/models.(*RunningOutput).Write(0xc0000a6300, 0x0, 0x444cb6)
/root/go-odbc/telegraf/models/running_output.go:203 +0x1fe
github.com/influxdata/telegraf/agent.(*Agent).flushOnce.func1(0xc00056e240, 0xc00050cd80)
/root/go-odbc/telegraf/agent/agent.go:847 +0x27
created by github.com/influxdata/telegraf/agent.(*Agent).flushOnce
/root/go-odbc/telegraf/agent/agent.go:846 +0x7a

telegraf.conf is

[global_tags]
  # dc = "us-east-1" # will tag all metrics with dc=us-east-1
  # rack = "1a"
  ## Environment variables can be used as tags, and throughout the config file
  # user = "$USER"


# Configuration for telegraf agent
[agent]
  ## Default data collection interval for all inputs
  interval = "20s"
  ## Rounds collection interval to 'interval'
  ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
  round_interval = true

  ## Telegraf will send metrics to outputs in batches of at most
  ## metric_batch_size metrics.
  ## This controls the size of writes that Telegraf sends to output plugins.
  metric_batch_size = 1000

  ## Maximum number of unwritten metrics per output.  Increasing this value
  ## allows for longer periods of output downtime without dropping metrics at the
  ## cost of higher maximum memory usage.
  metric_buffer_limit = 100000

  ## Collection jitter is used to jitter the collection by a random amount.
  ## Each plugin will sleep for a random time within jitter before collecting.
  ## This can be used to avoid many plugins querying things like sysfs at the
  ## same time, which can have a measurable effect on the system.
  collection_jitter = "0s"

  ## Default flushing interval for all outputs. Maximum flush_interval will be
  ## flush_interval + flush_jitter
  flush_interval = "20s"
  ## Jitter the flush interval by a random amount. This is primarily to avoid
  ## large write spikes for users running a large number of telegraf instances.
  ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
  flush_jitter = "0s"

# Configuration for sending metrics to InfluxDB
[[outputs.influxdb]]
  ## The full HTTP or UDP URL for your InfluxDB instance.
  ##
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  # urls = ["unix:///var/run/influxdb.sock"]
  # urls = ["udp://127.0.0.1:8089"]
  # urls = ["http://127.0.0.1:8086"]

  ## The target database for metrics; will be created as needed.
  ## For UDP url endpoint database needs to be configured on server side.
  # database = "telegraf"

  ## The value of this tag will be used to determine the database.  If this
  ## tag is not set the 'database' option is used as the default.
  # database_tag = ""

  ## If true, the 'database_tag' will not be included in the written metric.
  # exclude_database_tag = false

  ## If true, no CREATE DATABASE queries will be sent.  Set to true when using
  ## Telegraf with a user without permissions to create databases or when the
  ## database already exists.
  # skip_database_creation = false

  ## Name of existing retention policy to write to.  Empty string writes to
  ## the default retention policy.  Only takes effect when using HTTP.
  # retention_policy = ""

  ## The value of this tag will be used to determine the retention policy.  If this
  ## tag is not set the 'retention_policy' option is used as the default.
  # retention_policy_tag = ""

  ## If true, the 'retention_policy_tag' will not be included in the written metric.
  # exclude_retention_policy_tag = false

  ## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
  ## Only takes effect when using HTTP.
  # write_consistency = "any"

  ## Timeout for HTTP messages.
  # timeout = "5s"

  ## HTTP Basic Auth
  # username = "telegraf"
  # password = "metricsmetricsmetricsmetrics"

  ## HTTP User-Agent
  # user_agent = "telegraf"

  ## UDP payload size is the maximum packet size to send.
  # udp_payload = "512B"

  ## Optional TLS Config for use on HTTP connections.
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

  ## HTTP Proxy override, if unset values the standard proxy environment
  ## variables are consulted to determine which proxy, if any, should be used.
  # http_proxy = "http://corporate.proxy:3128"

  ## Additional HTTP headers
  # http_headers = {"X-Special-Header" = "Special-Value"}

  ## HTTP Content-Encoding for write request body, can be set to "gzip" to
  ## compress body or "identity" to apply no encoding.
  # content_encoding = "gzip"

  ## When true, Telegraf will output unsigned integers as unsigned values,
  ## i.e.: "42u".  You will need a version of InfluxDB supporting unsigned
  ## integer values.  Enabling this option will result in field type errors if
  ## existing data has been written.
  # influx_uint_support = false
   urls = ["http://0.0.0.0:8086"] 
   database = "telegraf"
   retention_policy = ""
   precision = "s"
   timeout = "5s"
   username = "telegraf"
   password = "xxxxxx"

Metadata

Metadata

Assignees

Labels

area/influxdbbugunexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions