Skip to content

Commit ffe98d8

Browse files
authored
Disables self-tracing by default (openzipkin#1201)
* Switches self-tracing to use sql query constant * Disables self-tracing by default
1 parent 725804e commit ffe98d8

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

zipkin-autoconfigure/storage-mysql/src/main/java/zipkin/autoconfigure/storage/mysql/brave/TraceZipkinMySQLStorageAutoConfiguration.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
import zipkin.Endpoint;
3838
import zipkin.autoconfigure.storage.mysql.ZipkinMySQLStorageProperties;
3939

40+
import static zipkin.TraceKeys.SQL_QUERY;
41+
4042
/** Sets up the MySQL tracing in Brave as an initialization. */
4143
@ConditionalOnBean(Brave.class)
4244
@ConditionalOnProperty(name = "zipkin.storage.type", havingValue = "mysql")
@@ -89,9 +91,9 @@ public void renderEnd(ExecuteContext ctx) {
8991
brave.clientTracer().startNewSpan(ctx.type().toString().toLowerCase());
9092
String[] batchSQL = ctx.batchSQL();
9193
if (!StringUtils.isBlank(ctx.sql())) {
92-
brave.clientTracer().submitBinaryAnnotation("jdbc.query", ctx.sql());
94+
brave.clientTracer().submitBinaryAnnotation(SQL_QUERY, ctx.sql());
9395
} else if (batchSQL.length > 0 && batchSQL[batchSQL.length - 1] != null) {
94-
brave.clientTracer().submitBinaryAnnotation("jdbc.query", StringUtils.join(batchSQL, '\n'));
96+
brave.clientTracer().submitBinaryAnnotation(SQL_QUERY, StringUtils.join(batchSQL, '\n'));
9597
}
9698
brave.clientTracer()
9799
.setClientSent(mysqlEndpoint.ipv4, mysqlEndpoint.port, mysqlEndpoint.serviceName);

zipkin-server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Zipkin will self-trace calls to the api.
7171

7272
Variable | Property | Description
7373
--- | --- | ---
74-
SELF_TRACING_ENABLED | zipkin.self-tracing.enabled | Set to false to disable self-tracing. Defaults to true
74+
SELF_TRACING_ENABLED | zipkin.self-tracing.enabled | Set to true to enable self-tracing. Defaults to false
7575
SELF_TRACING_SAMPLE_RATE`: Percentage of self-traces to retain, defaults to always sample (1.0).
7676
SELF_TRACING_FLUSH_INTERVAL | zipkin.self-tracing.flush-interval | Interval in seconds to flush self-tracing data to storage. Defaults to 1
7777

zipkin-server/src/main/resources/zipkin-server.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
zipkin:
22
self-tracing:
3-
# Set to false to disable self-tracing.
4-
enabled: ${SELF_TRACING_ENABLED:true}
3+
# Set to true to enable self-tracing.
4+
enabled: ${SELF_TRACING_ENABLED:false}
55
# percentage to self-traces to retain
66
sample-rate: ${SELF_TRACING_SAMPLE_RATE:1.0}
77
# Interval in seconds to flush self-tracing data to storage.

0 commit comments

Comments
 (0)