{"id":19040721,"url":"https://github.com/cloudfoundry/metric-store-release","last_synced_at":"2025-10-12T07:20:27.840Z","repository":{"id":34620318,"uuid":"171696055","full_name":"cloudfoundry/metric-store-release","owner":"cloudfoundry","description":"Metric Store: A Cloud-Native Time Series Database for Cloud Foundry","archived":false,"fork":false,"pushed_at":"2024-10-23T23:42:22.000Z","size":65059,"stargazers_count":23,"open_issues_count":24,"forks_count":12,"subscribers_count":19,"default_branch":"develop","last_synced_at":"2025-03-29T05:22:33.619Z","etag":null,"topics":[],"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/cloudfoundry.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-20T15:15:20.000Z","updated_at":"2024-09-27T06:17:03.000Z","dependencies_parsed_at":"2024-10-24T02:42:52.928Z","dependency_job_id":"b7341489-b545-4962-856a-cde893c70ec6","html_url":"https://github.com/cloudfoundry/metric-store-release","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fmetric-store-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fmetric-store-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fmetric-store-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fmetric-store-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudfoundry","download_url":"https://codeload.github.com/cloudfoundry/metric-store-release/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249222139,"owners_count":21232437,"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-08T22:24:42.691Z","updated_at":"2025-10-12T07:20:22.810Z","avatar_url":"https://github.com/cloudfoundry.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metric Store: A Cloud-Native Time Series Database\n[![slack.cloudfoundry.org][slack-badge]][slack-channel] [![Build Status](https://github.com/cloudfoundry/metric-store-release/workflows/Test%20Everything/badge.svg)](https://github.com/cloudfoundry/metric-store-release/actions)\n\nMetric Store Release is a [BOSH][bosh] release for Metric Store. It provides a persistent storage layer for metrics sent through the Loggregator subsystem. It is multi-tenant aware (the auth proxy ensures that you only have access to metrics from your apps), easy to query (it is 100% compatible with the Prometheus Query API, with some exceptions listed below), and has a powerful storage engine (the InfluxDB storage engine has built-in compression and a memory-efficient series index).\n\n## Deploying\n\nMetric Store can be deployed within [Cloud Foundry][cfd]. Metric Store will have to know about Loggregator. \n\n### Cloud Config\n\nEvery BOSH deployment requires a [cloud config](https://bosh.io/docs/cloud-config.html). The Metric Store deployment manifest assumes the CF-Deployment cloud config has been uploaded.\n\n### Creating and Uploading a Release\n\nThe first step in deploying Metric Store is to create a release or download it from [bosh.io][bosh-io-release]. Final releases are preferable, however during the development process dev releases are useful.\n\nThe following commands will create a dev release and upload it to an environment named `testing`.\n```\nbosh create-release --force\nbosh -e testing upload-release --rebase\n```\n\n### Cloud Foundry\n\nMetric Store deployed within Cloud Foundry reads from the Loggregator system and registers with the [GoRouter](https://github.com/cloudfoundry/gorouter) at `metric-store.\u003csystem-domain\u003e`.\n\nYou can deploy Metric Store by using this\n[operations file][ops-file].\n\n```\nbosh -e testing -d cf \\\n    deploy cf-deployment.yml \\\n    -o add-metric-store-to-cfd.yml\n```\n\n### Metric Store UAA Client\nBy Default, Metric Store uses the `doppler` client included with `cf-deployment`.\n\nIf you would like to use a custom client, it requires the `uaa.resource` authority:\n```\n\u003ccustom_client_id\u003e:\n    authorities: uaa.resource\n    override: true\n    authorized-grant-types: client_credentials\n    secret: \u003ccustom_client_secret\u003e\n```\n\n## Using Metric Store\n\n### Storing Metrics\nMetric Store ingresses all metrics (discarding logs) from the Reverse Log\nProxy on Loggregator. Any metric sent to a Loggregator Agent will travel\ndownstream into Metric Store.\n\n### Accessing Metrics in Metric Store\n\n#### Authorization and Authentication\nMetric Store as deployed in a Cloud Foundry deployment depends on the\n`CF Auth Proxy` job to convert your UAA provided auth token into an authorized\nlist of source IDs for Metric Store. In Cloud Foundry terms, the source ID can either represent an application\nguid (e.g. `cf app \u003capp-name\u003e --guid`), or a component name (e.g. `doppler`).\n\nEach request must have the `Authorization` header set with a UAA provided token.\nIf the token contains the `doppler.firehose` scope, the request will be able\nto read data from any source ID.\nIf the source ID is an app guid, the Cloud Controller is consulted to verify\nif the provided token has the appropriate app access.\n\n#### PromQL via HTTP\nMetric Store provides Prometheus Query Language (PromQL) compatible endpoints.\nQueries against Metric Store can be crafted with the help of the [Prometheus API\nDocumentation][promql].\n\n##### Example: **GET** `/api/v1/query`\n\nThis issues a PromQL query against Metric Store data.\n\n```\ncurl -G \"http://\u003cmetric-store-addr\u003e:8080/api/v1/query\" --data-urlencode 'query=metrics{source_id=\"source-id-1\"}'\n```\n\n##### Response Body\n```\n{\n  \"status\": \"success\",\n  \"data\": {\n    \"resultType\": \"vector\",\n    \"result\": [{ \"metric\": {...}, \"point\": [...] }]\n  }\n}\n```\nSee the official [PromQL API documentation][promql] for more information.\n\n##### Notes on PromQL\nA valid PromQL metric name consists of the characters [a-Z][0-9], underscore, and colon. Names can begin with [a-Z], underscore, or colon. Names cannot begin with a number [0-9].\nAs a measure to work with existing metrics that do not comply with the above format a conversion process takes place when matching on metric names.\nAs noted above, any character that is not in the set of valid characters is converted to an underscore before it is written to disk. For example, to match on a metric name `http.latency` use the name `http_latency` in your query.\n\n##### Prometheus API Compatability\n- `/api/v1/query` \u0026 `/api/v1/query_range`, fully supported except for regex\n  matchers on `__name__` (for everyone) or `source_id` (for non-admins)\n- `/api/v1/series`, `/api/v1/labels`, `/api/v1/rules`, `/api/v1/alerts` \u0026\n  /api/v1/alertmanagers, fully supported for admins\n- the remaining endpoints are not currently supported\n\n#### Golang Clients For BOSH-Deployed Components\nInteracting with Metric Store directly, circumventing the GoRouter and CF Auth\nProxy, can be done using our [Go ingress client library][ingressclient] or our\n[Go egress client library][egressclient]. This will require a bosh deployed\ncomponent to receive `metric-store` bosh links for certificate sharing. The\nresulting client interaction has admin access.\n\n#### Using Grafana to visualize metrics\n\nSee [Set up Metric Store with Grafana](/docs/setup-grafana.md) in the docs\ndirectory.\n\n## Contributing\n\nWe'd love to hear feedback about your experiences with Metric Store. Please feel free to open up an [issue][issues], send us a [pull request][prs], or come chat with us on [Cloud Foundry Slack][slack-channel].\n\n[slack-badge]:     https://slack.cloudfoundry.org/badge.svg\n[slack-channel]:   https://cloudfoundry.slack.com/archives/metric-store\n[bosh]:            https://github.com/cloudfoundry/bosh\n[cfd]:             https://github.com/cloudfoundry/cf-deployment\n[cfd-manifest]:    https://github.com/cloudfoundry/cf-deployment/blob/master/cf-deployment.yml\n[ops-file]:        https://github.com/cloudfoundry/metric-store-release/blob/master/manifests/ops-files/add-metric-store-to-cfd.yml\n[go-router]:       https://github.com/cloudfoundry/gorouter\n[bosh-io-release]: https://bosh.io/releases/github.com/cloudfoundry/metric-store-release?latest\n[promql]:          https://prometheus.io/docs/prometheus/latest/querying/api/\n[ingressclient]:   https://github.com/cloudfoundry/metric-store-release/tree/develop/src/pkg/ingressclient\n[egressclient]:    https://github.com/cloudfoundry/metric-store-release/tree/develop/src/pkg/egressclient\n[issues]:          https://github.com/cloudfoundry/metric-store-release/issues\n[prs]:             https://github.com/cloudfoundry/metric-store-release/pulls\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fmetric-store-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudfoundry%2Fmetric-store-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fmetric-store-release/lists"}