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:
parent
338612caf7
commit
ff7502fbab
2 changed files with 4 additions and 1 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue