This guide provides quick commands and coding conventions for Vector development. It's designed to help both AI assistants and human contributors get started quickly.
For comprehensive information, see CONTRIBUTING.md and docs/DEVELOPING.md.
Vector is a high-performance, end-to-end observability data pipeline written in Rust. It collects, transforms, and routes logs, metrics, and traces from various sources to any destination. Vector is designed to be reliable, fast, and vendor-neutral, enabling dramatic cost reduction and improved data quality for observability infrastructure.
-
/src/- Main Rust source codesources/- Data ingestion componentstransforms/- Data processing and routing componentssinks/- Data output destinationsconfig/- Configuration system and validationtopology/- Component graph managementapi/- GraphQL API for management and monitoringcli.rs- Command-line interface
-
/lib/- Modular library cratesvector-lib/- Unified library re-exporting core Vector componentsvector-core/- Core event system and abstractionsvector-config/- Configuration framework with schema generationvector-buffers/- Buffering and backpressure managementcodecs/- Data encoding/decoding (JSON, Avro, Protobuf)enrichment/- Data enrichment (GeoIP, custom tables)file-source/- File watching and readingprometheus-parser/- Prometheus metrics parsing
-
/config/- Configuration examples and templates -
/distribution/- Packaging and deployment configsdocker/- Docker images (Alpine, Debian, Distroless)kubernetes/- Kubernetes manifestssystemd/- SystemD service filesdebian/,rpm/- Linux package configurations
-
/scripts/- Build, test, and deployment automation -
/docs/- Developer documentation -
/tests/- Integration and E2E tests
When working on Vector's Rust codebase, follow this iterative development cycle:
- Make code changes
- Run
make check-clippyto check for linting issues - Fix any issues found (use
make clippy-fixfor auto-fixes) - Continue to next task or mark current task complete
Run this cycle after any code modification.
When editing markdown files (*.md), run make check-markdown after changes.
If you're working on Vector's Rust codebase (sources, sinks, transforms, core functionality):
Format your code:
make fmtCheck formatting:
make check-fmtRun Clippy (linter):
make check-clippyAuto-fix Clippy issues:
make clippy-fixRun unit tests:
make test
# or
cargo nextest run --workspace --no-default-features --features "${FEATURES}"Run integration tests:
# See available integration tests:
# cargo vdev int show
./scripts/run-integration-test.sh <integration-name>See Integration Tests section below for more details.
Before committing (recommended checks):
make fmt # Format code
make check-fmt # Verify formatting
make check-clippy # Run Clippy linter
make check-markdown # Check markdown files
make check-component-docs # Check component documentation
./scripts/check_changelog_fragments.sh # Verify changelogIf you're working on vector.dev website or documentation content:
Prerequisites:
- Hugo static site generator
- CUE CLI tool
- Node.js and Yarn
- htmltest
Run the site locally:
cd website
make serve
# Navigate to http://localhost:1313Build website:
cd website
make cue-buildNote: Website changes use Hugo, CUE, Tailwind CSS, and TypeScript. See website/README.md for details.
Vector uses cargo vdev for most development tasks. This is a custom CLI tool that wraps common operations:
cargo vdev check rust # Clippy
cargo vdev check fmt # Formatting check
cargo vdev check events # Event instrumentation check
cargo vdev check licenses # License compliance
cargo vdev test # Unit tests
cargo vdev int test <name> # Integration tests
cargo vdev fmt # Format codeCreate .git/hooks/pre-push with:
#!/bin/sh
set -e
echo "Format code"
make fmt
echo "Running pre-push checks..."
make check-licenses
make check-fmt
make check-clippy
make check-markdown
make check-component-docs
./scripts/check_changelog_fragments.shThen: chmod +x .git/hooks/pre-push
| Topic | Document |
|---|---|
| Rust style patterns | docs/RUST_STYLE.md |
- Sources: Ingest data from external systems
- Transforms: Modify, filter, or enrich event data
- Sinks: Send data to external systems
Component docs are auto-generated from code annotations. Run make check-component-docs after changes.
Integration tests verify Vector works with real external services. Require Docker or Podman.
Run integration tests:
# List available tests
cargo vdev int show
# Run specific test (example: aws)
cargo vdev int start aws # need to initiate dev environment first
cargo vdev int test awsSee docs/DEVELOPING.md for adding new integration tests.
Makefile- Common build/test/check targetsvdev/- Custom development CLI toolsrc/- Rust source codewebsite/- Hugo-based documentation sitetests/- Integration and behavior tests
Run make fmt before committing. Formatting must be exact.
Run make clippy-fix to auto-fix many issues. Manual fixes may be required.
Component documentation is generated from code. Run:
make check-component-docsAfter adding/updating dependencies:
cargo install dd-rust-license-tool --locked
make build-licensesThese documents provide context that AI agents and developers need when working on Vector code.
- STYLE.md - Code style rules (formatting, const strings, code organization)
- docs/ARCHITECTURE.md - System architecture (sources, transforms, sinks, topology)
- docs/DEVELOPING.md - Development workflow and testing
- docs/specs/component.md - Component specification (naming, configuration, health checks)
- docs/specs/instrumentation.md - Instrumentation requirements (event/metric naming)
- src/internal_events - Internal event examples for telemetry
- docs/DOCUMENTING.md - How to document code changes
- changelog.d/README.md - Adding changelog entries
- CONTRIBUTING.md - Complete contributing guide
- website/README.md - Website development only (separate from Rust code)