From d08d419a943d21ed6ab359b236167f98b5b5d1a6 Mon Sep 17 00:00:00 2001 From: sebright Date: Thu, 28 Feb 2019 21:34:57 -0800 Subject: [PATCH] adservice: use Stackdriver special field to set sampling decision in log entries (#168) This commit sets the new sampling decision field that is recognized by the Stackdriver Logging agent, "logging.googleapis.com/traceSampled". The sampling decision field was added in https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/pull/297, and it won't be available until the new version of fluent-plugin-google-cloud is used in GKE. --- src/adservice/src/main/resources/log4j2.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/adservice/src/main/resources/log4j2.xml b/src/adservice/src/main/resources/log4j2.xml index 9d85f97..dbb8cb1 100644 --- a/src/adservice/src/main/resources/log4j2.xml +++ b/src/adservice/src/main/resources/log4j2.xml @@ -4,12 +4,15 @@ + span ID, sampling decision, and timestamp are interpreted by Stackdriver. It uses the + special JSON keys that the Stackdriver Logging agent converts to "trace", "spanId", + "traceSampled", and "timestamp" in the Stackdriver LogEntry + (https://cloud.google.com/logging/docs/agent/configuration#special-fields). --> + - +