fix(agent): make telemetry explicitly opt-in#894
Merged
Conversation
Collaborator
Author
|
@copilot resolve the merge conflicts in this pull request |
Contributor
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.
Summary
telemetry=true|falseagent argument with agent-argument precedence over the legacy target-JVM propertyWhy
The agent previously treated telemetry as enabled when
btrace.telemetrywas absent, so normal startup created daemon threads and could perform DNS and HTTP work from inside the target JVM without operator consent. That default is inappropriate for production diagnostics and contradicts the security policy established by #872.Consent is now evaluated before payload construction or thread creation. Only a literal boolean
truefrom the agent argument, an explicit packaged agent default, or the legacy system property enables telemetry. An explicit agent-levelfalsewins over the property.User impact
Default agent startup performs no telemetry-related DNS or network operation. Operators who opt in get one attempted
agent_startevent; endpoint or thread-start failures remain isolated from agent startup. The event continues to use a fresh random identifier and does not add stable host identity or application data.Validation
GRADLE_USER_HOME=$(pwd)/.gradle-user ./gradlew :btrace-agent:test --tests 'io.btrace.agent.TelemetryTest'GRADLE_USER_HOME=$(pwd)/.gradle-user ./gradlew :btrace-agent:testGRADLE_USER_HOME=$(pwd)/.gradle-user ./gradlew spotlessCheckgit diff --checkThe focused tests and full agent suite passed with a temporary, uncommitted restoration of
btrace-agent's JUnit pin to 5.14.4. Currentdevelopcommitf8cdc5deaccidentally pins JUnit 6.1.2 while compiling tests with JDK 8, so the unmodified baseline cannot resolvetestCompileClasspath. This PR intentionally does not mix that unrelated build regression into the telemetry diff.Stack
Closes #873
This change is