Skip to content

Commit a96d45f

Browse files
authored
simplify logging in instrumentation quickstart (#298)
1 parent d1f8b66 commit a96d45f

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

examples/instrumentation-quickstart/docker-compose.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ services:
2121
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4317
2222
- OTEL_SERVICE_NAME=otel-quickstart-spring-boot
2323
- OTEL_METRIC_EXPORT_INTERVAL=5000
24-
- GOOGLE_CLOUD_PROJECT
2524
volumes:
2625
- logs:/var/log:rw
2726
depends_on:

examples/instrumentation-quickstart/otel-collector-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ receivers:
4646
- type: regex_parser
4747
parse_from: body["logging.googleapis.com/trace"]
4848
parse_to: body
49-
regex: projects/.+/traces/(?P<trace_id>.*)
49+
regex: (?P<trace_id>.*)
5050
trace:
5151
span_id:
5252
parse_from: body["logging.googleapis.com/spanId"]

examples/instrumentation-quickstart/src/main/resources/logback.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<provider class="net.logstash.logback.composite.loggingevent.LoggingEventPatternJsonProvider">
2424
<pattern>
2525
{
26-
"logging.googleapis.com/trace": "projects/${GOOGLE_CLOUD_PROJECT}/traces/%mdc{trace_id}",
26+
"logging.googleapis.com/trace": "%mdc{trace_id}",
2727
"logging.googleapis.com/spanId": "%mdc{span_id}",
2828
"logging.googleapis.com/trace_sampled": "#asBoolean{%replace(%mdc{trace_flags}){'01', 'true'}}"
2929
}

0 commit comments

Comments
 (0)