Commit Graph

271 Commits

Author SHA1 Message Date
lukaszraczylo 287289cd80 fix(telemetry): inject appVersion at build + auto-resolve at runtime
The released v0.45.1 binary shipped with the source default
appVersion="dev" because .goreleaser.yaml had ldflags="-s -w" only,
so every startup ping was rejected by the receiver with HTTP 400
(invalid version: regex requires leading digit).

Two-layer fix:

1. .goreleaser.yaml now passes -X main.appVersion={{.Version}} so
   goreleaser-built binaries report the actual release version.
2. Switch to telemetry.SendForModule which prefers
   debug.ReadBuildInfo Main/Deps when available, falling back to
   appVersion. This means `go install github.com/lukaszraczylo/
   graphql-monitoring-proxy@vX.Y.Z` users also get correct versions
   without relying on the ldflag.

Bumps oss-telemetry to v0.2.1 for SendForModule.
2026-05-22 23:34:09 +01:00
lukaszraczylo d96d2f429f feat: anonymous usage telemetry via oss-telemetry
Send a single fire-and-forget ping at startup to help track adoption
and version spread. No persistent identifiers are collected.

Adds main.appVersion var (defaulting to "dev"); wire ldflags
(-X main.appVersion=$VERSION) to populate it at release time.

Opt out via any of:
  DO_NOT_TRACK=1
  OSS_TELEMETRY_DISABLED=1
  GRAPHQL_MONITORING_PROXY_DISABLE_TELEMETRY=1
2026-05-21 03:06:34 +01:00
lukaszraczylo c2c75d69c0 perf+coverage: optimisation pass + coverage push to ≥70%
Performance / resource usage:
- circuit_breaker_metrics: fix data race on failCounters map (RWMutex + double-checked locking)
- server.go: drop user_id and op_name metric labels (Prometheus cardinality bound); de-duplicate extractUserInfo
- graphql.go: gate runtime.ReadMemStats per-request behind ENABLE_ALLOCATION_TRACKING flag (default off)
- graphql.go: collapse two-pass AST scan into single pass; lower-case once
- sanitization.go: cache compiled redaction regexes per pattern via sync.Map; hoist inner constants to pkg vars
- proxy.go: hoist connection/timeout substrings to pkg vars; sentinel errors for static error paths; drop dead Headers map alloc
- metrics_aggregator.go: log-field allocation guarded by Logger.IsLevelEnabled
- logging/logger.go: add IsLevelEnabled helper
- lru_cache.go: 16-shard sharding, FNV-1a routing (concurrent throughput +22%)
- cache/memory/lru_memory_cache.go: gzip compress/decompress moved outside mu.Lock
- rps_tracker.go: RWMutex+uint64 -> atomic.Uint64
- retry_budget.go: drop unused mutex
- api.go: bannedUsersIDs map+RWMutex -> sync.Map (+ snapshot/replace helpers)
- tracing/tracing.go: pkg-level constSpanAttrs, copy-then-append in StartSpanWithAttributes
- admin_dashboard.go: handleStatsWebSocket reuses bytes.Buffer + json.Encoder per connection

Build / runtime:
- Makefile: -ldflags="-s -w" -trimpath, CGO_ENABLED=0 for build (=1 for test recipes)
- Dockerfile + Dockerfile.goreleaser: ENV GOMEMLIMIT=512MiB
- main.go: blank import go.uber.org/automaxprocs (cgroup-aware GOMAXPROCS)
- main.go: PPROF_PORT env var wires net/http/pprof on 127.0.0.1 only with full server timeouts
- README.md: env-var docs + metric-label docs updated; cardinality note

Test coverage push (per package):
- main 51.2% -> 74.7%
- cache 66.3% -> 93.7%
- cache/redis 45.5% -> 98.2%
- tracing 66.7% -> 72.9%
- (cache/memory 91.6%, logging 91.9%, monitoring 77.6%, pkg/pools 100% unchanged)

New test files: coverage_micro_test, coverage_extras_test, server_handlers_test,
api_health_test, admin_dashboard_cluster_test, metrics_aggregator_test, concerns_test,
cache/cache_coverage_test, cache/redis/redis_coverage_test, tracing/tracing_coverage_test.

