{"id":42622203,"url":"https://github.com/crowdworks/cyqldog","last_synced_at":"2026-01-29T04:27:04.066Z","repository":{"id":23719011,"uuid":"99523378","full_name":"crowdworks/cyqldog","owner":"crowdworks","description":"A monitoring tool for periodically executing SQLs and sending metrics to Datadog","archived":false,"fork":false,"pushed_at":"2025-07-06T23:20:49.000Z","size":164,"stargazers_count":12,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-06T23:33:24.262Z","etag":null,"topics":["datadog","go","monitoring","sql"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crowdworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-08-07T01:06:59.000Z","updated_at":"2025-07-06T23:15:40.000Z","dependencies_parsed_at":"2024-05-03T00:37:20.668Z","dependency_job_id":"adb75faa-2c92-4954-abcb-96bc72e5ae18","html_url":"https://github.com/crowdworks/cyqldog","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/crowdworks/cyqldog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdworks%2Fcyqldog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdworks%2Fcyqldog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdworks%2Fcyqldog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdworks%2Fcyqldog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crowdworks","download_url":"https://codeload.github.com/crowdworks/cyqldog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdworks%2Fcyqldog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28862154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"online","status_checked_at":"2026-01-29T02:00:06.714Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datadog","go","monitoring","sql"],"created_at":"2026-01-29T04:27:03.398Z","updated_at":"2026-01-29T04:27:04.061Z","avatar_url":"https://github.com/crowdworks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cyqldog\n[![GitHub release](http://img.shields.io/github/release/crowdworks/cyqldog.svg?style=flat-square)](https://github.com/crowdworks/cyqldog/releases)\n[![GoDoc](https://godoc.org/github.com/crowdworks/cyqldog/cyqldog?status.svg)](https://godoc.org/github.com/crowdworks/cyqldog/cyqldog)\n\nA monitoring tool for periodically executing SQLs and sending metrics to Datadog.\n\n# Features\n\n* Execute multiple SQLs at different intervals and send metrics.\n* Supported data sources are PostgreSQL (including Redshift) and MySQL.\n* Supported notifier to send metrics is Datadog (using DogStatsD).\n\n# Requirements\n## DogStatsD\n\nThe cyqldog uses [DogStatsD](https://docs.datadoghq.com/guides/dogstatsd/) to send metrics to Datadog.\n\nDogStatsD is a metrics aggregation service bundled with the Datadog Agent (datadog-agent).\nIf you want to send metrics to Datadog, you may already have installed datadog-agent including DogStatsD,\nbut if you have not installed datadog-agent,\n\n* install Datadog Agent (https://docs.datadoghq.com/agent/)\n* or you can run Datadog Agent with Docker. (https://hub.docker.com/r/datadog/agent)\n* or you can run only DogStatsD with Docker. (https://hub.docker.com/r/datadog/dogstatsd)\n\nWhen using Docker, please make sure the UDP 8125 port is open by adding the option `-p 8125:8125/udp` to the `docker run` command.\n\n# Install\nDownload the latest compiled binaries and put it anywhere in your executable path.\n\nhttps://github.com/crowdworks/cyqldog/releases\n\nor you can run with Docker. (described later)\n\n# Usage\nCreate your configuration file, and pass it to `-C` flag to run cyqldog.\n\n```bash\n$ cyqldog -C /path/to/cyqldog.yml\n```\n\n# Configuration\n\nAn example for cyqldog.yml as follows:\n\n```yaml\n# An example for cyqldog.yml\n\n# Data source is a configuration of the database to connect.\ndata_source:\n  # Driver is type of the database to connect.\n  # Currently suppoted databases are as follows:\n  #  - postgres\n  #  - mysql\n  #\n  # An example for Postgres (including Redshift)\n  #\n  driver: postgres\n  # Options is a map of options to connect.\n  # These options are passed to sql.Open.\n  # The supported options are depend on the database driver.\n  options:\n    # For all supported options, see godoc in lib/pq.\n    # https://godoc.org/github.com/lib/pq\n    #\n    # The host to connect to. Values that start with / are for unix domain sockets. (default is localhost)\n    host: db.example.com\n    # The port to bind to. (default is 5432)\n    port: 5432\n    # The user to sign in as\n    user: cyqldog\n    # The user's password\n    # Sensitive values such as a password can be read from environment variables.\n    # In this example, an environment variable named DB_PASSWORD is set.\n    password: {{ .DB_PASSWORD }}\n    # The name of the database to connect to\n    dbname: cyqldogdb\n    # Whether or not to use SSL (default is require, this is not the default for libpq)\n    # * disable - No SSL\n    # * require - Always SSL (skip verification)\n    # * verify-ca - Always SSL (verify that the certificate presented by the server was signed by a trusted CA)\n    # * verify-full - Always SSL (verify that the certification presented by the server was signed by a trusted CA and the server host name matches the one in the certificate)\n    sslmode: disable\n\n  # An example for MySQL\n  #\n  # Note that options other than host, port, user, password, dbname are passed as connection parameters.\n  # For all supported connection parameters, see README in go-sql-driver/mysql.\n  # https://github.com/go-sql-driver/mysql#parameters\n  #\n  # driver: mysql\n  # options:\n  #   host: db.example.com\n  #   port: 3306\n  #   user: cyqldog\n  #   password: {{ .DB_PASSWORD }}\n  #   dbname: cyqldogdb\n  #   charset: \"utf8\"\n  #   collation: \"utf8_general_ci\"\n\n# Notifiers are configurations of output plugins.\nnotifiers:\n  # Dogstatsd is a configuration of the dogstatsd to connect.\n  dogstatsd:\n    # Host is a hostname or IP address of the dogstatsd.\n    host: {{ .DD_HOST }}\n    # Port is a port number of the dogstatsd.\n    port: 8125\n    # Namespace to prepend to all statsd calls\n    namespace: playground.cyqldog\n    # Tags are global tags to be added to every statsd call\n    tags:\n      - \"env:local\"\n      - \"source:db.example.com\"\n\n# Rules are a list of rules to monitor.\nrules:\n  # Name of the rule.\n  # The metic name sent to the dogstatsd is:\n  #   Dogstatsd.Namespace + Rule.Name + Rule.ValueCols[*]\n  - name: test1\n    # Interval of the monitoring.\n    # Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n    interval: 5s\n    # Query to the database.\n    query: \"SELECT COUNT(*) AS count FROM table1\"\n    # Notifier is a name of notifier to send metrics.\n    notifier: dogstatsd\n    # ValueCols is a list of names of the columns used as metric values.\n    # In this example, the following metrics are sent.\n    # * playground.cyqldog.test1.count (with tags [\"env:local\", \"source:db.example.com\"])\n    value_cols:\n      - count\n  - name: test2\n    interval: 10s\n    query: \"SELECT tag1, val1, tag2, val2 FROM table1\"\n    notifier: dogstatsd\n    # TagCols is a list of names of the columns used as metric tags.\n    # In this example, the following metrics are sent.\n    # * playground.cyqldog.test2.value1 (with tags [\"env:local\", \"source:db.example.com\", \"tag1:(value of column tag1)\", \"tag2:(value of column tag2)\"])\n    # * playground.cyqldog.test2.value2 (with tags [\"env:local\", \"source:db.example.com\", \"tag1:(value of column tag1)\", \"tag2:(value of column tag2)\"])\n    tag_cols:\n      - tag1\n      - tag2\n    value_cols:\n      - val1\n      - val2\n```\n\n# Run with Docker\nYou can run cyqldog with Docker.\n\nStart test database and dogstatsd with docker compose for demo.\n\n## Postgres\n\n```\n$ docker compose up -d\n\n$ docker run -it --rm \\\n    -v $(pwd)/cyqldog/test-fixtures/postgres:/app/config \\\n    -e PGPASSWORD=password \\\n    postgres:17.6-alpine \\\n    psql -h host.docker.internal -U cyqldog -d cyqldogdb -f /app/config/setup_dev.sql\n```\n\nThe Docker images are available in the GitHub Container Registry.\n\nhttps://github.com/crowdworks/cyqldog/pkgs/container/cyqldog\n\nMount a sample configuration file, set environment variables, and run cyqldog.\n\n```\n$ docker run -it --rm \\\n    -v $(pwd)/cyqldog/test-fixtures/postgres:/app/config \\\n    -e DB_HOST=host.docker.internal \\\n    -e DB_PASSWORD=password \\\n    -e DD_HOST=host.docker.internal \\\n    -e DD_API_KEY=[YOUR_DD_API_KEY] \\\n    ghcr.io/crowdworks/cyqldog:latest -C config/cyqldog.yml\n```\n\n## MySQL\n\n```\n$ docker compose up -d\n\n$ docker run -it --rm \\\n    -v $(pwd)/cyqldog/test-fixtures/mysql:/app/config \\\n    mysql:8.0 \\\n    /bin/bash -c \"mysql -h host.docker.internal -u cyqldog -ppassword cyqldogdb \u003c /app/config/setup_dev.sql\"\n```\n\nThe Docker images are available in the GitHub Container Registry.\n\nhttps://github.com/crowdworks/cyqldog/pkgs/container/cyqldog\n\nMount a sample configuration file, set environment variables, and run cyqldog.\n\n```\n$ docker run -it --rm \\\n    -v $(pwd)/cyqldog/test-fixtures/mysql:/app/config \\\n    -e DB_HOST \\\n    -e DB_PASSWORD \\\n    -e DD_HOST \\\n    -e DD_API_KEY \\\n    ghcr.io/crowdworks/cyqldog:latest -C config/cyqldog.yml\n```\n\n# Contributions\n\nAny feedback and contributions are welcome. Feel free to open an issue and submit a pull request.\n\n# License\n\nThe cyqldog is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdworks%2Fcyqldog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdworks%2Fcyqldog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdworks%2Fcyqldog/lists"}