Skip to content

Commit 753c72f

Browse files
authored
Merge pull request #59 from matt-gp/agents
AGENTS.md File
2 parents 60f63aa + 85a25d4 commit 753c72f

3 files changed

Lines changed: 58 additions & 1 deletion

File tree

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
README.md
88
CONTRIBUTING.md
99
LICENSE
10+
CODEOWNERS
11+
AGENTS.md
1012

1113
# Development tools
1214
.golangci.yml

AGENTS.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# AGENTS.md
2+
3+
## Project Overview
4+
5+
OpenTelemetry LGTM (Logs, Metrics, Traces) proxy that receives OTLP signals and forwards them to separate backends (Loki, Mimir, Tempo) with tenant ID injection.
6+
7+
- **Language**: Go 1.26.0
8+
- **Module**: `github.com/matt-gp/otel-lgtm-proxy`
9+
10+
## Setup Commands
11+
12+
- Install deps: `go mod download`
13+
- Generate mocks: `go generate ./...`
14+
- Build binary: `go build -o otel-lgtm-proxy ./cmd/main.go`
15+
- Run locally: `./otel-lgtm-proxy`
16+
- Build Docker: `docker build -t otel-lgtm-proxy .`
17+
- Run full stack: `docker compose up`
18+
19+
## Testing Instructions
20+
21+
- Run all tests: `go test -v ./...`
22+
- Run with coverage: `go test -v -race -coverprofile=coverage.out -covermode=atomic ./...`
23+
- View coverage: `go tool cover -html=coverage.out`
24+
- Run linter: `golangci-lint run`
25+
- Must have >90% test coverage before merging
26+
27+
## Code Style
28+
29+
- Use `golangci-lint` with project config (max complexity: 35)
30+
- Always check and handle errors explicitly
31+
- Use dependency injection via constructor functions named `New()`
32+
- Config via environment variables using `github.com/caarlos0/env/v6`
33+
- Package-level comments required: `// Package <name> <description>.`
34+
- Use table-driven tests for multiple test cases
35+
- Generate mocks with `//go:generate mockgen` directives
36+
37+
## Docker Build
38+
39+
- Multi-stage builds with Alpine base
40+
- Build flags: `-ldflags="-s -w" -trimpath`
41+
- Run as non-root user
42+
- `CGO_ENABLED=0` for static binaries
43+
44+
## Project-Specific Patterns
45+
46+
- Use `processor.Processor[T]` generic type for signal processing
47+
- Extract tenant ID from resource attributes using configured label(s)
48+
- Always propagate context for tracing and cancellation
49+
- Use protobuf getter methods (`Get*()`) instead of direct field access
50+
51+
## CI/CD
52+
53+
- Tests and lint must pass before merge
54+
- Docker build test validates container startup and health endpoint
55+
- Coverage reports uploaded to Codecov

internal/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type Endpoint struct {
3131
Address string `env:"ADDRESS"`
3232
Headers string `env:"HEADERS" envDefault:""`
3333
Timeout time.Duration `env:"TIMEOUT" envDefault:"15s"`
34-
TLS TLSConfig ` envPrefix:"TLS_"`
34+
TLS TLSConfig `envPrefix:"TLS_"`
3535
}
3636

3737
// TLSConfig represents the configuration for TLS.

0 commit comments

Comments
 (0)