{"id":22474914,"url":"https://github.com/cosh/prometheustoadx","last_synced_at":"2025-08-02T11:32:24.853Z","repository":{"id":38312575,"uuid":"197636677","full_name":"cosh/PrometheusToAdx","owner":"cosh","description":"Ingest data originating from Prometheus to Kusto","archived":false,"fork":false,"pushed_at":"2024-08-27T12:42:28.000Z","size":729,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-08T18:54:27.031Z","etag":null,"topics":["kusto","prometheus"],"latest_commit_sha":null,"homepage":"","language":"C#","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/cosh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-07-18T18:21:46.000Z","updated_at":"2024-11-29T08:54:52.000Z","dependencies_parsed_at":"2024-08-27T13:24:14.499Z","dependency_job_id":null,"html_url":"https://github.com/cosh/PrometheusToAdx","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cosh/PrometheusToAdx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosh%2FPrometheusToAdx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosh%2FPrometheusToAdx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosh%2FPrometheusToAdx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosh%2FPrometheusToAdx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosh","download_url":"https://codeload.github.com/cosh/PrometheusToAdx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosh%2FPrometheusToAdx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268378965,"owners_count":24240907,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"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":["kusto","prometheus"],"created_at":"2024-12-06T13:12:29.529Z","updated_at":"2025-08-02T11:32:24.378Z","avatar_url":"https://github.com/cosh.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Data Explorer Storage adapter for Prometheus.io\n\nThis is a a set of two [functions](https://azure.microsoft.com/en-us/services/functions/) which are needed for the \"remote_write\" and \"remote_read\" configuration of [Prometheus](https://prometheus.io/). It enables the user to use [Azure Data Explorer](https://azure.microsoft.com/en-us/services/data-explorer/) to read and write metrics. Some more details can be found on this [article](https://www.linkedin.com/pulse/prometheusio-azure-data-explorer-henning-rauch/).\n\n## Architecture\n![Alt text](https://raw.githubusercontent.com/cosh/PrometheusToAdx/master/pic/simpleArch.png)\n\n\n## HowTo\n\n### 1. *Deploy* the infrastructure\n(take a look at the architecure and have fun in the Azure portal or contribute some proper ARM templates :D)\n\n### 2. *Create* tables in ADX\n``` \n.create table RawData ingestion json mapping \"RawDataMapping\" '[{ \"column\" : \"d\", \"datatype\" : \"dynamic\", \"path\" : \"$\"}]'\n\n.create function Update_SearchExplosion() \n{ \nRawData\n| extend id = new_guid()\n| mv-expand d.Samples\n| extend  value=todouble(d_Samples.Value), ts=datetime(1970-01-01) + tolong(d_Samples.Timestamp)*1ms, labels=d.Labels\n| project-away d_Samples\n| mv-expand labels\n| extend label=tostring(labels.Name), labelValue=tostring(labels.Value)\n| project-away labels\n| extend p = pack(label, labelValue)\n| summarize label=make_bag(p), timeseries=any(d), value=any(value) by ['id'], ts\n| project-away ['id']\n}\n\n.create table SearchExplosion (ts: datetime, label: dynamic, timeseries: dynamic, value: real)\n\n.alter table SearchExplosion policy update\n@'[{\"IsEnabled\": true, \"Source\": \"RawData\", \"Query\": \"Update_SearchExplosion()\", \"IsTransactional\": false, \"PropagateIngestionProperties\": false}]'\n``` \n\n### 3. *Configure* prometheus\n\nSample config extension for prometheus.yml:\n``` \nremote_write:\n  - url: \"https://\u003cwriteFunc\u003e.azurewebsites.net/api/Write\"\n    remote_timeout: 30s\n    queue_config:\n        capacity: 100000\n        max_shards: 1000\n        max_samples_per_send: 1000\n        batch_send_deadline: 5s\n        max_retries: 10\n        min_backoff: 30ms\n        max_backoff: 100ms\n\nremote_read:\n  - url: \"https://\u003creadFunc\u003e.azurewebsites.net/api/Read\" \n    read_recent: true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosh%2Fprometheustoadx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosh%2Fprometheustoadx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosh%2Fprometheustoadx/lists"}