search
数据采集 采集源配置 InfluxDB 监控指标采集

InfluxDB 监控指标采集

简介

本采集器用来采集给定 InfluxDB 服务器的指标数据。

前置条件

  • 已安装 DataKit(DataKit 安装文档
  • InfluxDB 服务器
    • 运行 influxd version: InfluxDB v1.7.9 (git: 1.7 23bc63d43a8dc05f53afa46e3526ebb5578f3d88)

配置

进入 DataKit 安装目录下的 conf.d/db 目录,复制 influxdb.conf.sample 并命名为 influxdb.conf。示例如下:

[[inputs.influxdb]]

  ## Works with InfluxDB debug endpoints out of the box,
  ## but other services can use this format too.
  ## See the influxdb plugin's README for more details.

  ## Multiple URLs from which to read InfluxDB-formatted JSON
  ## Default is "http://localhost:8086/debug/vars".
  urls = [
    "http://localhost:8086/debug/vars"
  ]

  ## Username and password to send using HTTP Basic Authentication.
  # username = ""
  # password = ""

  ## Optional TLS Config
  # 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 request & header timeout
  timeout = "5s"

配置好后,重启 DataKit 即可生效。

标签

  • 指标集:influxdb_database

    • bind
    • url
  • 指标集:influxdb_database

    • database
    • url
  • 指标集: influxdb_cq, influxdb_memstats, influxdb_queryExecutor, influxdb_runtime, influxdb_subscriber, influxdb_write

    • url
  • 指标集:influxdb_shard, influxdb_tsm1_cache, influxdb_tsm1_engine, influxdb_tsm1_filestore, influxdb_tsm1_wal

    • database
    • url
    • engine
    • indexType
    • path
    • retentionPolicy
    • walPath

指标

  • 指标集:influxdb

    • n_shards
  • 指标集: influxdb_database

    • numMeasurements
    • numSeries
  • 指标集: influxdb_httpd

    • authFail
    • clientError
    • fluxQueryReq
    • fluxQueryReqDurationNs
    • pingReq
    • pointsWrittenDropped
    • pointsWrittenFail
    • pointsWrittenOK
    • promReadReq
    • promWriteReq
    • queryReq
    • queryReqDurationNs
    • queryRespBytes
    • recoveredPanics
    • req
    • reqActive
    • reqDurationNs
    • serverError
    • statusReq
    • writeReq
    • writeReqActive
    • writeReqBytes
    • writeReqDurationNs
  • 指标集: influxdb_cq

    • queryFail
    • queryOk
  • 指标集: influxdb_measurement

  • 指标集 : influxdb_memstats

    • alloc
    • buck_hash_sys
    • frees
    • gc_cpu_fraction
    • gc_sys
    • heap_alloc
    • heap_idle
    • heap_inuse
    • heap_objects
    • heap_released
    • heap_sys
    • last_gc
    • lookups
    • mallocs
    • mcache_inuse
    • mcache_sys
    • mspan_inuse
    • mspan_sys
    • next_gc
    • num_gc
    • other_sys
    • pause_ns
    • pause_total_ns
    • stack_inuse
    • stack_sys
    • sys
    • total_alloc
  • 指标集: influxdb_queryExecutor

    • queriesActive
    • queriesExecuted
    • queriesFinished
    • queryDurationNs
    • recoveredPanics
  • 指标集: influxdb_runtime

    • Alloc
    • Frees
    • HeapAlloc
    • HeapIdle
    • HeapInUse
    • HeapObjects
    • HeapReleased
    • HeapSys
    • Lookups
    • Mallocs
    • NumGC
    • NumGoroutine
    • PauseTotalNs
    • Sys
    • TotalAlloc
  • 指标集: influxdb_shard

    • diskBytes
    • fieldsCreate
    • seriesCreate
    • writeBytes
    • writePointsDropped
    • writePointsErr
    • writePointsOk
    • writeReq
    • writeReqErr
    • writeReqOk
  • 指标集: influxdb_subscriber

    • createFailures
    • pointsWritten
    • writeFailures
  • 指标集: influxdb_tsm1_cache

    • WALCompactionTimeMs
    • cacheAgeMs
    • cachedBytes
    • diskBytes
    • memBytes
    • snapshotCount
    • writeDropped
    • writeErr
    • writeOk
  • 指标集: influxdb_tsm1_engine

    • cacheCompactionDuration
    • cacheCompactionErr
    • cacheCompactions
    • cacheCompactionsActive
    • tsmFullCompactionDuration
    • tsmFullCompactionErr
    • tsmFullCompactionQueue
    • tsmFullCompactions
    • tsmFullCompactionsActive
    • tsmLevel1CompactionDuration
    • tsmLevel1CompactionErr
    • tsmLevel1CompactionQueue
    • tsmLevel1Compactions
    • tsmLevel1CompactionsActive
    • tsmLevel2CompactionDuration
    • tsmLevel2CompactionErr
    • tsmLevel2CompactionQueue
    • tsmLevel2Compactions
    • tsmLevel2CompactionsActive
    • tsmLevel3CompactionDuration
    • tsmLevel3CompactionErr
    • tsmLevel3CompactionErr
    • tsmLevel3Compactions
    • tsmLevel3CompactionsActive
    • tsmOptimizeCompactionDuration
    • tsmOptimizeCompactionErr
    • tsmOptimizeCompactionQueue
    • tsmOptimizeCompactions
    • tsmOptimizeCompactionsActive
  • 指标集: influxdb_tsm1_filestore

    • diskBytes
    • numFiles
  • 指标集: influxdb_tsm1_wal

    • currentSegmentDiskBytes
    • oldSegmentsDiskBytes
    • writeErr
    • writeOk
  • 指标集: influxdb_write

    • pointReq
    • pointReqLocal
    • req
    • subWriteDrop
    • subWriteOk
    • writeDrop
    • writeError
    • writeOk
    • writeTimeout

示例数据

influxdb_database,database=_internal,host=tyrion,url=http://localhost:8086/debug/vars numMeasurements=10,numSeries=29 1463590500247354636
influxdb_httpd,bind=:8086,host=tyrion,url=http://localhost:8086/debug/vars req=7,reqActive=1,reqDurationNs=14227734 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=database,url=http://localhost:8086/debug/vars numSeries=1 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=httpd,url=http://localhost:8086/debug/vars numSeries=1 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=measurement,url=http://localhost:8086/debug/vars numSeries=10 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=runtime,url=http://localhost:8086/debug/vars numSeries=1 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=shard,url=http://localhost:8086/debug/vars numSeries=4 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=subscriber,url=http://localhost:8086/debug/vars numSeries=1 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=tsm1_cache,url=http://localhost:8086/debug/vars numSeries=4 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=tsm1_filestore,url=http://localhost:8086/debug/vars numSeries=2 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=tsm1_wal,url=http://localhost:8086/debug/vars numSeries=4 1463590500247354636
influxdb_measurement,database=_internal,host=tyrion,measurement=write,url=http://localhost:8086/debug/vars numSeries=1 1463590500247354636
influxdb_memstats,host=tyrion,url=http://localhost:8086/debug/vars alloc=7642384i,buck_hash_sys=1463471i,frees=1169558i,gc_sys=653312i,gc_cpu_fraction=0.00003825652361068311,heap_alloc=7642384i,heap_idle=9912320i,heap_inuse=9125888i,heap_objects=48276i,heap_released=0i,heap_sys=19038208i,last_gc=1463590480877651621i,lookups=90i,mallocs=1217834i,mcache_inuse=4800i,mcache_sys=16384i,mspan_inuse=70920i,mspan_sys=81920i,next_gc=11679787i,num_gc=141i,other_sys=1244233i,pause_total_ns=24034027i,stack_inuse=884736i,stack_sys=884736i,sys=23382264i,total_alloc=679012200i 1463590500277918755
influxdb_shard,database=_internal,engine=tsm1,host=tyrion,id=4,path=/Users/sparrc/.influxdb/data/_internal/monitor/4,retentionPolicy=monitor,url=http://localhost:8086/debug/vars fieldsCreate=65,seriesCreate=26,writePointsOk=7274,writeReq=280 1463590500247354636
influxdb_subscriber,host=tyrion,url=http://localhost:8086/debug/vars pointsWritten=7274 1463590500247354636
influxdb_tsm1_cache,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/data/_internal/monitor/1,retentionPolicy=monitor,url=http://localhost:8086/debug/vars WALCompactionTimeMs=0,cacheAgeMs=2809192,cachedBytes=0,diskBytes=0,memBytes=0,snapshotCount=0 1463590500247354636
influxdb_tsm1_cache,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/data/_internal/monitor/2,retentionPolicy=monitor,url=http://localhost:8086/debug/vars WALCompactionTimeMs=0,cacheAgeMs=2809184,cachedBytes=0,diskBytes=0,memBytes=0,snapshotCount=0 1463590500247354636
influxdb_tsm1_cache,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/data/_internal/monitor/3,retentionPolicy=monitor,url=http://localhost:8086/debug/vars WALCompactionTimeMs=0,cacheAgeMs=2809180,cachedBytes=0,diskBytes=0,memBytes=42368,snapshotCount=0 1463590500247354636
influxdb_tsm1_cache,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/data/_internal/monitor/4,retentionPolicy=monitor,url=http://localhost:8086/debug/vars WALCompactionTimeMs=0,cacheAgeMs=2799155,cachedBytes=0,diskBytes=0,memBytes=331216,snapshotCount=0 1463590500247354636
influxdb_tsm1_filestore,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/data/_internal/monitor/1,retentionPolicy=monitor,url=http://localhost:8086/debug/vars diskBytes=37892 1463590500247354636
influxdb_tsm1_filestore,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/data/_internal/monitor/2,retentionPolicy=monitor,url=http://localhost:8086/debug/vars diskBytes=52907 1463590500247354636
influxdb_tsm1_wal,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/wal/_internal/monitor/1,retentionPolicy=monitor,url=http://localhost:8086/debug/vars currentSegmentDiskBytes=0,oldSegmentsDiskBytes=0 1463590500247354636
influxdb_tsm1_wal,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/wal/_internal/monitor/2,retentionPolicy=monitor,url=http://localhost:8086/debug/vars currentSegmentDiskBytes=0,oldSegmentsDiskBytes=0 1463590500247354636
influxdb_tsm1_wal,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/wal/_internal/monitor/3,retentionPolicy=monitor,url=http://localhost:8086/debug/vars currentSegmentDiskBytes=0,oldSegmentsDiskBytes=65651 1463590500247354636
influxdb_tsm1_wal,database=_internal,host=tyrion,path=/Users/sparrc/.influxdb/wal/_internal/monitor/4,retentionPolicy=monitor,url=http://localhost:8086/debug/vars currentSegmentDiskBytes=495687,oldSegmentsDiskBytes=0 1463590500247354636
influxdb_write,host=tyrion,url=http://localhost:8086/debug/vars pointReq=7274,pointReqLocal=7274,req=280,subWriteOk=280,writeOk=280 1463590500247354636
influxdb_shard,host=tyrion n_shards=4i 1463590500247354636