{"id":49916596,"url":"https://github.com/path-variable/influxdb-summary-java","last_synced_at":"2026-05-16T17:03:15.578Z","repository":{"id":321943095,"uuid":"1087696272","full_name":"Path-Variable/influxdb-summary-java","owner":"Path-Variable","description":"Connects to an influxdb bucket and submits a snapshot of measurements defined by regex to Google AI Studio API for summary. Stores summary in a new measurement. Used for displaying dashboard summaries in Grafana or other observability platforms.","archived":false,"fork":false,"pushed_at":"2025-11-01T14:18:22.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-01T15:19:58.763Z","etag":null,"topics":["dashboard-summary","gemini-ai","grafana","influxdb","iot","java"],"latest_commit_sha":null,"homepage":"https://youtu.be/bqWXL7lN36M?si=M3AOkd05JzeimPh-","language":"Java","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/Path-Variable.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-01T13:03:52.000Z","updated_at":"2025-11-01T14:17:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Path-Variable/influxdb-summary-java","commit_stats":null,"previous_names":["path-variable/influxdb-summary-java"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Path-Variable/influxdb-summary-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Path-Variable%2Finfluxdb-summary-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Path-Variable%2Finfluxdb-summary-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Path-Variable%2Finfluxdb-summary-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Path-Variable%2Finfluxdb-summary-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Path-Variable","download_url":"https://codeload.github.com/Path-Variable/influxdb-summary-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Path-Variable%2Finfluxdb-summary-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33111497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"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":["dashboard-summary","gemini-ai","grafana","influxdb","iot","java"],"created_at":"2026-05-16T17:03:10.589Z","updated_at":"2026-05-16T17:03:15.574Z","avatar_url":"https://github.com/Path-Variable.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DashboardSummary\n\n![CI](https://github.com/Path-Variable/influxdb-summary-java/actions/workflows/ci.yml/badge.svg?branch=main)\n\nA small Java service that periodically queries InfluxDB metrics, asks Google Gemini to produce a short human‑friendly summary (2–4 sentences), and writes that summary back to InfluxDB for display on dashboards.\n\n## Features\n- Pulls metrics from InfluxDB with configurable measurement/field filters\n- Aggregates over a fixed time window (mean/min/max/last)\n- Sends a compact JSON payload to Gemini with optional system instruction\n- Writes the generated summary to an output measurement in the same bucket\n- Can run once (batch mode) or on a fixed schedule\n\n## Requirements\n- Java 21+ (the Docker image uses Temurin 21 JRE but the app targets 17)\n- InfluxDB 2.x with an API token and bucket/org\n- Google Generative Language (Gemini) API key\n- Gradle (wrapper included)\n\nConfiguration (Environment Variables)\nThe application reads configuration from environment variables at startup.\n\n### Required\n- `INFLUX_URL`: URL of InfluxDB (e.g., http://localhost:8086)\n- `INFLUX_TOKEN`: InfluxDB API token with read/write access to the bucket\n- `INFLUX_ORG`: InfluxDB organization name/ID\n- `INFLUX_BUCKET`: InfluxDB bucket name\n- `GOOGLE_API_KEY`: Google Gemini API key\n\n### Optional (with defaults)\n- `INFLUX_MEASUREMENT_REGEX`: Regex for measurements to include (default: .*)\n- `INFLUX_FIELD_REGEX`: Regex for fields to include (default: unset = all fields)\n- `GOOGLE_MODEL`: Gemini model (default: gemini-2.5-flash)\n- `OUTPUT_MEASUREMENT`: Measurement to write summaries to (default: dashboard_summary)\n- `INTERVAL_MINUTES`: Window size and schedule period in minutes (default: 15)\n- `TIMEZONE`: IANA timezone for scheduling (default: system timezone)\n- `RUN_ONCE`: If true, runs a single cycle and exits (default: false)\n- `SYSTEM_INSTRUCTION`: System prompt sent to Gemini (default: \"You are a concise observability assistant.\")\n\n## Quick start (local)\n### 1) Export environment variables (example)\n\n\n     export INFLUX_URL=\"http://localhost:8086\"\n     export INFLUX_TOKEN=\"\u003cyour-token\u003e\"\n     export INFLUX_ORG=\"\u003cyour-org\u003e\"\n     export INFLUX_BUCKET=\"\u003cyour-bucket\u003e\"\n     export GOOGLE_API_KEY=\"\u003cyour-gemini-api-key\u003e\"\n\n#### Optional filters and settings\n\n    export INFLUX_MEASUREMENT_REGEX=\"^telemetry_.*$\"\n    export INFLUX_FIELD_REGEX=\"^(temperature|humidity)$\"\n    export INTERVAL_MINUTES=15\n    export RUN_ONCE=false\n\n### 2) Build and run with Gradle\n    ./gradlew run\n\n   To build a distribution you can run:\n\n    ./gradlew installDist\n    ./build/install/DashboardSummary/bin/DashboardSummary\n\n## Run once (batch mode)\nSet `RUN_ONCE=true` to execute a single summary cycle and exit.\n\n    RUN_ONCE=true ./gradlew run\n   # or with the installed distribution\n    RUN_ONCE=true ./build/install/DashboardSummary/bin/DashboardSummary\n\n## Docker\nBuild the image (multi-stage Dockerfile provided):\n\n    docker build -t dashboard-summary:latest .\n\nRun the container (pass env variables):\n\n    docker run --rm \\\n     -e INFLUX_URL=http://influxdb:8086 \\\n     -e INFLUX_TOKEN=YOUR_TOKEN \\\n     -e INFLUX_ORG=YOUR_ORG \\\n     -e INFLUX_BUCKET=YOUR_BUCKET \\\n     -e GOOGLE_API_KEY=YOUR_GEMINI_KEY \\\n     -e INFLUX_MEASUREMENT_REGEX=\".*\" \\\n     -e INTERVAL_MINUTES=15 \\\n     -e OUTPUT_MEASUREMENT=dashboard_summary \\\n     --name dashboard-summary dashboard-summary:latest\n\n## How it works\n- For the last `INTERVAL_MINUTES`, the app queries InfluxDB for each matching measurement/field and computes mean, min, max, and last values.\n- It composes a compact JSON payload with these stats and asks Gemini to write a short summary.\n- The summary is written back to InfluxDB in `OUTPUT_MEASUREMENT` with fields: text (string) and interval_minutes (int), and tag: model.\n\n## Notes and tips\n- Ensure the Influx token has read permission for source measurement(s) and write permission for `OUTPUT_MEASUREMENT` in the target bucket.\n- `TIMEZONE` only affects when periodic runs are scheduled; the data range is relative to \"now\" per InfluxDB.\n- If you need stricter control over prompting, set `SYSTEM_INSTRUCTION` to guide the model’s tone and focus.\n\n## Troubleshooting\n- Missing configuration: the app logs a clear list of missing variables and exits with code 1.\n- Gemini API errors: you will see the HTTP status and body in logs; verify `GOOGLE_API_KEY` and model.\n- Influx query failures: the app logs a warning per failed query and continues with available data.\n\n## Development\n- Build and test: ./gradlew build\n- Code entry point: com.pathvariable.smartgarden.summary.Main\n- Key classes: Config, GeminiClient, SummaryJob, TimeUtil, MetricKey\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpath-variable%2Finfluxdb-summary-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpath-variable%2Finfluxdb-summary-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpath-variable%2Finfluxdb-summary-java/lists"}