Skip to content

Commit ca8e0f4

Browse files
authored
feat: decrease stack traces min duration (#35)
* feat: decrease stack traces min duration * docs: add kafka agent modification
1 parent a6e630d commit ca8e0f4

File tree

6 files changed

+35
-2
lines changed

6 files changed

+35
-2
lines changed

.env.override

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ IMAGE_NAME=ghcr.io/elastic/opentelemetry-demo
1010
# *********************
1111
AD_SERVICE_DOCKERFILE=./src/adservice/Dockerfile.elastic
1212
FRAUD_SERVICE_DOCKERFILE=./src/frauddetectionservice/Dockerfile.elastic
13+
KAFKA_SERVICE_DOCKERFILE=./src/kafka/Dockerfile.elastic
1314

1415
# *********************
1516
# Elastic Collector

.github/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
The following guide describes how to setup the OpenTelemetry demo with Elastic Observability using [Docker compose](#docker-compose) or [Kubernetes](#kubernetes). This fork introduces several changes to the agents used in the demo:
55

6-
- The Java agent within the [Ad](../src/adservice/Dockerfile.elastic) and [Fraud Detection](../src/frauddetectionservice/Dockerfile.elastic) services have been replaced with the Elastic distribution of the OpenTelemetry Java Agent. You can find more information about the Elastic distribution in [this blog post](https://www.elastic.co/observability-labs/blog/elastic-distribution-opentelemetry-java-agent).
6+
- The Java agent within the [Ad](../src/adservice/Dockerfile.elastic), the [Fraud Detection](../src/frauddetectionservice/Dockerfile.elastic) and the [Kafka](../src/kafka/Dockerfile.elastic) services have been replaced with the Elastic distribution of the OpenTelemetry Java Agent. You can find more information about the Elastic distribution in [this blog post](https://www.elastic.co/observability-labs/blog/elastic-distribution-opentelemetry-java-agent).
77
- The .NET agent within the [Cart service](../src/cartservice/src/Directory.Build.props) has been replaced with the Elastic distribution of the OpenTelemetry .NET Agent. You can find more information about the Elastic distribution in [this blog post](https://www.elastic.co/observability-labs/blog/elastic-opentelemetry-distribution-dotnet-applications).
88
- The Elastic distribution of the OpenTelemetry Node.js Agent has replaced the OpenTelemetry Node.js agent in the [Payment service](../src/paymentservice/package.json). Additional details about the Elastic distribution are available in [this blog post](https://www.elastic.co/observability-labs/blog/elastic-opentelemetry-distribution-node-js).
99

.github/workflows/component_build-images-elastic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
tag_suffix: imageprovider
7373
context: ./
7474
setup-qemu: true
75-
- file: ./src/kafka/Dockerfile
75+
- file: ./src/kafka/Dockerfile.elastic
7676
tag_suffix: kafka
7777
context: ./
7878
setup-qemu: true

src/adservice/Dockerfile.elastic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ COPY --from=builder /usr/src/app/ ./
2323
ADD --chmod=644 https://repo1.maven.org/maven2/co/elastic/otel/elastic-otel-javaagent/$version/elastic-otel-javaagent-$version.jar /usr/src/app/opentelemetry-javaagent.jar
2424
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar
2525
ENV ELASTIC_OTEL_INFERRED_SPANS_ENABLED=true
26+
ENV ELASTIC_OTEL_SPAN_STACK_TRACE_MIN_DURATION=2
2627

2728
EXPOSE ${AD_SERVICE_PORT}
2829
ENTRYPOINT [ "./build/install/opentelemetry-demo-ad-service/bin/AdService" ]

src/frauddetectionservice/Dockerfile.elastic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ COPY --from=builder /usr/src/app/build/libs/frauddetectionservice-1.0-all.jar ./
1717
ADD --chmod=644 https://repo1.maven.org/maven2/co/elastic/otel/elastic-otel-javaagent/$version/elastic-otel-javaagent-$version.jar /app/opentelemetry-javaagent.jar
1818
ENV JAVA_TOOL_OPTIONS=-javaagent:/app/opentelemetry-javaagent.jar
1919
ENV ELASTIC_OTEL_INFERRED_SPANS_ENABLED=true
20+
ENV ELASTIC_OTEL_SPAN_STACK_TRACE_MIN_DURATION=2
2021

2122
ENTRYPOINT [ "java", "-jar", "frauddetectionservice-1.0-all.jar" ]

src/kafka/Dockerfile.elastic

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
5+
FROM apache/kafka:3.7.0
6+
7+
USER root
8+
ARG version=0.4.0
9+
10+
USER appuser
11+
12+
ADD --chown=appuser:appuser https://repo1.maven.org/maven2/co/elastic/otel/elastic-otel-javaagent/$version/elastic-otel-javaagent-$version.jar /tmp/opentelemetry-javaagent.jar
13+
14+
ENV ELASTIC_OTEL_INFERRED_SPANS_ENABLED=true
15+
ENV ELASTIC_OTEL_SPAN_STACK_TRACE_MIN_DURATION=2
16+
ENV KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093
17+
ENV KAFKA_CONTROLLER_QUORUM_VOTERS='[email protected]:9093'
18+
ENV KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER
19+
ENV KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
20+
ENV KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
21+
ENV KAFKA_PROCESS_ROLES=controller,broker
22+
ENV KAFKA_NODE_ID=1
23+
ENV KAFKA_METADATA_LOG_SEGMENT_MS=15000
24+
ENV KAFKA_METADATA_MAX_RETENTION_MS=60000
25+
ENV KAFKA_METADATA_LOG_MAX_RECORD_BYTES_BETWEEN_SNAPSHOTS=2800
26+
ENV KAFKA_AUTO_CREATE_TOPICS_ENABLE=true
27+
ENV KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
28+
ENV KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1
29+
ENV KAFKA_OPTS="-javaagent:/tmp/opentelemetry-javaagent.jar -Dotel.jmx.target.system=kafka-broker"
30+
ENV CLUSTER_ID=ckjPoprWQzOf0-FuNkGfFQ

0 commit comments

Comments
 (0)