Before starting, ensure you have the following installed:
- Docker: version 28.5.1 or higher
- Taskfile: version 3.45.4 or higher
- Go: version 1.25 or higher
Follow these steps to set up and run the project:
Set up the required directories with proper permissions:
task dev:docker-influxdb3-setup-dirsThis creates the necessary data, plugins, and UI directories for InfluxDB3 with the correct ownership.
Launch the Docker Compose services with the initialization profile:
docker compose --profile influxdb3-init upThis will start InfluxDB3 Core and initialize the admin user.
Retrieve the admin token from the Docker Compose logs:
task dev:docker-influxdb3-admin-tokenCopy the token value from the output.
Copy the example configuration file:
cp config-example.json config.jsonEdit config.json and set the token value you obtained from the previous step:
{
"influxdb_client": {
"host": "http://127.0.0.1:8181",
"token": "YOUR_TOKEN_HERE",
"database": "dev"
},
"data_server_collector": {
"poll_interval_ms": 1000
}
}Run the application in development mode with auto-reload:
task app:devThe application will start on http://127.0.0.1:8080 (default port).
The application is configured via a config.json file. If not provided, default values are used.
host(string, default:"http://influxdb3-core:8181"): InfluxDB server host URLtoken(string, required): Authentication token for InfluxDBdatabase(string, default:"dev"): InfluxDB database nameorg(string, optional): InfluxDB organization name
host(string, default:"http://localhost:28462"): Data server host URL from which to collect data points
port(string, default:":8080"): Port on which the HTTP server listens
poll_interval_ms(integer, default:1000): Interval in milliseconds at which to poll the data server for new data points
{
"influxdb_client": {
"host": "http://127.0.0.1:8181",
"token": "your-admin-token-here",
"database": "dev",
"org": "myorg"
},
"data_server_client": {
"host": "http://localhost:28462"
},
"http_server": {
"port": ":8080"
},
"data_server_collector": {
"poll_interval_ms": 1000
}
}The HTTP API follows the OpenAPI 3.0 specification. The complete API documentation can be found at:
api-spec/tsp-output/schema/openapi.yaml
GET /data-point
Query stored data points with optional time range filters.
Query Parameters:
start(optional, duration): Start time for the query rangeuntil(optional, duration): End time for the query range
Response (200 OK):
[
{
"time": "2023-01-01T00:00:00Z",
"value": 123.45
}
]Error Response (500):
{
"message": "Error description"
}View all available tasks:
taskRegenerate the API server interface from the OpenAPI specification:
task app:server-swagger-codegenBuild the application binary for local development:
task app:build-app-localThe binary will be created at dist/bin/out by default.
Run the binary:
./dist/bin/outRun the application with auto-reload on file changes:
task app:devAny changes to .go files will trigger an automatic restart.