prometheus-mysqld-exporter(1)

πŸ’– prometheus-mysqld-exporter πŸ’–

okay bestie, come sit with me, we're doing the prometheus-mysqld-exporter(1) manual page, version 0.19.0. this is the Prometheus exporter for MySQL/MariaDB and it's lowkey iconic. it's the little guy that stares into your database and turns what it sees into metrics your Prometheus can slurp up. it's giving ✨observability✨, and we're gonna go through every single flag together. no skipping. i love you too much to skip.


✨ NAME ✨

prometheus-mysqld-exporter β€” Prometheus exporter for MySQL/MariaDB. that's her. that's the whole name. she's a monitor, she's a bestie, she's a whole vibe 🌸


✨ SYNOPSIS ✨

prometheus-mysqld-exporter [<flags>]

that's it. that's the whole call. you run her, you hand her <flags>, she does her thing. no positional args, no drama, no cap 🫢


✨ DESCRIPTION ✨

okay so heads up: on this page the DESCRIPTION section is literally empty. nothing. crickets. a void. the flags below are doing all the talking and honestly? they ate πŸ’…


✨ OPTIONS ✨

here's the full rundown. every flag, every default, exactly as she is. buckle up, there's a lot, and i'm obsessed with every one of them πŸŽ€

πŸ›Ÿ the basics

  • -h, --help β€” shows the context-sensitive help. and if you're greedy for more, --help-long and --help-man exist too. help for days.
  • --version β€” shows the application version. short, sweet, slays.

πŸ’“ heartbeat collectin'

  • --collect.heartbeat.database β€” the database you're pulling heartbeat data from.
  • --collect.heartbeat.table β€” the table you're pulling heartbeat data from.
  • --collect.heartbeat.utc β€” use UTC for the timestamps of the current server. the way this works: pt-heartbeat gets called with --utc.
  • --collect.heartbeat β€” collect from heartbeat. (yes she has both a group of heartbeat tweaks and --collect.heartbeat herself. both real. both iconic.)

🧡 processlist behaviour

  • --collect.info_schema.processlist.min_time=0 β€” how long a thread has to sit in a state before it gets counted. default is 0, so bestie is counting everything immediately.
  • --collect.info_schema.processlist.processes_by_user β€” turn on collecting the number of processes broken down by user.
  • --collect.info_schema.processlist.processes_by_host β€” turn on collecting the number of processes broken down by host.
  • --collect.info_schema.processlist β€” collect the current thread state counts from information_schema.processlist.

πŸ“Š info_schema table stuff

  • --collect.info_schema.tables.databases β€” the list of databases to grab table stats for, or '*' for all of them. go big or go home.
  • --collect.mysql.user.privileges β€” turn on collecting user privileges from mysql.user.
  • --collect.mysql.user β€” collect data from mysql.user.
  • --collect.info_schema.tables β€” collect metrics from information_schema.tables.

πŸš€ performance_schema: events statements

  • --collect.perf_schema.eventsstatements.limit=250 β€” caps how many event statement digests you get back, ordered by response time. default 250.
  • --collect.perf_schema.eventsstatements.timelimit=86400 β€” caps how old the 'last_seen' event statements are allowed to be, in seconds. default 86400.
  • --collect.perf_schema.eventsstatements.digest_text_limit=120 β€” the max length of the normalized statement text. default 120.
  • --collect.perf_schema.eventsstatements.exclude_schemas= β€” an additional schema name to exclude. heads up, it always excludes mysql, performance_schema and information_schema no matter what. it's repeatable, so you can stack them.
  • --collect.perf_schema.eventsstatements β€” collect metrics from performance_schema.events_statements_summary_by_digest.
  • --collect.perf_schema.eventsstatementssum β€” collect metrics of grand sums from performance_schema.events_statements_summary_by_digest.

πŸ—‚οΈ performance_schema: files & memory

  • --collect.perf_schema.file_instances.filter β€” a RegEx file_name filter for performance_schema.file_summary_by_instance.
  • --collect.perf_schema.file_instances.remove_prefix β€” strip the path prefix in performance_schema.file_summary_by_instance.
  • --collect.perf_schema.memory_events.remove_prefix β€” strip the instrument prefix in performance_schema.memory_summary_global_by_event_name.
  • --collect.perf_schema.file_events β€” collect metrics from performance_schema.file_summary_by_event_name.
  • --collect.perf_schema.file_instances β€” collect metrics from performance_schema.file_summary_by_instance.
  • --collect.perf_schema.memory_events β€” collect metrics from performance_schema.memory_summary_global_by_event_name.

🌐 the web / server side

  • --web.telemetry-path β€” the path under which metrics get exposed.
  • --timeout-offset=0.25 β€” offset to subtract from the timeout, in seconds. default 0.25.
  • --web.systemd-socket β€” use systemd socket activation listeners instead of port listeners. Linux only, bestie. 🐧
  • --web.listen-address=:9104 β€” the addresses where metrics and the web interface live. repeatable for multiple addresses. examples: :9100 or [::1]:9100 for http, vsock://:9100 for vsock. default is :9104.
  • --web.config.file β€” path to a config file that can enable TLS or authentication. see: https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md

