{"id":22617517,"url":"https://github.com/dafvid/timescaleproxy","last_synced_at":"2026-04-28T11:33:52.163Z","repository":{"id":37757872,"uuid":"281239877","full_name":"dafvid/timescaleproxy","owner":"dafvid","description":"A proxy for writing Telegraf JSON HTTP output into a Timescale DB. Written in Go.","archived":false,"fork":false,"pushed_at":"2022-12-27T17:29:55.000Z","size":79,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T01:19:06.204Z","etag":null,"topics":["go","http","json","telegraf","timescaledb"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dafvid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-20T22:38:50.000Z","updated_at":"2022-06-17T11:21:57.000Z","dependencies_parsed_at":"2023-01-31T04:46:05.290Z","dependency_job_id":null,"html_url":"https://github.com/dafvid/timescaleproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dafvid/timescaleproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dafvid%2Ftimescaleproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dafvid%2Ftimescaleproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dafvid%2Ftimescaleproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dafvid%2Ftimescaleproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dafvid","download_url":"https://codeload.github.com/dafvid/timescaleproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dafvid%2Ftimescaleproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32379327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","http","json","telegraf","timescaledb"],"created_at":"2024-12-08T20:06:43.579Z","updated_at":"2026-04-28T11:33:52.107Z","avatar_url":"https://github.com/dafvid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timescaleproxy\nA proxy for writing Telegraf JSON HTTP outputs into a TimescaleDB. Written in Go. Feedback is welcome. Bear in mind this is my first Go-project.\n\nAs the Telegraf plugin for TimescaleDB is ~[pending](https://github.com/influxdata/telegraf/pull/3428)~ [pending](https://github.com/influxdata/telegraf/pull/8651) for being included in the Telegraf codebase. \nI saw the need for a workaround using a HTTP-proxy that recieves metrics in JSON and writes them to the TimescaleDB.\n\nIt's inspired by the [plugin](https://github.com/svenklemm/telegraf/tree/postgres/plugins/outputs/postgresql) but instead of a general PostgreSQL output it outputs only to TimescaleDB.\n\nSecurity is non-existant at the moment so this should only be used far away from the internetz. I'd recommend either behind a secured nginx reverse proxy or over a [wireguard](https://www.wireguard.com) interface.\n\n## Install\n  ```sh\n  git clone https://github.com/dafvid/timescaleproxy.git\n  cd timescaleproxy\n  go install\n  go build\n  ```\n\n## Config\n  ```sh\n  ./timescaleproxy -printconf \u003e config.json\n  ```\n  \n  ### Db ###\n  - **Db.Host**: PostgreSQL server host\n  - **Db.Port**: PostgreSQL port\n  - **Db.Schema**: Timescale database schema\n  - **Db.Database**: Timescale database name\n  - **Db.User**: Timescale database user\n  - **Db.Password**: Timescale database user password\n  - **Db.MaxConns**: MaxConns setting for pgxpool\n  - **Db.MinConns**: MinConns setting for pgxpool\n  ### Listen ###\n  - **Listen.adress**: Timescale proxy listening adress\n  - **Listen.port**: Timescale proxy listening port\n  ### Misc ###\n  - **TimestampUnit**: matches the setting `json_timestamp_units` in section `[[outputs.http]]` in `telegraf.conf`\n  - **DefaultDropPolicy**: Interval setting for [add_retention_policy()](https://docs.timescale.com/api/latest/data-retention/add_retention_policy/). Clear to disable retention.\n  - **LogLevel**: Log level. Clear to disable logs.\n    \n## Run\n  ```sh\n  ./timescaleproxy -c config.json\n  ```\n  \n\n## Telegraf config\n```yaml\n[[outputs.http]]\n  url = \"http://url.to.server:8432/\"\n  data_format = \"json\"\n  json_timestamp_units = \"1ms\"\n  [outputs.http.headers]\n    Content-Type = \"application/json; charset=utf-8\"\n```\n\n## Updates\n### 2022-10-07\n- Added Config documentation\n### 2022-08-10\n- Added FreeBSD RC-script to run the proxy as a daemon\n### 2022-06-22\n- Changed the timestamp column name to ts\n### 2020-07-31:\n- Export and read JSON-config\n- Create tables and tags in DB from first Metric\n- Writes JSON-metrics to TimescaleDB\n\n# TODO\n- Per measurement config for retention\n- ~~config~~\n- ~~create tables from first measurement~~\n- ~~write measurement to db~~\n- ~~tags as FK~~\n- ~~schema config~~\n- handle influx line protocol (less portable maybe)\n- measurement config (column type for field)\n- sanitize strings\n- ~~default retention policy~~\n- ~~error handling~~\n- update table if measurement changes (unlikely)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdafvid%2Ftimescaleproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdafvid%2Ftimescaleproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdafvid%2Ftimescaleproxy/lists"}