Bug fix: connection_resilience_test.go TestIntegratedHealthManagement.health_manager_startup
was sync.Once-coupled to InitializeBackendHealth and panicked when another test (e.g. via
parseConfig) had already triggered Once. Use NewBackendHealthManager directly.
2026-04-19 19:49:24 +01:00
lukaszraczylo 65fa936b60 Update go.mod and go.sum (#86) 2026-04-04 04:48:07 +01:00
lukaszraczylo 122148d23e Update go.mod and go.sum (#85) 2026-04-03 04:56:24 +01:00
lukaszraczylo 6e493e4100 Update go.mod and go.sum (#84) 2026-04-02 04:54:42 +01:00
lukaszraczylo 92da4af001 Update go.mod and go.sum (#83) 2026-04-01 05:02:25 +01:00
lukaszraczylo c68dc2f20a Update go.mod and go.sum (#82) 2026-03-31 04:56:07 +01:00
lukaszraczylo 11ff751001 Update go.mod and go.sum (#81) 2026-03-23 03:53:38 +00:00
lukaszraczylo 0414473f15 Update go.mod and go.sum (#80) 2026-03-22 03:49:12 +00:00
lukaszraczylo bc61557015 Update go.mod and go.sum (#79) 2026-03-21 03:42:49 +00:00
lukaszraczylo 12ec00f697 Update go.mod and go.sum (#78) 2026-03-20 03:45:16 +00:00
lukaszraczylo da4a179d66 Update go.mod and go.sum (#77) 2026-03-18 03:51:52 +00:00
lukaszraczylo d0ecefce6c Update go.mod and go.sum (#76) 2026-03-17 03:46:12 +00:00
lukaszraczylo c742530d2f Update go.mod and go.sum (#75) 2026-03-13 03:46:36 +00:00
lukaszraczylo 7304559801 Update go.mod and go.sum (#74) 2026-03-12 03:45:51 +00:00
lukaszraczylo aa46992497 Update go.mod and go.sum (#73) 2026-03-10 03:45:15 +00:00
lukaszraczylo e968a48584 Update go.mod and go.sum (#72) 2026-03-09 03:47:33 +00:00
lukaszraczylo c67dfe1827 Update go.mod and go.sum (#71) 2026-03-08 03:46:25 +00:00
lukaszraczylo 55d86e34cf Update go.mod and go.sum (#70) 2026-03-07 03:37:20 +00:00
lukaszraczylo cd4a1f16ed Update go.mod and go.sum (#69) 2026-03-03 03:46:23 +00:00
lukaszraczylo 3352050bdb Update go.mod and go.sum (#68) 2026-02-27 03:46:24 +00:00
lukaszraczylo bb2509e254 Update go.mod and go.sum (#67) 2026-02-26 03:47:30 +00:00
lukaszraczylo d027122446 Update go.mod and go.sum (#66) 2026-02-25 03:48:58 +00:00
lukaszraczylo 3abbaf66a1 Update go.mod and go.sum (#65) 2026-02-24 03:47:16 +00:00
lukaszraczylo f8871a4fb7 Update go.mod and go.sum (#64) 2026-02-19 03:49:36 +00:00
lukaszraczylo 420e63f383 Update go.mod and go.sum (#63) 2026-02-18 03:50:04 +00:00
lukaszraczylo 9bd9f0b9ba Update go.mod and go.sum (#62) 2026-02-17 03:47:17 +00:00
lukaszraczylo 31cb5930d5 Update go.mod and go.sum (#61) 2026-02-15 03:51:37 +00:00
lukaszraczylo 454e1d2425 Update go.mod and go.sum (#60) 2026-02-14 03:46:07 +00:00
lukaszraczylo 98afa39943 Update go.mod and go.sum (#59) 2026-02-11 03:57:00 +00:00
lukaszraczylo 6605c59efd Update go.mod and go.sum (#58) 2026-02-10 03:58:10 +00:00
lukaszraczylo f87f2ae5a2 Update go.mod and go.sum (#57) 2026-02-09 03:52:03 +00:00
lukaszraczylo 04f6deb0a8 Update go.mod and go.sum (#56) 2026-02-04 03:46:40 +00:00
lukaszraczylo 5ea41ea268 Update go.mod and go.sum (#55) 2026-02-03 03:47:55 +00:00
lukaszraczylo b8b814a9be Update go.mod and go.sum (#54) 2026-02-02 03:51:10 +00:00
lukaszraczylo 5b79b49b00 Update go.mod and go.sum (#53) 2026-02-01 03:55:03 +00:00
lukaszraczylo bdbf829a59 Update go.mod and go.sum (#52) 2026-01-30 03:45:32 +00:00
lukaszraczylo dcff327745 Update go.mod and go.sum (#51) 2026-01-29 03:45:20 +00:00
lukaszraczylo f2997c4c9f Update go.mod and go.sum (#50) 2026-01-28 03:32:18 +00:00
lukaszraczylo c3fe0471df Update go.mod and go.sum (#49) 2026-01-27 03:32:38 +00:00
lukaszraczylo d62c718682 Update go.mod and go.sum (#48) 2026-01-26 03:37:18 +00:00
lukaszraczylo 26cebee756 Update go.mod and go.sum (#47) 2026-01-25 03:33:49 +00:00
lukaszraczylo acace4fe16 Update go.mod and go.sum (#46) 2026-01-23 03:32:22 +00:00
lukaszraczylo f6fc338c8c Update go.mod and go.sum (#45) 2026-01-22 03:32:34 +00:00
lukaszraczylo 9b792c3c64 Update go.mod and go.sum (#44) 2026-01-21 03:30:16 +00:00
lukaszraczylo d3fe02aa52 Update go.mod and go.sum (#43) 2026-01-19 03:31:38 +00:00
lukaszraczylo 82000bfb4c Update go.mod and go.sum (#42) 2026-01-17 03:29:33 +00:00
lukaszraczylo caeae62236 Update go.mod and go.sum (#40) 2026-01-15 03:30:11 +00:00
lukaszraczylo 0e1deab8ed Update go.mod and go.sum (#39) 2026-01-13 03:29:26 +00:00