Open-Source Wikis

/

Traefik

/

By the numbers

traefik/traefik

By the numbers

A snapshot of the codebase to help calibrate expectations before you dive in.

Data collected on 2026-04-30 from master at commit f7c0fdea5 ("Merge branch v3.7 into master").

Size

xychart-beta horizontal
    title "Lines of code by area"
    x-axis ["Go (pkg + cmd + integration)", "TypeScript/Vue (webui/src)", "YAML (configs + workflows)", "Markdown (docs)", "TOML (configs + tests)"]
    y-axis "LOC"
    bar [223372, 12318, 30000, 25000, 18000]

The dominant signal is Go. Everything in pkg/, cmd/, and integration/ totals roughly 223k lines spread across 749 .go files. The dashboard adds another ~12k lines of TypeScript and Vue across 144 .tsx/.ts files in webui/src. YAML, TOML, and Markdown are mostly configuration fixtures, sample configs, CI workflows, and the docs/content site.

Metric Value
Total tracked files ~2,000+
Go source files 749
TypeScript/Vue files 144
YAML files (config + workflows) 502
Markdown files 185
TOML files (mostly fixtures) 182
Tests vs implementation (Go) roughly 1:1 by file count

The biggest single Go file is pkg/server/router/router_test.go at ~60k bytes, followed by the integration suite's simple_test.go at ~92k bytes. Configuration types in pkg/config/dynamic/middlewares.go weigh in at 65k bytes — most of that is struct definitions with documentation tags.

Activity

Traefik has been actively developed since August 2015. The repository has accumulated:

Metric Value
Total commits 6,180
Tags (releases + RCs + EAs) 544
Unique committer emails (excluding [bot] accounts) 1,083
First commit 2015-08-28 ("initial commit")
Most recent commit on master 2026-04-30 ("Merge branch v3.7 into master")

Recent active branches include master (where v3.7 is merging in for release), and per-version maintenance branches (v3.6, v3.5, …).

Bot-attributed commits

Window [bot] commits in author/email Percentage
Last 5,000 commits 0 0.0%

The git history is essentially bot-free. There is no Dependabot, GitHub Actions, or AI-bot co-authorship in commit metadata. This is a lower bound on automated work — inline AI assistance leaves no trace in commit history. What it does tell you is that dependency bumps and CI maintenance are landing through human-attributed PRs.

Hotspots (last 90 days, default branch)

The directories that change most often are also the most useful places to look for examples of "how things are done here":

Directory Activity
pkg/middlewares/ Many small bug fixes and new middleware variants (compress, headers, ratelimiter, auth).
pkg/provider/kubernetes/ Gateway API, Knative, and Ingress-NGINX work — the most recent commit on master is "Use a metamodel to generate dynamic configuration in ingress-nginx".
pkg/server/service/loadbalancer/ Active feature work; limit-connections, leasttime, and p2c have all seen recent updates.
webui/src Continuous dashboard polish.
integration/ Constant churn — every behavior fix lands with an integration test.

Complexity

A few outsized files dominate the implementation surface and are worth being aware of when navigating:

File Approximate size Why it's big
pkg/config/dynamic/middlewares.go ~65k bytes Every middleware's configuration struct, with tags.
pkg/config/static/static_config.go ~34k bytes The full static configuration schema.
pkg/provider/acme/provider.go ~40k bytes ACME state machine, challenge handling, certificate renewal.
pkg/server/router/router.go ~17k bytes HTTP router builder.
pkg/server/service/service.go ~18k bytes Service factory and load-balancer assembly.
pkg/server/server_entrypoint_tcp.go ~27k bytes TCP/HTTP/HTTP3 entry-point implementation.

There are roughly 100 occurrences of TODO, FIXME, or HACK in the Go sources under pkg/, cmd/, and integration/. They are spread across the codebase rather than clustered, suggesting they are tracking targeted follow-ups rather than a major refactor.

Dependencies

go.mod declares Traefik as github.com/traefik/traefik/v3, pinned to Go 1.25. The dependency graph is sizable — go.sum is ~300k bytes — and includes:

  • github.com/traefik/paerser — configuration loaders (file/flag/env).
  • github.com/go-acme/lego/v4 — ACME client and DNS challenge providers.
  • github.com/spiffe/go-spiffe/v2 — workload identity (SPIFFE/SVID).
  • AWS SDK v2 packages — for the ECS provider.
  • Kubernetes client-go, controller-runtime, and Gateway/Knative APIs.
  • github.com/rs/zerolog — the structured logger used everywhere via log.Ctx.
  • OpenTelemetry — go.opentelemetry.io/otel plus exporter packages.
  • github.com/quic-go/quic-go — HTTP/3 support.

Dependency volume is one of the trade-offs of integrating with this many ecosystems. See reference/dependencies.md for details.

Test-to-code ratio

Traefik tests heavily. Almost every *.go file in pkg/ has a sibling *_test.go, and the dedicated integration/ package contains another 50 end-to-end test files (150k lines including fixtures). The Makefile splits unit (make test-unit) from integration (make test-integration) so that day-to-day iteration is fast.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

By the numbers – Traefik wiki | Factory