Skip to content

Instantly share code, notes, and snippets.

@DaGeRe
Last active June 4, 2025 13:26
Show Gist options
  • Select an option

  • Save DaGeRe/d49d72d5a029a5d3b78e52b1f9db65c1 to your computer and use it in GitHub Desktop.

Select an option

Save DaGeRe/d49d72d5a029a5d3b78e52b1f9db65c1 to your computer and use it in GitHub Desktop.
OpenTelemetry to Kieker Demo

OpenTelemetry Kieker Demo

To run the OpenTelemetry demo using Kieker, run the following steps:

  1. Start the kieker listener:
git clone -b GH-13-GetOERFromProto git@github.com:kieker-monitoring/kieker.git
cd kieker/
cd tools/otel-transformer
../../gradlew assemble
cd build/distributions
unzip otel-transformer-2.0.3-SNAPSHOT.zip
cd otel-transformer-2.0.3-SNAPSHOT/
bin/otel-transformer -lp 9000 -standard OPENTELEMETRY

(leave this process running, and stop via Ctrl + C after running the demo)

  1. Prepare the OpenTelemetry demo: git clone https://github.com/open-telemetry/opentelemetry-demo.git
  2. Edit the repo (go to opentelemetry-demo first):
  • Edit src/otel-collector/otelcol-config-extras.yml: Add (replacing $MYIP by your IP):
exporters:
  otlp/example:
    endpoint: http://$MYIP:9000
    tls:
      insecure: true
      
service:
  pipelines:
    traces:
      exporters: [spanmetrics, otlp/example]
  • Edit docker-compose.yml: Add - _JAVA_OPTIONS=-Dotel.instrumentation.methods.include=oteldemo.AdService[main,getInstance,getAdsByCategory,getRandomAds,createAdsMap,start,stop,blockUntilShutdown];oteldemo.AdService.AdServiceImpl[getAds];oteldemo.problempattern.CPULoad[getInstance,execute,spawnLoadWorkers,stopWorkers] to the AdService
  1. Run the demo (in opentelemetry-demo)
  • Run make start
  • Do anything you'd like to do with the interface
  • Run docker compose down -v
  1. Visualize the results within Kieker (replacing $KIEKERPATH with the path the listener showed you):
cd tools/trace-analysis
../../gradlew assemble
cd build/distributions
unzip trace-analysis-2.0.3-SNAPSHOT.zip
cd trace-analysis-2.0.3-SNAPSHOT/
mkdir graphs
bin/trace-analysis \
  -i $KIEKERPATH \
  -o graphs \
  --plot-Deployment-Component-Dependency-Graph responseTimes-ms \
  --plot-Deployment-Operation-Dependency-Graph responseTimes-ms \
  --plot-Aggregated-Deployment-Call-Tree \
  --plot-Aggregated-Assembly-Call-Tree
cd graphs
for file in *.dot; do dot -Tpng $file -o $file.png; done
@shinhyungyang
Copy link

shinhyungyang commented Jun 4, 2025

@DaGeRe

Thanks for having a look at the problem on my laptop during yesterday's Kieker meeting. Today I also solved this issue on my office laptop including the ulimits issue.

I have re-installed docker several times, so I cannot point out where the problem was, but a clean docker installation should work.

diff --git a/docker-compose.yml b/docker-compose.yml
index 85f9ee5..73eb1d6 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -72,7 +72,7 @@ services:
       - OTEL_LOGS_EXPORTER=otlp
       - OTEL_SERVICE_NAME=ad
       # Workaround on OSX for https://bugs.openjdk.org/browse/JDK-8345296
-      - _JAVA_OPTIONS
+      - _JAVA_OPTIONS=-Dotel.instrumentation.methods.include=oteldemo.AdService[main,getInstance,getAdsByCategory,getRandomAds,createAdsMap,start,stop,blockUntilShutdown];oteldemo.AdService.AdServiceImpl[getAds];oteldemo.problempattern.CPULoad[getInstance,execute,spawnLoadWorkers,stopWorkers]
     depends_on:
       otel-collector:
         condition: service_started
diff --git a/src/otel-collector/otelcol-config-extras.yml b/src/otel-collector/otelcol-config-extras.yml
index 73dd011..15b2721 100644
--- a/src/otel-collector/otelcol-config-extras.yml
+++ b/src/otel-collector/otelcol-config-extras.yml
@@ -8,11 +8,13 @@
 ## Note: the spanmetrics exporter must be included in the exporters array
 ## if overriding the traces pipeline.
 ##
-#  exporters:
-#    otlphttp/example:
-#      endpoint: <your-endpoint-url>
-#
-#  service:
-#    pipelines:
-#      traces:
-#        exporters: [spanmetrics, otlphttp/example]
+exporters:
+  otlp/example:
+    endpoint: http://172.19.233.3:9000
+    tls:
+      insecure: true
+
+service:
+  pipelines:
+    traces:
+      exporters: [spanmetrics, otlp/example]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment