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-longand--help-manexist 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-heartbeatgets called with--utc.--collect.heartbeatβ collect from heartbeat. (yes she has both a group of heartbeat tweaks and--collect.heartbeatherself. 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 is0, 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 frominformation_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 frommysql.user.--collect.mysql.userβ collect data frommysql.user.--collect.info_schema.tablesβ collect metrics frominformation_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. default250.--collect.perf_schema.eventsstatements.timelimit=86400β caps how old the'last_seen'event statements are allowed to be, in seconds. default86400.--collect.perf_schema.eventsstatements.digest_text_limit=120β the max length of the normalized statement text. default120.--collect.perf_schema.eventsstatements.exclude_schemas=β an additional schema name to exclude. heads up, it always excludesmysql,performance_schemaandinformation_schemano matter what. it's repeatable, so you can stack them.--collect.perf_schema.eventsstatementsβ collect metrics fromperformance_schema.events_statements_summary_by_digest.--collect.perf_schema.eventsstatementssumβ collect metrics of grand sums fromperformance_schema.events_statements_summary_by_digest.
ποΈ performance_schema: files & memory
--collect.perf_schema.file_instances.filterβ a RegExfile_namefilter forperformance_schema.file_summary_by_instance.--collect.perf_schema.file_instances.remove_prefixβ strip the path prefix inperformance_schema.file_summary_by_instance.--collect.perf_schema.memory_events.remove_prefixβ strip the instrument prefix inperformance_schema.memory_summary_global_by_event_name.--collect.perf_schema.file_eventsβ collect metrics fromperformance_schema.file_summary_by_event_name.--collect.perf_schema.file_instancesβ collect metrics fromperformance_schema.file_summary_by_instance.--collect.perf_schema.memory_eventsβ collect metrics fromperformance_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. default0.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::9100or[::1]:9100for http,vsock://:9100for 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.cnffile 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 alock_wait_timeout(in seconds) on the connection so you don't get stuck in long metadata locking. default2.--exporter.enable_lock_wait_timeoutβ enables thatlock_wait_timeoutMySQL connection parameter.--exporter.log_slow_filterβ adds alog_slow_filterso 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 frominformation_schema.--collect.binlog_sizeβ collect the current size of all registered binlog files.--collect.engine_innodb_statusβ collect fromSHOW ENGINE INNODB STATUS.--collect.engine_tokudb_statusβ collect fromSHOW ENGINE TOKUDB STATUS.--collect.global_statusβ collect fromSHOW GLOBAL STATUS.--collect.global_variablesβ collect fromSHOW GLOBAL VARIABLES.--collect.info_schema.clientstatsβ if you're running withuserstat=1, flip this to true to collect client statistics.--collect.info_schema.innodb_cmpβ collect metrics frominformation_schema.innodb_cmp.--collect.info_schema.innodb_cmpmemβ collect metrics frominformation_schema.innodb_cmpmem.--collect.info_schema.innodb_metricsβ collect metrics frominformation_schema.innodb_metrics.--collect.info_schema.innodb_tablespacesβ collect metrics frominformation_schema.innodb_sys_tablespaces.--collect.info_schema.query_response_timeβ collect the query response time distribution, but only ifquery_response_time_statsisON.--collect.info_schema.replica_hostβ collect metrics frominformation_schema.replica_host_status.--collect.info_schema.rocksdb_perf_contextβ collect metrics frominformation_schema.ROCKSDB_PERF_CONTEXT.--collect.info_schema.schemastatsβ if you're running withuserstat=1, flip this to true to collect schema statistics.--collect.info_schema.tablestatsβ if you're running withuserstat=1, flip this to true to collect table statistics.--collect.info_schema.userstatsβ if you're running withuserstat=1, flip this to true to collect user statistics.--collect.perf_schema.eventswaitsβ collect metrics fromperformance_schema.events_waits_summary_global_by_event_name.--collect.perf_schema.indexiowaitsβ collect metrics fromperformance_schema.table_io_waits_summary_by_index_usage.--collect.perf_schema.replication_applier_status_by_workerβ collect metrics fromperformance_schema.replication_applier_status_by_worker.--collect.perf_schema.replication_group_member_statsβ collect metrics fromperformance_schema.replication_group_member_stats.--collect.perf_schema.replication_group_membersβ collect metrics fromperformance_schema.replication_group_members.--collect.perf_schema.tableiowaitsβ collect metrics fromperformance_schema.table_io_waits_summary_by_table.--collect.perf_schema.tablelocksβ collect metrics fromperformance_schema.table_lock_waits_summary_by_table.--collect.slave_hostsβ scrape information from'SHOW SLAVE HOSTS'.--collect.slave_statusβ collect fromSHOW SLAVE STATUS.--collect.sys.user_summaryβ collect per user metrics fromsys.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 isinfo.--log.format=logfmtβ the output format of log messages. one of:[logfmt, json]. default islogfmt.
π 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
- ubuntu stonking: prometheus-mysqld-exporter 0.19.0-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms