https://github.com/debeando/agent-mysql
Collector for MySQL metrics
https://github.com/debeando/agent-mysql
agent golang mysql observability
Last synced: 5 months ago
JSON representation
Collector for MySQL metrics
- Host: GitHub
- URL: https://github.com/debeando/agent-mysql
- Owner: debeando
- License: apache-2.0
- Created: 2024-10-25T19:08:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-28T23:25:02.000Z (over 1 year ago)
- Last Synced: 2025-03-25T06:34:13.499Z (over 1 year ago)
- Topics: agent, golang, mysql, observability
- Language: Go
- Homepage:
- Size: 1.76 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# DeBeAndo Agent for MySQL
Database monitoring tool designed for small environments, adapted for Kubernetes and send metrics to InfluxDB.
## Image Description
This image is maintained by DeBeAndo and will be updated regularly on best-effort basis. The image is based on Alpine Linux and only contains the build result of this repository.
## Run
To run container:
```bash
docker run \
--name debeando-agent-mysql \
--env DEBUG=true \
--env INTERVAL=10 \
--env INFLUXDB_HOST="http://com-env-influxdb-observability-node01.aws.com" \
--env INFLUXDB_TOKEN="abc123cde456==" \
--env MYSQL_HOST="com-env-mysql-stack-node01.aws.com" \
--env MYSQL_USER="monitor" \
--env MYSQL_PASSWORD="" \
--env SERVER="com-env-mysql-stack-node01" \
debeando/agent-mysql
```
## MySQL Config
Create a `monitor` user to allow access to agent.
```sql
CREATE USER monitor@'%' IDENTIFIED BY '';
ALTER USER monitor@'%' WITH MAX_USER_CONNECTIONS 5;
GRANT REPLICATION CLIENT ON *.* TO monitor@'%';
GRANT PROCESS ON *.* TO monitor@'%';
GRANT SELECT ON *.* TO monitor@'%';
```
Please, change default password ``.
## Environment Variables
When you start the `agent-mysql` image, you can adjust the configuration of the agent instance by passing one or more environment variables on the docker run command line.
- **DEBUG:** Enable debug mode with `true` value, by default value is `false`.
- **DISABLE:** Disable specific metric, list separated by comma, by default is empty.
- **INTERVAL:** Interval time in second, by default value is `10`.
- **INFLUXDB_HOST:** The HTTP hostname or IP address.
- **INFLUXDB_TOKEN:** The authentication token for connecting to the InfluxDB instance.
- **MYSQL_HOST:** The hostname or IP address of the MySQL server to be monitored.
- **MYSQL_USER:** The MySQL username to connect with.
- **MYSQL_PASSWORD:** The password associated with the specified MySQL user.
- **SERVER:** The name of running the agent.