{"id":28916273,"url":"https://github.com/rickard-von-essen/prometheus-memorystore-sd","last_synced_at":"2026-06-17T04:01:25.329Z","repository":{"id":295029545,"uuid":"988851157","full_name":"rickard-von-essen/prometheus-memorystore-sd","owner":"rickard-von-essen","description":"Prometheus Service Discovery for GCP Memorystore ","archived":false,"fork":false,"pushed_at":"2026-06-09T02:46:50.000Z","size":621,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-09T04:26:46.117Z","etag":null,"topics":["gcp","gcp-memorystore","memcached","memorystore","prometheus","service-discovery"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rickard-von-essen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-05-23T07:08:30.000Z","updated_at":"2026-06-09T02:46:07.000Z","dependencies_parsed_at":"2025-12-31T04:04:10.143Z","dependency_job_id":null,"html_url":"https://github.com/rickard-von-essen/prometheus-memorystore-sd","commit_stats":null,"previous_names":["rickard-von-essen/prometheus-memorystore-sd"],"tags_count":100,"template":false,"template_full_name":null,"purl":"pkg:github/rickard-von-essen/prometheus-memorystore-sd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickard-von-essen%2Fprometheus-memorystore-sd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickard-von-essen%2Fprometheus-memorystore-sd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickard-von-essen%2Fprometheus-memorystore-sd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickard-von-essen%2Fprometheus-memorystore-sd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rickard-von-essen","download_url":"https://codeload.github.com/rickard-von-essen/prometheus-memorystore-sd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickard-von-essen%2Fprometheus-memorystore-sd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34433086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"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":["gcp","gcp-memorystore","memcached","memorystore","prometheus","service-discovery"],"created_at":"2025-06-21T23:30:36.094Z","updated_at":"2026-06-17T04:01:25.302Z","avatar_url":"https://github.com/rickard-von-essen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus GCP Memorystore Service Discovery\n\n[![release](https://img.shields.io/github/v/release/rickard-von-essen/prometheus-memorystore-sd?sort=semver)](https://github.com/rickard-von-essen/prometheus-memorystore-sd/releases)\n[![build](https://github.com/rickard-von-essen/prometheus-memorystore-sd/actions/workflows/build.yml/badge.svg)](https://github.com/rickard-von-essen/prometheus-memorystore-sd/actions/workflows/build.yml)\n[![go report](https://goreportcard.com/badge/github.com/rickard-von-essen/prometheus-memorystore-sd)](https://goreportcard.com/report/github.com/rickard-von-essen/prometheus-memorystore-sd)\n\nMemorystore SD allows retrieving scrape targets from [GCP Memorystore](https://cloud.google.com/memorystore) for [Prometheus](https://prometheus.io/). **No address is defined by default**, it must be configured with relabeling and requires a [third-party exporter](https://prometheus.io/docs/instrumenting/exporters/#third-party-exporters) supporting the [multi-target pattern](https://prometheus.io/docs/guides/multi-target-exporter/).\nThis is a rewrite of the [Prometheus AWS ElastiCache Service Discovery (prometheus-elasticache-sd)](https://github.com/maxbrunet/prometheus-elasticache-sd).\n\n## Configuration\n\nHelp on flags:\n\n```\n./prometheus-memorystore-sd --help\n```\n\nThe following meta labels are available on targets during [relabeling](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config):\n\n* `__meta_memorystore_memcached_instance_id`: The instance ID.\n* `__meta_memorystore_memcached_instance_state`: The current stat of the instance. See `State` in the [REST API reference](https://cloud.google.com/memorystore/docs/memcached/reference/rest/v1/projects.locations.instances#State_1) for possible values.\n* `__meta_memorystore_memcached_location_id`: The _location_ where the instance is running. Location is a.k.a. _region_.\n* `__meta_memorystore_memcached_project_id`: The GCP project ID where the instance is running.\n* `__meta_memorystore_memcached_version`: The current version of the instance. See `MemcacheVersion` in the [REST API reference](https://cloud.google.com/memorystore/docs/memcached/reference/rest/v1/projects.locations.instances#MemcacheVersion) for possible values.\n* `__meta_memorystore_memcached_full_version`: The full vesion of the instance, e.g. `memcached-1.5.16`.\n* `__meta_memorystore_memcached_label_\u003clabelKey\u003e`: The Memorystore instance label's value.\n* `__meta_memorystore_memcached_node_id`: The ID of the node, e.g. `node-c-1`.\n* `__meta_memorystore_memcached_node_state`: The current stat of the node. See `State` in the [REST API reference](https://cloud.google.com/memorystore/docs/memcached/reference/rest/v1/projects.locations.instances#State) for possible values.\n* `__meta_memorystore_memcached_host`: The IPv4 address of the node.\n* `__meta_memorystore_memcached_port`: The TCP port of the node, e.g. `11211`.\n* `__meta_memorystore_memcached_cpu_count`: The CPU count for the node.\n* `__meta_memorystore_memcached_memory_size_gb`: The memory size in GB for the node.\n* `__meta_memorystore_memcached_node_zone`: The _zone_ where the node is located.\n\nThe following GCP IAM permissions are required:\n\n* `memcache.instances.list`\n* `memcache.instances.get`\n\n## Usage\n\n### Docker\n\nTo run the Memorystore SD as a Docker container, run:\n\n```\ndocker run ghcr.io/rickard-von-essen/prometheus-memorystore-sd:latest --help\n```\n\n### oliver006/redis_exporter\n\n_Redis/Valkey is not supported yet._\n\n### prometheus/memcached_exporter\n\nThis service discovery can be used with the official [memcached_exporter](https://github.com/prometheus/memcached_exporter),\nsee its [README](https://github.com/prometheus/memcached_exporter#multi-target) for details.\n\n```yaml\nscrape_configs:\n- job_name: memcached_exporter_targets\n  file_sd_configs:\n  - files:\n    - \"/path/to/memorystore.json\"  # File created by service discovery\n  metrics_path: \"/scrape\"\n  relabel_configs:\n  # Filter for memcached cache nodes\n  - source_labels:\n    - __meta_memorystore_memcached_full_version\n    regex: memcached.*\n    action: keep\n  # Build Memcached URL to use as target parameter for the exporter\n  - source_labels:\n    - __meta_memorystore_memcached_host\n    - __meta_memorystore_memcached_port\n    replacement: \"$1\"\n    separator: \":\"\n    target_label: __param_target\n  # Use Memcached URL as instance label\n  - source_labels:\n    - __meta_memorystore_memcached_instance_id\n    - __meta_memorystore_memcached_node_id\n    replacement: \"$1\"\n    separator: \"/\"\n    target_label: instance\n  - target_label: __address__\n    replacement: memcached-exporter-service.company.com:9150\n```\n\n## Development\n\n### Build\n\nBinary:\n\n```\ngo build .\n```\n\nContainer image with [ko](https://ko.build):\n\n```\nko build --base-import-paths --local .\n```\n\n### Test\n\n```\ngo test -v ./...\n```\n\n## License\n\nApache License 2.0, see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickard-von-essen%2Fprometheus-memorystore-sd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frickard-von-essen%2Fprometheus-memorystore-sd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickard-von-essen%2Fprometheus-memorystore-sd/lists"}