{"id":19756054,"url":"https://github.com/debugloop/moodledb_exporter","last_synced_at":"2026-05-10T12:37:43.180Z","repository":{"id":64302487,"uuid":"257871984","full_name":"debugloop/moodledb_exporter","owner":"debugloop","description":"Minimal Prometheus Metrics for Moodle Databases","archived":false,"fork":false,"pushed_at":"2021-01-11T12:38:15.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-24T01:52:54.333Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/debugloop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-22T10:47:12.000Z","updated_at":"2021-10-20T14:21:31.000Z","dependencies_parsed_at":"2023-01-15T09:45:41.604Z","dependency_job_id":null,"html_url":"https://github.com/debugloop/moodledb_exporter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debugloop%2Fmoodledb_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debugloop%2Fmoodledb_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debugloop%2Fmoodledb_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debugloop%2Fmoodledb_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/debugloop","download_url":"https://codeload.github.com/debugloop/moodledb_exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241086615,"owners_count":19907303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-12T03:14:36.894Z","updated_at":"2026-05-10T12:37:43.142Z","avatar_url":"https://github.com/debugloop.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a very simple exporter that connects to a local MySQL database on\nscrape. It then looks for all databases matching the prefix filter which are\nsupposed to contain the typical Moodle tables. From these, a count of\nnon-deleted users is exported for each database.\n\nIt is very simple, but it works well enough. It could also serve as a basis for\nother SQL query based exporters, if necessary.\n\n| Option   | Explanation |\n|----------|-------------|\n| `web.listen-address` | same as every other exporter out there, default is port `9720` |\n| `web.telemetry-path` | same as every other exporter out there, default is `/metrics`  |\n| `mysql.prefix`       | the prefix used to filter databases, as not every database contains a Moodle. We use a `db_` prefix to our `db_customername` scheme, so thats the default |\n\nFurther, you'll have to set `DATA_SOURCE_NAME` to some [MySQL DSN\nspec](https://github.com/go-sql-driver/mysql#dsn-data-source-name). You'll\nlikely use something like this invocation (SystemD Unit Sytnax) in the end:\n\n```\nEnvironment=\"DATA_SOURCE_NAME=exporter:S0meS3curePass@(localhost:3306)/\"\nExecStart=/opt/moodledb_exporter/moodledb_exporter --mysql.prefix=\"customer_\"\n```\n\nThe output/the metrics will look like:\n\n```\n# HELP moodle_users_total Number of users found in a MoodleDB\n# TYPE moodle_users_total gauge\nmoodle_users_total{dbname=\"customer_1\"} 191\nmoodle_users_total{dbname=\"customer_2\"} 10\n...\n```\n\nAlong with the usual `promhttp` stuff.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebugloop%2Fmoodledb_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebugloop%2Fmoodledb_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebugloop%2Fmoodledb_exporter/lists"}