{"id":16541101,"url":"https://github.com/linki/cryptoprom","last_synced_at":"2025-06-23T16:38:45.956Z","repository":{"id":19766051,"uuid":"87850925","full_name":"linki/cryptoprom","owner":"linki","description":"CryptoProm is a Prometheus metrics exporter for Cryptocurrency market prices.","archived":false,"fork":false,"pushed_at":"2024-04-23T08:57:29.000Z","size":212,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T15:23:35.914Z","etag":null,"topics":["bitcoin","coinbase","cryptocurrency","ethereum","grafana","monitoring","prometheus","prometheus-exporter","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/linki.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}},"created_at":"2017-04-10T19:44:32.000Z","updated_at":"2024-08-20T07:35:19.000Z","dependencies_parsed_at":"2023-02-12T01:01:37.762Z","dependency_job_id":null,"html_url":"https://github.com/linki/cryptoprom","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linki%2Fcryptoprom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linki%2Fcryptoprom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linki%2Fcryptoprom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linki%2Fcryptoprom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linki","download_url":"https://codeload.github.com/linki/cryptoprom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238663197,"owners_count":19509752,"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":["bitcoin","coinbase","cryptocurrency","ethereum","grafana","monitoring","prometheus","prometheus-exporter","ruby"],"created_at":"2024-10-11T18:54:05.675Z","updated_at":"2025-02-13T13:34:54.368Z","avatar_url":"https://github.com/linki.png","language":"Ruby","readme":"# Crypto::Prom\n\n[![Docker Repository on Quay](https://quay.io/repository/linki/cryptoprom/status \"Docker Repository on Quay\")](https://quay.io/repository/linki/cryptoprom)\n[![GitHub release](https://img.shields.io/github/release/linki/cryptoprom.svg)](https://github.com/linki/cryptoprom/releases)\n\nCryptoProm is a Prometheus metrics exporter for Cryptocurrency market prices.\n\nWhen you run it, it queries the Coinbase API once a minute to get the current\nmarket price of Bitcoin and exports that data via HTTP so that Prometheus can\nscrape it.\n\nYou can then use your favorite graphing tool, e.g. Grafana, to visualize the\ndata from Prometheus however you want.\n\n![CryptoProm overview](img/cryptoprom1.png \"CryptoProm overview\")\n\n## Setup\n\nYou need to install Ruby 2.4 and Bundler, however other versions might work as well. Then install dependent Gems via Bundler and start the Rack server.\n\nYou have to provide your Coinbase API credentials in order to retrieve data from their API:\n\n```console\n$ bundle install\n$ export COINBASE_API_KEY=\"\u003cyour-api-key\u003e\"\n$ export COINBASE_API_SECRET=\"\u003cyour-api-secret\u003e\"\n$ rackup\n```\n\nTest that it works in a separate shell with curl:\n\n```console\n$ curl -sS localhost:9292/metrics | grep cryptoprom\n...\ncryptoprom_cryptocurrency_rates{currency=\"AUD\",denominator=\"USD\"} 0.7462686567164178\n...\ncryptoprom_cryptocurrency_rates{currency=\"BTC\",denominator=\"USD\"} 1335.113484646195\ncryptoprom_cryptocurrency_rates{currency=\"ETH\",denominator=\"USD\"} 59.990017661061195\ncryptoprom_cryptocurrency_rates{currency=\"EUR\",denominator=\"USD\"} 1.0869565217391304\ncryptoprom_cryptocurrency_rates{currency=\"GBP\",denominator=\"USD\"} 1.282051282051282\n...\ncryptoprom_cryptocurrency_rates{currency=\"ZWL\",denominator=\"USD\"} 0.0031018331834113963\n```\n\nThis is Prometheus syntax and shows you the current value of each\ncurrency Coinbase knows about in USD, including BTC, ETH and various fiat currencies.\n\nYou can then use PromQL to query that data from Grafana. For instance, to create a\nchart displaying the current BTC price in USD over time you could use the\nfollowing query:\n\n```\ncryptoprom_cryptocurrency_rates{currency=\"BTC\"}\n```\n\nWhich will result in the following graph:\n\n![CryptoProm detail](img/cryptoprom2.png \"CryptoProm detail\")\n\nYou can also do more advances queries. The following takes both the BTC and ETH\nprices in USD and relates them to each other. It basically shows what the \"real\"\nprice for ETH in BTC should be, when only given their prices in USD.\n\n```\ncryptoprom_cryptocurrency_rates{currency=\"ETH\"} / ignoring(currency) cryptoprom_cryptocurrency_rates{currency=\"BTC\"}\n```\n\nLast but not least, you can monitor CryptoProm itself. It exports metrics about\nrequests to its own metrics endpoint as well as its requests to the Coinbase API.\n\n```\nhttp_server_requests_total{code=\"200\",method=\"get\",path=\"/metrics\"} 2.0\ncryptoprom_coinbase_api_requests_total 14.0\n```\n\nYou could use that to create a graph for CryptoProm's request rate against the\nCoinbase API to validate that it behaves and you don't run into rate limiting\nissues. You could create a Gauge in Grafana with the following PromQL query:\n\n```\nrate(cryptoprom_coinbase_api_requests_total[1h]) * 60\n```\n\nWhich will display like this:\n\n![CryptoProm request rate](img/cryptoprom3.png \"CryptoProm request rate\")\n\n## Deploying\n\nThe `manifest` folder contains Kubernetes manifests that describe how CryptoProm\ncan be deployed. A Docker image can be found at `quay.io/linki/cryptoprom`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinki%2Fcryptoprom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinki%2Fcryptoprom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinki%2Fcryptoprom/lists"}