Skip to content

Commit

Permalink
feat: decrease stack traces min duration (#35)
Browse files Browse the repository at this point in the history
* feat: decrease stack traces min duration

* docs: add kafka agent modification
  • Loading branch information
rogercoll authored Jul 29, 2024
1 parent a6e630d commit ca8e0f4
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.override
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ IMAGE_NAME=ghcr.io/elastic/opentelemetry-demo
# *********************
AD_SERVICE_DOCKERFILE=./src/adservice/Dockerfile.elastic
FRAUD_SERVICE_DOCKERFILE=./src/frauddetectionservice/Dockerfile.elastic
KAFKA_SERVICE_DOCKERFILE=./src/kafka/Dockerfile.elastic

# *********************
# Elastic Collector
Expand Down
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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:

- 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).
- 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).
- 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).
- 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).

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/component_build-images-elastic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
tag_suffix: imageprovider
context: ./
setup-qemu: true
- file: ./src/kafka/Dockerfile
- file: ./src/kafka/Dockerfile.elastic
tag_suffix: kafka
context: ./
setup-qemu: true
Expand Down
1 change: 1 addition & 0 deletions src/adservice/Dockerfile.elastic
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ COPY --from=builder /usr/src/app/ ./
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
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar
ENV ELASTIC_OTEL_INFERRED_SPANS_ENABLED=true
ENV ELASTIC_OTEL_SPAN_STACK_TRACE_MIN_DURATION=2

EXPOSE ${AD_SERVICE_PORT}
ENTRYPOINT [ "./build/install/opentelemetry-demo-ad-service/bin/AdService" ]
1 change: 1 addition & 0 deletions src/frauddetectionservice/Dockerfile.elastic
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ COPY --from=builder /usr/src/app/build/libs/frauddetectionservice-1.0-all.jar ./
ADD --chmod=644 https://repo1.maven.org/maven2/co/elastic/otel/elastic-otel-javaagent/$version/elastic-otel-javaagent-$version.jar /app/opentelemetry-javaagent.jar
ENV JAVA_TOOL_OPTIONS=-javaagent:/app/opentelemetry-javaagent.jar
ENV ELASTIC_OTEL_INFERRED_SPANS_ENABLED=true
ENV ELASTIC_OTEL_SPAN_STACK_TRACE_MIN_DURATION=2

ENTRYPOINT [ "java", "-jar", "frauddetectionservice-1.0-all.jar" ]
30 changes: 30 additions & 0 deletions src/kafka/Dockerfile.elastic
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0


FROM apache/kafka:3.7.0

USER root
ARG version=0.4.0

USER appuser

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

ENV ELASTIC_OTEL_INFERRED_SPANS_ENABLED=true
ENV ELASTIC_OTEL_SPAN_STACK_TRACE_MIN_DURATION=2
ENV KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093
ENV KAFKA_CONTROLLER_QUORUM_VOTERS='[email protected]:9093'
ENV KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER
ENV KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
ENV KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
ENV KAFKA_PROCESS_ROLES=controller,broker
ENV KAFKA_NODE_ID=1
ENV KAFKA_METADATA_LOG_SEGMENT_MS=15000
ENV KAFKA_METADATA_MAX_RETENTION_MS=60000
ENV KAFKA_METADATA_LOG_MAX_RECORD_BYTES_BETWEEN_SNAPSHOTS=2800
ENV KAFKA_AUTO_CREATE_TOPICS_ENABLE=true
ENV KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
ENV KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1
ENV KAFKA_OPTS="-javaagent:/tmp/opentelemetry-javaagent.jar -Dotel.jmx.target.system=kafka-broker"
ENV CLUSTER_ID=ckjPoprWQzOf0-FuNkGfFQ

0 comments on commit ca8e0f4

Please sign in to comment.