feat(instrumentation)!: gate continuous profiler behind profiler_enabled#166
Open
kamranf wants to merge 1 commit into
Open
feat(instrumentation)!: gate continuous profiler behind profiler_enabled#166kamranf wants to merge 1 commit into
kamranf wants to merge 1 commit into
Conversation
kamranf
force-pushed
the
kamranf/decouple-profiler-from-instrumentation
branch
from
July 14, 2026 14:22
9e10c9e to
0b9ea7a
Compare
The profiler was gated on `enabled` — the same flag that turns on tracing — so every service with `enabled: true` also ran the continuous profiler. That makes the profiler impossible to turn off without also losing tracing, and drives up continuous-profiler per-host usage in environments where profiling isn't needed. Add a dedicated `profiler_enabled` setting so the profiler is off by default and controlled independently of `enabled`. Tracing is unaffected. To keep profiling, set `profiler_enabled: true` in the environments where it is wanted (typically production). BREAKING CHANGE: the continuous profiler no longer starts based on `instrumentation.enabled`. It is off unless `instrumentation.profiler_enabled` is true. Services that want profiling (e.g. in production) must opt in by setting `profiler_enabled: true`, otherwise their profiles will stop. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kamranf
force-pushed
the
kamranf/decouple-profiler-from-instrumentation
branch
from
July 14, 2026 14:24
0b9ea7a to
01f560c
Compare
kamranf
marked this pull request as ready for review
July 14, 2026 14:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The continuous profiler is gated on
instrumentation.enabled— the same flag that turns on APM tracing. So every service running withenabled: truealso runs the profiler, and there is no way to keep tracing while turning the profiler off. Because the profiler bills per host, that inflates continuous-profiler host usage in environments where profiling isn't wanted.What
Decouple the profiler from tracing with its own opt-in flag:
config.go: addProfilerEnabled bool(mapstructure:"profiler_enabled").profiler.go:NewProfilernow gates onconfig.ProfilerEnabledinstead ofconfig.Enabled. Tracer gating (router.go, onEnabled) is unchanged.profiler_test.gocovers the gating matrix (off by default, opt-in on, decoupled fromEnabled).Profiling is now off by default and enabled per-environment via
profiler_enabled: true(typically production).The profiler no longer starts based on
instrumentation.enabled. Services that want profiling (e.g. in production) must setprofiler_enabled: true, or their profiles stop on upgrade. Tracing is unaffected. The commit carries aBREAKING CHANGE:footer, so semantic-release cuts a major version.Rollout: after this releases, bump go-sdk in consumer services and set
profiler_enabled: truein their production config where profiling is wanted.Verification
buildjob (go build+go test ./...) passing on this branch.