This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
The Bindplane Distro for OpenTelemetry Collector (BDOT Collector) is Bindplane's distribution of the upstream OpenTelemetry Collector. This is a Go-based project that implements the Open Agent Management Protocol (OpAMP) and supports both standalone and managed modes.
make agent- Build just the collector binary for current OS/architecturemake updater- Build just the updater binary for current OS/architecturemake build-binaries- Build both collector and updater for current OS/architecture (default target)make build-all- Build for all supported platforms (Linux, Darwin, Windows)make build-linux,make build-darwin,make build-windows- Build for specific platforms
make test- Run all tests with race detectionmake test-no-race- Run all tests without race detectionmake test-with-cover- Run tests with coverage reportsmake test-updater-integration- Run updater integration testsmake bench- Run benchmarks
make ci-checks- Run all CI checks (format, license, misspell, lint, gosec, test)make lint- Run revive lintermake fmt- Format code with goimportsmake check-fmt- Check code formattingmake gosec- Run security scannermake misspell- Check for misspellings in documentationmake misspell-fix- Fix misspellings automatically
make install-tools- Install all required development toolsmake tidy- Tidy go modules across all submodulesmake generate- Run go generate across all modulesmake add-license- Add license headers to source filesmake check-license- Check license headers
make release version=vX.X.X- Create and push release tagsmake release-test- Test release process locallymake release-prep- Prepare release dependencies
The project is structured as an OpenTelemetry Collector distribution with custom components:
- cmd/collector - Main collector entry point that handles both standalone and managed modes
- collector/ - Core collector wrapper that manages OTel collector lifecycle
- factories/ - Component factory registration for receivers, processors, exporters, extensions, and connectors
- opamp/ - OpAMP client implementation for remote management
Custom components are organized by type:
- receiver/ - Custom receivers (AWS S3, M365, Okta, SAP NetWeaver, etc.)
- processor/ - Custom processors (metric extraction, sampling, masking, etc.)
- exporter/ - Custom exporters (Azure Blob, Chronicle, Google Cloud, Snowflake, etc.)
- extension/ - Custom extensions (AWS S3 event, Bindplane extension)
- Dual Mode Operation: The collector can run in standalone mode (using local config) or managed mode (via OpAMP)
- Factory Pattern: All components are registered through factory functions in the factories package
- Module Structure: Each component is a separate Go module with its own go.mod
- Interface Abstraction: Core collector functionality is abstracted behind interfaces for testability
- Standalone Mode: Uses local
config.yamlfile - Managed Mode: Configuration delivered via OpAMP from Bindplane server
- Environment Variables: Support for OpAMP configuration via environment variables
- Rollback Support: Automatic rollback of configurations on startup failures
The project uses a Makefile-based build system with:
- Multi-platform cross-compilation support
- Separate binaries for collector and updater
- Goreleaser for automated releases
- License scanning and security checks
- Unit tests for all components with race detection
- Integration tests for complex components (updater, receivers)
- Mocking using mockery for interface testing
- Coverage reporting available
- Security scanning with gosec
The project uses a multi-module structure where each custom component is its own Go module. The make tidy command operates across all modules. When updating dependencies, use the provided scripts for OTEL version updates.