{"id":19865952,"url":"https://github.com/juev/prometheus-db-exporter","last_synced_at":"2025-05-02T05:32:07.261Z","repository":{"id":45323972,"uuid":"326199531","full_name":"juev/prometheus-db-exporter","owner":"juev","description":"Prometheus database exporter (Oracle, Postgres, Mysql) for using with Business metrics","archived":true,"fork":false,"pushed_at":"2023-02-18T07:56:31.000Z","size":174,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-03T17:50:02.663Z","etag":null,"topics":["database","exporter","mysql","postgresql","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":"https://denis.evsyukov.org","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/juev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-01-02T14:26:28.000Z","updated_at":"2023-07-04T19:39:51.000Z","dependencies_parsed_at":"2024-06-21T17:47:12.749Z","dependency_job_id":"40da54a6-35e2-4d51-b464-c33d8d907e33","html_url":"https://github.com/juev/prometheus-db-exporter","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juev%2Fprometheus-db-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juev%2Fprometheus-db-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juev%2Fprometheus-db-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juev%2Fprometheus-db-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juev","download_url":"https://codeload.github.com/juev/prometheus-db-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251992993,"owners_count":21677022,"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":["database","exporter","mysql","postgresql","prometheus","prometheus-exporter"],"created_at":"2024-11-12T15:24:37.752Z","updated_at":"2025-05-02T05:32:06.473Z","avatar_url":"https://github.com/juev.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# prometheus-db-exporter\n\n## Description\n\nA [Prometheus](https://prometheus.io/) exporter for DB (Oracle, Postgres, Mysql). All requests are launched in parallel processes and do not block the HTTP entry point of Prometheus.\n\n## Metrics\n\nThe following metrics are exposed currently.\n\n- db_exporter_query_value\n- db_exporter_query_duration_seconds\n- db_exporter_query_error\n- db_exporter_up\n\nExample:\n\n```bash\n# HELP db_exporter_query_duration_seconds Duration of the query in seconds\n# TYPE db_exporter_query_duration_seconds gauge\ndb_exporter_query_duration_seconds{database=\"oracle\",query=\"oracle_query\"} 0.0262601\ndb_exporter_query_duration_seconds{database=\"postgres\",query=\"postgres_query\"} 0.0109653\n# HELP db_exporter_query_error Result of last query, 1 if we have errors on running query\n# TYPE db_exporter_query_error gauge\ndb_exporter_query_error{column=\"ID\",database=\"oracle\",query=\"oracle_query\"} 0\ndb_exporter_query_error{column=\"NAME\",database=\"oracle\",query=\"oracle_query\"} 0\ndb_exporter_query_error{column=\"id\",database=\"postgres\",query=\"postgres_query\"} 0\ndb_exporter_query_error{column=\"name\",database=\"postgres\",query=\"postgres_query\"} 0\n# HELP db_exporter_query_value Value of Business metrics from Database\n# TYPE db_exporter_query_value gauge\ndb_exporter_query_value{column=\"ID\",database=\"oracle\",query=\"oracle_query\"} 1\ndb_exporter_query_value{column=\"NAME\",database=\"oracle\",query=\"oracle_query\"} 222\ndb_exporter_query_value{column=\"id\",database=\"postgres\",query=\"postgres_query\"} 1\ndb_exporter_query_value{column=\"name\",database=\"postgres\",query=\"postgres_query\"} 222\n# HELP db_exporter_up Database status\n# TYPE db_exporter_up gauge\ndb_exporter_up{database=\"oracle\"} 1\ndb_exporter_up{database=\"postgres\"} 1\n```\n\n## Configuration\n\nConfiguration stored in two separate buckets:\n\n1. Hashicorp vault (storing database auth and connection strings)\n2. Local config file (storing database id and queries), cn be used as configMap in k8s\n\n### Config file (vault)\n\n```yaml\n---\n# Array of databases\n-\n  # ID (required)\n  id: dummy_dummy\n  # Database name (required)\n  database: dummy\n  # Database driver, default value `postgres` (optional, one of: postgres, oracle or mysql)\n  driver: oracle\n  # Host, default value `127.0.0.1`, hostname for DB (optional)\n  host: 'dummy'\n  # Password (required)\n  password: 'password'\n  # Port, default value `5432` (optional)\n  port: 5432\n  # User (required)\n  user: dummy\n  # Connection String (optional)\n  connectString: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=5432))(CONNECT_DATA=(SERVICE_NAME=dummy)))\n```\n\n### Local config file\n\n```yaml\n---\n-\n  # Database name (required)\n  id: dummy\n  # Queries\n  queries:\n    -\n      # sql query (required)\n      sql: \"select 1 from table\"\n      # query name (required)\n      name: query_name\n      # interval in minutes (optional, default = 1)\n      interval: 1\n      # timeout for query in seconds (optional, default = 15)\n      timeout: 15\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuev%2Fprometheus-db-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuev%2Fprometheus-db-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuev%2Fprometheus-db-exporter/lists"}