From b4a45fa4c893d07036d7c17c03930e76aeef291b Mon Sep 17 00:00:00 2001 From: linghengqian Date: Sun, 8 Sep 2024 10:10:47 +0800 Subject: [PATCH] Fixes Jaeger Hotrod demo failure on OpenSearch 2.16.0 Signed-off-by: linghengqian --- examples/jaeger-hotrod/README.md | 5 +-- examples/jaeger-hotrod/docker-compose.yml | 32 ++++++++++---------- examples/jaeger-hotrod/pipelines.yaml | 37 +++++++++++++++++++++++ 3 files changed, 56 insertions(+), 18 deletions(-) create mode 100644 examples/jaeger-hotrod/pipelines.yaml diff --git a/examples/jaeger-hotrod/README.md b/examples/jaeger-hotrod/README.md index 87b72b3337..7950bddd3c 100644 --- a/examples/jaeger-hotrod/README.md +++ b/examples/jaeger-hotrod/README.md @@ -7,7 +7,7 @@ This demo will use the revered [Jaeger HotROD](https://github.com/jaegertracing/ #### Demo ``` -docker-compose up -d --build +docker compose up -d ``` The above command will start the Jaeger HotROD sample, Jaeger Agent, OpenTelemetry Collector, Data Prepper, OpenSearch and OpenSearch Dashboards. Wait for few minutes for all the containers to come up, the DataPrepper container will restart until OpenSearch becomes available. @@ -15,5 +15,6 @@ The above command will start the Jaeger HotROD sample, Jaeger Agent, OpenTelemet After the Docker image is running, do the following. * Open the HotROD app at [http://localhost:8080](http://localhost:8080). Press the buttons in the UI to simulate requests. -* Load the OpenSearch Dashboards trace analytics dashboard at [http://localhost:5601/app/observability-dashboards#/trace_analytics/home](http://localhost:5601/app/observability-dashboards#/trace_analytics/home). If that link does not work, you may still be using On OpenSearch 1.1.0 or below. You will need to use [http://localhost:5601/app/trace-analytics-dashboards#/](http://localhost:5601/app/trace-analytics-dashboards#/) instead. You can view traces and the service map here. +* Log in to the OpenSearch Dashboards Web UI at [http://localhost:5601](http://localhost:5601) using the username `admin` and the password `yourStrongPassword123!`. +* Load the OpenSearch Dashboards trace analytics dashboard at [http://localhost:5601/app/observability-traces#/services](http://localhost:5601/app/observability-traces#/services). If that link does not work, you may still be using On OpenSearch 1.1.0 or below. You will need to use [http://localhost:5601/app/trace-analytics-dashboards#/](http://localhost:5601/app/trace-analytics-dashboards#/) instead. You can view traces and the service map here. diff --git a/examples/jaeger-hotrod/docker-compose.yml b/examples/jaeger-hotrod/docker-compose.yml index 879d9ec16d..5e15860dc7 100644 --- a/examples/jaeger-hotrod/docker-compose.yml +++ b/examples/jaeger-hotrod/docker-compose.yml @@ -1,28 +1,24 @@ -version: "3.7" services: data-prepper: restart: unless-stopped - container_name: data-prepper image: opensearchproject/data-prepper:2 volumes: - - ../trace_analytics_no_ssl_2x.yml:/usr/share/data-prepper/pipelines/pipelines.yaml + - ./pipelines.yaml:/usr/share/data-prepper/pipelines/pipelines.yaml - ../data-prepper-config.yaml:/usr/share/data-prepper/config/data-prepper-config.yaml - - ../demo/root-ca.pem:/usr/share/data-prepper/root-ca.pem + - opensearch-config:/usr/share/opensearch-test/:ro ports: - "21890:21890" networks: - my_network depends_on: - - "opensearch" + - opensearch otel-collector: - container_name: otel-collector image: otel/opentelemetry-collector:0.64.1 command: [ "--config=/etc/otel-collector-config.yml" ] working_dir: "/project" volumes: - ${PWD}/:/project - ./otel-collector-config.yml:/etc/otel-collector-config.yml - - ../demo/demo-data-prepper.crt:/etc/demo-data-prepper.crt ports: - "14250:14250" depends_on: @@ -30,7 +26,6 @@ services: networks: - my_network jaeger-agent: - container_name: jaeger-agent image: jaegertracing/jaeger-agent:1.51.0 command: [ "--reporter.grpc.host-port=otel-collector:14250" ] ports: @@ -40,6 +35,8 @@ services: - "5778:5778/tcp" networks: - my_network + depends_on: + - otel-collector jaeger-hot-rod: image: jaegertracing/example-hotrod:1.41.0 command: [ "all" ] @@ -54,11 +51,14 @@ services: - my_network opensearch: container_name: node-0.example.com - image: opensearchproject/opensearch:2.9.0 + image: opensearchproject/opensearch:2.16.0 environment: - discovery.type=single-node - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=yourStrongPassword123! + volumes: + - opensearch-config:/usr/share/opensearch/config/ ulimits: memlock: soft: -1 @@ -67,17 +67,15 @@ services: soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems hard: 65536 ports: - - 9200:9200 - - 9600:9600 # required for Performance Analyzer + - "9200:9200" + - "9600:9600" # required for Performance Analyzer networks: - my_network dashboards: - image: opensearchproject/opensearch-dashboards:2.9.0 + image: opensearchproject/opensearch-dashboards:2.16.0 container_name: opensearch-dashboards ports: - - 5601:5601 - expose: - - "5601" + - "5601:5601" environment: OPENSEARCH_HOSTS: '["https://node-0.example.com:9200"]' depends_on: @@ -85,4 +83,6 @@ services: networks: - my_network networks: - my_network: \ No newline at end of file + my_network: +volumes: + opensearch-config: diff --git a/examples/jaeger-hotrod/pipelines.yaml b/examples/jaeger-hotrod/pipelines.yaml new file mode 100644 index 0000000000..ef9ec67dba --- /dev/null +++ b/examples/jaeger-hotrod/pipelines.yaml @@ -0,0 +1,37 @@ +entry-pipeline: + delay: "100" + source: + otel_trace_source: + ssl: false + sink: + - pipeline: + name: "raw-pipeline" + - pipeline: + name: "service-map-pipeline" +raw-pipeline: + source: + pipeline: + name: "entry-pipeline" + processor: + - otel_trace_raw: + sink: + - opensearch: + hosts: [ "https://node-0.example.com:9200" ] + cert: "/usr/share/opensearch-test/root-ca.pem" + username: "admin" + password: "yourStrongPassword123!" + index_type: trace-analytics-raw +service-map-pipeline: + delay: "100" + source: + pipeline: + name: "entry-pipeline" + processor: + - service_map_stateful: + sink: + - opensearch: + hosts: ["https://node-0.example.com:9200"] + cert: "/usr/share/opensearch-test/root-ca.pem" + username: "admin" + password: "yourStrongPassword123!" + index_type: trace-analytics-service-map