πŸ” connecting to MySQL

  • --config.my-cnf β€” path to the .my.cnf file to read your MySQL credentials from.
  • --mysqld.address β€” address to use for connecting to MySQL.
  • --mysqld.username=MYSQLD.USERNAME β€” hostname to use for connecting to MySQL. (yes, i know, that's what the page says. i'm just the messenger 🫣)
  • --tls.insecure-skip-verify β€” ignore certificate and server verification when you're using a tls connection.
⚠️ note bestie: that one turns off verification. it's literally in the name, insecure. know what you're doing before you reach for it.

πŸ”’ connection behaviour & lock stuff

  • --exporter.lock_wait_timeout=2 β€” sets a lock_wait_timeout (in seconds) on the connection so you don't get stuck in long metadata locking. default 2.
  • --exporter.enable_lock_wait_timeout β€” enables that lock_wait_timeout MySQL connection parameter.
  • --exporter.log_slow_filter β€” adds a log_slow_filter so scrapes don't get logged as slow queries. NOTE: not supported by Oracle MySQL. just Oracle MySQL. don't @ me.

🌾 the big collector switchboard

this whole block is you picking which collectors are awake. each one is its own little vibe:

  • --collect.auto_increment.columns β€” collect auto_increment columns and max values from information_schema.
  • --collect.binlog_size β€” collect the current size of all registered binlog files.
  • --collect.engine_innodb_status β€” collect from SHOW ENGINE INNODB STATUS.
  • --collect.engine_tokudb_status β€” collect from SHOW ENGINE TOKUDB STATUS.
  • --collect.global_status β€” collect from SHOW GLOBAL STATUS.
  • --collect.global_variables β€” collect from SHOW GLOBAL VARIABLES.
  • --collect.info_schema.clientstats β€” if you're running with userstat=1, flip this to true to collect client statistics.
  • --collect.info_schema.innodb_cmp β€” collect metrics from information_schema.innodb_cmp.
  • --collect.info_schema.innodb_cmpmem β€” collect metrics from information_schema.innodb_cmpmem.
  • --collect.info_schema.innodb_metrics β€” collect metrics from information_schema.innodb_metrics.
  • --collect.info_schema.innodb_tablespaces β€” collect metrics from information_schema.innodb_sys_tablespaces.
  • --collect.info_schema.query_response_time β€” collect the query response time distribution, but only if query_response_time_stats is ON.
  • --collect.info_schema.replica_host β€” collect metrics from information_schema.replica_host_status.
  • --collect.info_schema.rocksdb_perf_context β€” collect metrics from information_schema.ROCKSDB_PERF_CONTEXT.
  • --collect.info_schema.schemastats β€” if you're running with userstat=1, flip this to true to collect schema statistics.
  • --collect.info_schema.tablestats β€” if you're running with userstat=1, flip this to true to collect table statistics.
  • --collect.info_schema.userstats β€” if you're running with userstat=1, flip this to true to collect user statistics.
  • --collect.perf_schema.eventswaits β€” collect metrics from performance_schema.events_waits_summary_global_by_event_name.
  • --collect.perf_schema.indexiowaits β€” collect metrics from performance_schema.table_io_waits_summary_by_index_usage.
  • --collect.perf_schema.replication_applier_status_by_worker β€” collect metrics from performance_schema.replication_applier_status_by_worker.
  • --collect.perf_schema.replication_group_member_stats β€” collect metrics from performance_schema.replication_group_member_stats.
  • --collect.perf_schema.replication_group_members β€” collect metrics from performance_schema.replication_group_members.
  • --collect.perf_schema.tableiowaits β€” collect metrics from performance_schema.table_io_waits_summary_by_table.
  • --collect.perf_schema.tablelocks β€” collect metrics from performance_schema.table_lock_waits_summary_by_table.
  • --collect.slave_hosts β€” scrape information from 'SHOW SLAVE HOSTS'.
  • --collect.slave_status β€” collect from SHOW SLAVE STATUS.
  • --collect.sys.user_summary β€” collect per user metrics from sys.x$user_summary. details live here: https://dev.mysql.com/doc/refman/5.7/en/sys-user-summary.html

πŸ“ logging

  • --log.level=info β€” only log messages at this severity or above. one of: [debug, info, warn, error]. default is info.
  • --log.format=logfmt β€” the output format of log messages. one of: [logfmt, json]. default is logfmt.

🌈 and that's the whole page 🌈

okay so that's literally every flag, nothing left out, we did it together and you ate. 🫢 reminder: --collect.perf_schema.eventsstatements.exclude_schemas= is repeatable, --web.listen-address is repeatable, and mysql, performance_schema and information_schema are always excluded no matter how cute you ask. iykyk πŸ’œ

that's the tea, bestie β€” this page is mysqld_exporter, served up as prometheus-mysqld-exporter(1), and the footer keeps the version and the date stamp all tucked in at the bottom like a little bow πŸŽ€ go forth and export your metrics, you main character. πŸ’…βœ¨πŸ”₯

πŸ“¦ where this page comes from