Step-by-step instructions for hacking on vmgather like any other VictoriaMetrics project.
- Go 1.21 or newer,
- GNU Make,
- Docker (integration and scenario tests),
- Node.js 18+ with npm (Playwright UI tests).
git clone https://github.com/VictoriaMetrics/vmgather.git
cd vmgather
make build # compiles ./vmgather and ./vmimporter
./vmgather # launches the export wizard
./vmimporter # launches the bundle uploadermake deps installs JS dependencies for E2E tests if needed.
cmd/vmgather/ - Export wizard entry point
cmd/vmimporter/ - Bundle uploader entry point
internal/server/ - Exporter HTTP server + embedded UI
internal/importer/server/ - Importer HTTP server + embedded UI
internal/application/ - services orchestrating validation/export flows
internal/infrastructure/ - VictoriaMetrics client, obfuscation, archive writer
internal/domain/ - shared structs/enums
docs/ - public documentation
local-test-env/ - docker-compose scenarios
tests/e2e/ - Playwright specs
dist/ - build outputs (ignored)
- Implement feature/fix inside
internal/...orcmd/vmgather/. - Update/extend unit tests near the code.
- Run checks:
make lint
make test- For changes affecting flows, run:
INTEGRATION_TEST=1 go test ./tests/integration/...
make test-e2e- Update docs/CHANGELOG as needed and send a PR.
| Command | Purpose |
|---|---|
make test |
Go unit tests - no Docker required |
make test-fast |
Skip slow tests |
make test-coverage |
Generate coverage report |
Use for: Quick validation during development, CI pipelines without Docker.
| Command | Purpose |
|---|---|
make test-integration |
Binary tests Docker environment (13 scenarios) |
make test-env-up |
Start Docker environment |
make test-env-down |
Stop Docker environment |
Use for: Full validation before merge, testing real VM scenarios.
| Command | Purpose |
|---|---|
make test-full |
Everything: unit tests + Docker + integration |
Use for: Final validation, release candidate testing.
Test environment uses type-safe Go configuration (local-test-env/config.go):
- No manual environment variables needed
- Automatic port detection
- Dynamic URL construction
- Validates before running
# View current test configuration
make test-config-json
# Validate configuration
make test-config-validate
# Override if needed (optional)
export VM_SINGLE_NOAUTH_URL=http://custom:18428
make test-scenarioscd tests/e2e
npm install
npm testRequires make test-env-up running in background.
- Follow Effective Go and VictoriaMetrics' standard lints.
- Keep exported functions documented; rely on table-driven tests.
- Use vanilla JS/ES6 for frontend, mirroring other VictoriaMetrics UI utilities.
- Avoid introducing new dependencies without prior discussion.
make build # Local platform (vmgather + vmimporter)
make build-all # Cross-platform binaries + checksums
make docker-build # Multi-arch Docker imagesArtifacts are placed in dist/. See release-guide.md for publishing instructions.
VMGATHER_LOG=debug ./vmgatherenables verbose logging (see environment variables in code).- Use the docker scenarios in
local-test-envto reproduce customer issues offline. - Browser dev tools help inspect API payloads when reproducing UI bugs.