adservice: enable OpenCensus log correlation

OpenCensus log correlation
(https://github.com/census-instrumentation/opencensus-java/tree/master/contrib/log_correlation/stackdriver)
inserts the trace ID, span ID, and sampling decision into every log entry.  The
tracing data can be used to find all log entries associated with a single trace
or span.

This commit also upgrades OpenCensus to 0.16.1.
This commit is contained in:
Kristen Kozak 2018-09-26 18:29:05 -07:00
parent 338612caf7
commit ff7502fbab
2 changed files with 4 additions and 1 deletions

View file

@ -25,7 +25,7 @@ repositories {
group = "adservice"
version = "0.1.0-SNAPSHOT" // CURRENT_OPENCENSUS_VERSION
def opencensusVersion = "0.15.0" // LATEST_OPENCENSUS_RELEASE_VERSION
def opencensusVersion = "0.16.1" // LATEST_OPENCENSUS_RELEASE_VERSION
def grpcVersion = "1.15.0" // CURRENT_GRPC_VERSION
def prometheusVersion = "0.3.0"
@ -56,6 +56,7 @@ dependencies {
runtime "com.google.cloud:google-cloud-logging:1.45.0",
"io.opencensus:opencensus-impl:${opencensusVersion}",
"io.opencensus:opencensus-contrib-log-correlation-stackdriver:${opencensusVersion}",
"io.netty:netty-tcnative-boringssl-static:2.0.8.Final"
}
}

View file

@ -10,3 +10,5 @@ handlers=com.google.cloud.logging.LoggingHandler
com.google.cloud.logging.LoggingHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=%3$s: %5$s%6$s
com.google.cloud.logging.LoggingHandler.enhancers=io.opencensus.contrib.logcorrelation.stackdriver.OpenCensusTraceLoggingEnhancer