Skip to content

Commit 36646d4

Browse files
authored
feat: unified telemetry system (tracing, metrics, logging, profiling) (#26)
* deps: add OpenTelemetry, Pyroscope, and otelzap dependencies * feat(telemetry): add TelemetryConfig with dev/prod defaults * feat(settings): add telemetry settings category * feat(telemetry): add shared OTel Resource with instance identity * feat(telemetry): add OTLP exporter factory and no-op exporter * feat(telemetry): add OTel provider factories (trace, metric, log) * feat(telemetry): add MapCarrier propagation helpers for Wails bindings * feat(telemetry): add ZapBackend bridging plugin-sdk Logger to Zap * feat(telemetry): add Pyroscope profiling with plugin/controller labels * feat(telemetry): add telemetry Service with init/shutdown lifecycle * deps: add Grafana Faro and OpenTelemetry JS packages * feat(telemetry): add TelemetryContext type and factory * feat(telemetry): add unified frontend Logger with context enrichment * feat(telemetry): add WailsTransport for Faro signal shipping * feat(telemetry): add Wails binding instrumentation wrapper with trace propagation * feat(telemetry): add useLogger and useTelemetryContext React hooks * feat(telemetry): add console patching and public API module * feat(telemetry): add Faro SDK initialization with WailsTransport * feat(telemetry): add frontend OTel TracerProvider setup * fix(telemetry): use resourceFromAttributes and setGlobalTracerProvider for OTel JS compatibility * feat: wire telemetry service into app startup and replace CreateLogger * feat: wire frontend telemetry init into app entry point * feat(telemetry): add frontend signal ingestion and Wails binding * feat(telemetry): register omniview application metrics * test(telemetry): add end-to-end trace and log correlation integration tests * fix: resolve undefined component in HomepageCard extension point rendering The kubernetes plugin registers homepage cards with a `component` property, but the normalization layer only reads `value`. Add fallback to accept both property names, and fix HomepageCard to use the correct type and property. * chore: add telemetry dependencies and generated Wails bindings Adds go.mod deps for pyroscope, otelzap, otel-runtime, and otel/metric. Includes regenerated Wails models and TelemetryBinding JS/TS stubs. * fix: address PR review findings (batch 1) - Use host.arch instead of os.arch for OTel semantic convention - Add missing ResourceWatchActive assertion in metrics test - Use os.UserHomeDir() instead of os.Getenv("HOME") for portability - Don't panic on telemetry init failure, fall back to production logger - Reset tracing provider to null on shutdown for clean re-init - Return noop sink instead of throwing when telemetry not initialized - Don't blindly prepend http:// to Pyroscope endpoint - Revert unrelated .gitignore change * fix: address PR review findings (batch 2) - Derive telemetry settings defaults from DefaultConfig to prevent drift - Use Options dropdown for LogsShipLevel with validation - Mark auth_value as Sensitive with Password type - Add hot-togglable log ship level via AtomicLevel + levelFilterCore - Suppress spurious zap Sync errors on non-seekable fds - Add float32/float64/uint/uint64 field conversions in ZapBackend - Harden tests: exact profile types, global state save/restore, os.type + host.arch assertions, IsSampled check - Fix logger merge order so user fields override built-ins - Run instrumented fn inside span context via context.with - Add recordException assertion in instrumentation tests - Make patchConsole idempotent with robust arg serialization - Surface transport/sink errors in dev mode - Fix HomepageCard generic typing to eliminate double cast * fix: address PR review findings (batch 3) - Make ValidLogLevels unexported; add GetValidLogLevels() safe accessor - Add require.NotNil(t, m) guard in metrics_test before field access - Use semconv.OSTypeKey / HostArchKey instead of ad-hoc attribute.String - Swap global OTel providers to noop before shutting down SDK providers - Add span lifecycle assertions (setStatus OK, end) in happy-path test - Export WailsBinding type for external consumers - Preserve Error stack traces in patchConsole serializeArg - Use unpatched console ref in WailsTransport to prevent recursion * fix: address PR review findings (batch 4) - Consolidate validLogLevels to single canonical slice + derived map - Make context.with a spyable mock and assert it's called in tests - Make patchConsole fail-open: sink errors swallowed via try/catch - Defer patched=true until after all wrappers assigned successfully
1 parent 805758b commit 36646d4

52 files changed

Lines changed: 2649 additions & 69 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ dist-ssr
5050

5151
# Benchmark output
5252
benchmarks/
53+
54+
# Superpowers brainstorm sessions
55+
.superpowers/

go.mod

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,32 @@ require (
77
github.com/fsnotify/fsnotify v1.9.0
88
github.com/go-enry/go-enry/v2 v2.8.7
99
github.com/google/uuid v1.6.0
10+
github.com/grafana/otel-profiling-go v0.5.1
11+
github.com/grafana/pyroscope-go v1.2.7
1012
github.com/hashicorp/go-hclog v1.6.3
1113
github.com/hashicorp/go-plugin v1.7.0
1214
github.com/nxadm/tail v1.4.11
1315
github.com/omniviewdev/plugin-sdk v0.2.1
1416
github.com/omniviewdev/registry v0.2.1
15-
github.com/stretchr/testify v1.10.0
17+
github.com/stretchr/testify v1.11.1
1618
github.com/vrischmann/userdir v0.0.0-20151206171402-20f291cebd68
1719
github.com/wailsapp/mimetype v1.4.1
1820
github.com/wailsapp/wails/v2 v2.11.0
19-
go.uber.org/zap v1.27.0
20-
golang.org/x/sync v0.13.0
21-
google.golang.org/grpc v1.68.1
22-
google.golang.org/protobuf v1.36.6
21+
go.opentelemetry.io/contrib/bridges/otelzap v0.17.0
22+
go.opentelemetry.io/contrib/instrumentation/runtime v0.67.0
23+
go.opentelemetry.io/otel v1.42.0
24+
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.18.0
25+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.42.0
26+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.42.0
27+
go.opentelemetry.io/otel/metric v1.42.0
28+
go.opentelemetry.io/otel/sdk v1.42.0
29+
go.opentelemetry.io/otel/sdk/log v0.18.0
30+
go.opentelemetry.io/otel/sdk/metric v1.42.0
31+
go.opentelemetry.io/otel/trace v1.42.0
32+
go.uber.org/zap v1.27.1
33+
golang.org/x/sync v0.19.0
34+
google.golang.org/grpc v1.79.2
35+
google.golang.org/protobuf v1.36.11
2336
gopkg.in/natefinch/lumberjack.v2 v2.2.1
2437
gopkg.in/yaml.v2 v2.4.0
2538
gopkg.in/yaml.v3 v3.0.1
@@ -28,12 +41,15 @@ require (
2841

2942
require (
3043
github.com/bep/debounce v1.2.1 // indirect
44+
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
45+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3146
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3247
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
3348
github.com/fatih/color v1.18.0 // indirect
3449
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
3550
github.com/go-enry/go-oniguruma v1.2.1 // indirect
36-
github.com/go-logr/logr v1.4.2 // indirect
51+
github.com/go-logr/logr v1.4.3 // indirect
52+
github.com/go-logr/stdr v1.2.2 // indirect
3753
github.com/go-ole/go-ole v1.3.0 // indirect
3854
github.com/go-openapi/jsonpointer v0.21.0 // indirect
3955
github.com/go-openapi/jsonreference v0.21.0 // indirect
@@ -44,11 +60,14 @@ require (
4460
github.com/google/gnostic-models v0.6.9 // indirect
4561
github.com/google/go-cmp v0.7.0 // indirect
4662
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
63+
github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect
4764
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect
65+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
4866
github.com/hashicorp/yamux v0.1.2 // indirect
4967
github.com/jchv/go-winloader v0.0.0-20250406163304-c1995be93bd1 // indirect
5068
github.com/josharian/intern v1.0.0 // indirect
5169
github.com/json-iterator/go v1.1.12 // indirect
70+
github.com/klauspost/compress v1.17.8 // indirect
5271
github.com/labstack/echo/v4 v4.13.3 // indirect
5372
github.com/labstack/gommon v0.4.2 // indirect
5473
github.com/leaanthony/go-ansi-parser v1.6.1 // indirect
@@ -74,16 +93,20 @@ require (
7493
github.com/valyala/fasttemplate v1.2.2 // indirect
7594
github.com/wailsapp/go-webview2 v1.0.22 // indirect
7695
github.com/x448/float16 v0.8.4 // indirect
96+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
97+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 // indirect
98+
go.opentelemetry.io/otel/log v0.18.0 // indirect
99+
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
77100
go.uber.org/multierr v1.11.0 // indirect
78-
golang.org/x/crypto v0.37.0 // indirect
79-
golang.org/x/net v0.39.0 // indirect
80-
golang.org/x/oauth2 v0.27.0 // indirect
81-
golang.org/x/sys v0.32.0 // indirect
82-
golang.org/x/term v0.31.0 // indirect
83-
golang.org/x/text v0.24.0 // indirect
101+
golang.org/x/crypto v0.48.0 // indirect
102+
golang.org/x/net v0.51.0 // indirect
103+
golang.org/x/oauth2 v0.35.0 // indirect
104+
golang.org/x/sys v0.41.0 // indirect
105+
golang.org/x/term v0.40.0 // indirect
106+
golang.org/x/text v0.34.0 // indirect
84107
golang.org/x/time v0.9.0 // indirect
85-
golang.org/x/tools v0.31.0 // indirect
86-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
108+
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect
109+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect
87110
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
88111
gopkg.in/inf.v0 v0.9.1 // indirect
89112
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect

0 commit comments

Comments
 (0)