Files
Thibault VINCENT b4f3f84086 feat!: rewrite from scratch with new architecture and toolchain
Complete rewrite of the codebase, the build pipeline, the dev loop,
and the release pipeline.

For the exporter itself, refer to the updated README and Helm chart
documentation to discover the new functionality and assess the impact
of the breaking changes on your existing setup.

Build & release:
- QA/CI pipelines now run through a Dagger Module, wrapped by
  Taskfile.yml for the developer interface.
- Releases run through GoReleaser: cross-compiled binaries × OS/arch,
  archives, checksums, multi-arch container images (busybox + scratch
  variants on linux/amd64,arm64,riscv64), pushed to ghcr/quay/docker.io.
- Everything is cosign-signed (binaries, images, Helm chart). Image
  CycloneDX SBOMs are attached as cosign attestations. SLSA-3
  provenance is attached to every GitHub Release.
- The Helm chart is published as a cosign-signed OCI artifact.
- Versioning and changelog are automated by release-please from
  Conventional Commits.

Dev experience:
- Local loop driven by Tilt + k3d + Dagger; one command brings up an
  exporter with seeded fixtures and a Prometheus scraping it.
- End-to-end tests run on a throwaway k3d cluster against the real
  rendered chart.

BREAKING CHANGE: the Helm chart is now published exclusively as an OCI
artifact at oci://quay.io/enix/charts/x509-certificate-exporter. The
legacy Helm repository at https://charts.enix.io is no longer updated;
users must switch to the OCI reference (Helm 3.8+ required).
Installation: `helm install x509-certificate-exporter
oci://quay.io/enix/charts/x509-certificate-exporter --version <vX.Y.Z>`.
BREAKING CHANGE: the Helm chart's values schema may diverge from v3 in
edge cases despite a best-effort to preserve backwards compatibility.
Review your existing values against the updated chart/values.yaml
before upgrading. A JSON schema (chart/values.schema.json) is shipped
with the chart so `helm install` / `helm upgrade` will reject any
values that no longer match the expected shape, surfacing regressions
early instead of at runtime.
BREAKING CHANGE: Alpine-based container images are no longer published.
The release pipeline now ships only the `busybox` and `scratch` variants
on linux/amd64,arm64,riscv64. Users pulling `*-alpine` tags must switch
to one of the new variants — `busybox` is the closest functional
replacement (still has a shell), `scratch` is the minimal distroless
option.
2026-04-30 20:35:54 +02:00

31 lines
1.2 KiB
Go

// Package registry stores the in-memory snapshot of all discovered
// certificate bundles and exposes them as Prometheus metrics.
//
// The Registry type implements both cert.Sink (the entry point for
// sources) and prometheus.Collector (the entry point for scrapes). It is
// the single place where label sets, metric names, and collision
// handling are defined.
//
// Library use
//
// A Registry is safe to register with a third-party prometheus.Registry,
// independent of the exporter binary itself:
//
// reg := registry.New(registry.Config{ ExposeRelative: true }, logger)
// prom := prometheus.NewRegistry()
// prom.MustRegister(reg)
//
// mySource.Run(ctx, reg) // mySource implements cert.Source
//
// http.Handle("/metrics", promhttp.HandlerFor(prom, promhttp.HandlerOpts{}))
//
// Collision handling
//
// When two bundle items would map to the same metric series (same name +
// labels), the registry resolves the conflict according to Config.Collision:
// CollisionAuto adds a discriminator label only on the colliding rows,
// CollisionAlways always adds the label, and CollisionNever deduplicates
// by keeping the row with the smallest NotAfter and increments
// x509_cert_collision_total.
package registry