Prometheus的生态中,Exporter扮演了重要的角色。对于“知名”应用程序,服务器或数据库,Prometheus官方提供了足够多的Exporters。这也是Prometheus监视目标的主要方式。
当然当你需要监控的中间件或是数据库类型比较少的时候,并没有什么问题。
但是当你的监控系统扩展到一定规模的时候,你可能需要维护几百种exporter,数量甚至是到了几万个的时候,这时候你大多的精力浪费在维护和升级exporter,甚至是管理他们的部署。
如果没有深切体会,请看下面官方包括社区提供的诸多Exporters吧!
Databases
- Aerospike exporter
- ClickHouse exporter
- Consul exporter(official)
- Couchbase exporter
- CouchDB exporter
- ElasticSearch exporter
- EventStore exporter
- Memcached exporter(official)
- MongoDB exporter
- MSSQL server exporter
- MySQL router exporter
- MySQL server exporter(official)
- OpenTSDB Exporter
- Oracle DB Exporter
- PgBouncer exporter
- PostgreSQL exporter
- Presto exporter
- ProxySQL exporter
- RavenDB exporter
- Redis exporter
- RethinkDB exporter
- SQL exporter
- Tarantool metric library
- Twemproxy
Hardware related
- apcupsd exporter
- BIG-IP exporter
- Collins exporter
- Dell Hardware OMSA exporter
- IBM Z HMC exporter
- IoT Edison exporter
- IPMI exporter
- knxd exporter
- Modbus exporter
- Netgear Cable Modem Exporter
- Netgear Router exporter
- Node/system metrics exporter(official)
- NVIDIA GPU exporter
- ProSAFE exporter
- Ubiquiti UniFi exporter
Issue trackers and continuous integration
Messaging systems
- Beanstalkd exporter
- EMQ exporter
- Gearman exporter
- IBM MQ exporter
- Kafka exporter
- NATS exporter
- NSQ exporter
- Mirth Connect exporter
- MQTT blackbox exporter
- RabbitMQ exporter
- RabbitMQ Management Plugin exporter
- RocketMQ exporter
- Solace exporter
Storage
- Ceph exporter
- Ceph RADOSGW exporter
- Gluster exporter
- Hadoop HDFS FSImage exporter
- Lustre exporter
- ScaleIO exporter
HTTP
- Apache exporter
- HAProxy exporter(official)
- Nginx metric library
- Nginx VTS exporter
- Passenger exporter
- Squid exporter
- Tinyproxy exporter
- Varnish exporter
- WebDriver exporter
APIs
- AWS ECS exporter
- AWS Health exporter
- AWS SQS exporter
- Azure Health exporter
- BigBlueButton
- Cloudflare exporter
- DigitalOcean exporter
- Docker Cloud exporter
- Docker Hub exporter
- GitHub exporter
- InstaClustr exporter
- Mozilla Observatory exporter
- OpenWeatherMap exporter
- Pagespeed exporter
- Rancher exporter
- Speedtest exporter
- Tankerkönig API Exporter
Logging
此时本文的主角Telegraf 该出场了。
Telegraf
Telegraf是一种用Go语言编写的服务端采集,处理,聚合,输出metrics的组件。它由Influxdata开发,却不仅仅支持influxdb,Telegraf的输出很多,其中就包括了Prometheus。
设计目标是使插件系统的内存占用最小,以便社区中的开发人员可以轻松添加对收集指标的支持。
Telegraf是插件驱动的,具有4种不同的插件类型的概念:
- 输入插件从系统,服务或第三方API收集指标
- 处理器插件转换,修饰和过滤指标
- 聚合插件可创建聚合指标(例如,平均值,最小值,最大值,分位数等)
- 输出插件将指标写入各个目标
目前支持的采集数据源如下:
- activemq
- aerospike
- amqp_consumer(rabbitmq)
- apache
- apcupsd
- aurora
- aws cloudwatch(Amazon Cloudwatch)
- azure_storage_queue
- bcache
- beanstalkd
- bind
- bond
- burrow
- cassandra(deprecated, usejolokia2)
- ceph
- cgroup
- chrony
- cisco_telemetry_gnmi
- cisco_telemetry_mdt
- clickhouse
- cloud_pubsubGoogle Cloud Pub/Sub
- cloud_pubsub_pushGoogle Cloud Pub/Sub push endpoint
- conntrack
- consul
- couchbase
- couchdb
- cpu
- DC/OS
- diskio
- disk
- disque
- dmcache
- dns query time
- docker
- docker_log
- dovecot
- aws ecs(Amazon Elastic Container Service, Fargate)
- elasticsearch
- ethtool
- eventhub_consumer(Azure Event Hubs & Azure IoT Hub)
- exec(generic executable plugin, support JSON, influx, graphite and nagios)
- execd
- fail2ban
- fibaro
- file
- filestat
- filecount
- fireboard
- fluentd
- github
- graylog
- haproxy
- hddtemp
- httpjson(generic JSON-emitting http service plugin)
- http_listener(deprecated, renamed toinfluxdb_listener)
- http_listener_v2
- http(generic HTTP plugin, supports using input data formats)
- http_response
- icinga2
- infiniband
- influxdb
- influxdb_listener
- internal
- interrupts
- ipmi_sensor
- ipset
- iptables
- ipvs
- jenkins
- jolokia2(java, cassandra, kafka)
- jolokia(deprecated, usejolokia2)
- jti_openconfig_telemetry
- kafka_consumer
- kapacitor
- aws kinesis(Amazon Kinesis)
- kernel
- kernel_vmstat
- kibana
- kubernetes
- kube_inventory
- lanz
- leofs
- linux_sysctl_fs
- logparser(deprecated, usetail)
- logstash
- lustre2
- mailchimp
- marklogic
- mcrouter
- memcached
- mem
- mesos
- minecraft
- modbus
- mongodb
- monit
- mqtt_consumer
- multifile
- mysql
- nats_consumer
- nats
- neptune_apex
- net
- net_response
- netstat
- nginx
- nginx_plus_api
- nginx_plus
- nginx_upstream_check
- nginx_vts
- nsq_consumer
- nsq
- nstat
- ntpq
- nvidia_smi
- openldap
- openntpd
- opensmtpd
- openweathermap
- pf
- pgbouncer
- phpfpm
- phusion passenger
- ping
- postfix
- postgresql_extensible
- postgresql
- powerdns
- powerdns_recursor
- processes
- procstat
- prometheus(can be used forCaddy server)
- puppetagent
- rabbitmq
- raindrops
- redis
- rethinkdb
- riak
- salesforce
- sensors
- sflow
- smart
- snmp_legacy
- snmp
- snmp_trap
- socket_listener
- solr
- sql server(microsoft)
- stackdriver(Google Cloud Monitoring)
- statsd
- suricata
- swap
- synproxy
- syslog
- sysstat
- systemd_units
- system
- tail
- temp
- tcp_listener
- teamspeak
- tengine
- tomcat
- twemproxy
- udp_listener
- unbound
- uwsgi
- varnish
- vsphereVMware vSphere
- win_perf_counters(windows performance counters)
- win_services
- wireguard
- wireless
- x509_cert
- zfs
- zipkin
- zookeeper
基本上涵盖了主流的使用场景。
使用Telegraf的好处
- 采用server端采集方式之后,运维将节省大量的维护工作,统一升级。
- 如果是场景更加丰富的话,Telegraf对接配置中心。相比更改诸多Exporter代码,简单很多。
- Telegraf pipeline的架构,可以在processor这个环节,提前实现一下metrics的预聚合,可以很大程度上降低Prometheus的处理数据压力。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。