From 58080e709b9eef78a78b557aa2c91b9790b91b20 Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Sat, 16 Jul 2022 13:40:01 +0800 Subject: [PATCH 1/9] add advance conf for otel-collector --- docker-compose.yml | 67 ++++++++-------------------- src/jaeger/jaeger-ui.json | 8 ++++ src/otelcollector/otelcol-config.yml | 11 ++++- 3 files changed, 36 insertions(+), 50 deletions(-) create mode 100644 src/jaeger/jaeger-ui.json diff --git a/docker-compose.yml b/docker-compose.yml index a2b34682ed..82d96a8e87 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,9 @@ services: jaeger: image: jaegertracing/all-in-one container_name: jaeger + volumes: + - ./src/jaeger/jaeger-ui.json:/etc/jaeger/jaeger-ui.json + command: --query.ui-config /etc/jaeger/jaeger-ui.json ports: - "5775:5775" - "5778:5778" @@ -17,10 +20,12 @@ services: - "14269:14269" environment: - COLLECTOR_ZIPKIN_HOST_PORT + - METRICS_STORAGE_TYPE=prometheus + - PROMETHEUS_SERVER_URL=http://prometheus:9090 # Collector otelcol: - image: otel/opentelemetry-collector:0.52.0 + image: otel/opentelemetry-collector-contrib:0.52.0 container_name: otel-col command: [ "--config=/etc/otelcol-config.yml" ] volumes: @@ -42,11 +47,8 @@ services: # AdService adservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-adservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-adservice container_name: ad-service - build: - context: ./ - dockerfile: ./src/adservice/Dockerfile ports: - "${AD_SERVICE_PORT}" environment: @@ -58,11 +60,8 @@ services: # CartService cartservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-cartservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-cartservice container_name: cart-service - build: - context: ./ - dockerfile: ./src/cartservice/src/Dockerfile ports: - "${CART_SERVICE_PORT}" environment: @@ -77,11 +76,8 @@ services: # CheckoutService checkoutservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-checkoutservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-checkoutservice container_name: checkout-service - build: - context: ./ - dockerfile: ./src/checkoutservice/Dockerfile ports: - "${CHECKOUT_SERVICE_PORT}" environment: @@ -105,13 +101,8 @@ services: # CurrencyService currencyservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-currencyservice container_name: currency-service - build: - context: ./src/currencyservice - args: - - GRPC_VERSION=1.46.0 - - OPENTELEMETRY_VERSION=1.4.0 ports: - "${CURRENCY_SERVICE_PORT}" environment: @@ -123,10 +114,8 @@ services: # EmailService emailservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-emailservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-emailservice container_name: email-service - build: - context: ./src/emailservice ports: - "${EMAIL_SERVICE_PORT}" environment: @@ -139,11 +128,8 @@ services: # Frontend frontend: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-frontend + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-frontend container_name: frontend - build: - context: ./ - dockerfile: ./src/frontend/Dockerfile ports: - "${FRONTEND_PORT}:${FRONTEND_PORT}" environment: @@ -170,11 +156,8 @@ services: # PaymentService paymentservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-paymentservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-paymentservice container_name: payment-service - build: - context: ./ - dockerfile: ./src/paymentservice/Dockerfile ports: - "${PAYMENT_SERVICE_PORT}" environment: @@ -186,11 +169,8 @@ services: # ProductCatalogService productcatalogservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-productcatalogservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-productcatalogservice container_name: product-catalog-service - build: - context: ./ - dockerfile: ./src/productcatalogservice/Dockerfile ports: - "${PRODUCT_CATALOG_SERVICE_PORT}" environment: @@ -202,11 +182,8 @@ services: # RecommendationService recommendationservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-recommendationservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-recommendationservice container_name: recommendation-service - build: - context: ./ - dockerfile: ./src/recommendationservice/Dockerfile ports: - "${RECOMMENDATION_SERVICE_PORT}" depends_on: @@ -221,11 +198,8 @@ services: # ShippingService shippingservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-shippingservice container_name: shipping-service - build: - context: ./ - dockerfile: ./src/shippingservice/Dockerfile ports: - "${SHIPPING_SERVICE_PORT}" environment: @@ -237,10 +211,8 @@ services: # FeatureFlagService featureflagservice: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-featureflagservice + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-featureflagservice container_name: feature-flag-service - build: - context: ./src/featureflagservice ports: - "${FEATURE_FLAG_SERVICE_PORT}:${FEATURE_FLAG_SERVICE_PORT}" - "${FEATURE_FLAG_GRPC_SERVICE_PORT}" @@ -263,11 +235,8 @@ services: # LoadGenerator loadgenerator: - image: ${IMAGE_NAME}:${IMAGE_VERSION}-loadgenerator + image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-loadgenerator container_name: load-generator - build: - context: ./ - dockerfile: ./src/loadgenerator/Dockerfile environment: - FRONTEND_ADDR - USERS diff --git a/src/jaeger/jaeger-ui.json b/src/jaeger/jaeger-ui.json new file mode 100644 index 0000000000..b435b6ffa6 --- /dev/null +++ b/src/jaeger/jaeger-ui.json @@ -0,0 +1,8 @@ +{ + "monitor": { + "menuEnabled": true + }, + "dependencies": { + "menuEnabled": true + } +} diff --git a/src/otelcollector/otelcol-config.yml b/src/otelcollector/otelcol-config.yml index 2662741172..5bec05ca69 100644 --- a/src/otelcollector/otelcol-config.yml +++ b/src/otelcollector/otelcol-config.yml @@ -3,6 +3,10 @@ receivers: protocols: grpc: http: + otlp/spanmetrics: + protocols: + grpc: + endpoint: "localhost:65535" exporters: jaeger: @@ -16,14 +20,19 @@ exporters: processors: batch: + spanmetrics: + metrics_exporter: prometheus service: pipelines: traces: receivers: [otlp] - processors: [batch] + processors: [spanmetrics,batch] exporters: [logging, jaeger] metrics: receivers: [otlp] processors: [batch] exporters: [prometheus, logging] + metrics/spanmetrics: + receivers: [ otlp/spanmetrics ] + exporters: [ prometheus ] From 42f6466717cc070595b50554b972b0c37cdcbba5 Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Fri, 22 Jul 2022 10:57:38 +0800 Subject: [PATCH 2/9] undo not relate change --- docker-compose.yml | 60 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 82d96a8e87..d9f8c79444 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,8 +47,11 @@ services: # AdService adservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-adservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-adservice container_name: ad-service + build: + context: ./ + dockerfile: ./src/adservice/Dockerfile ports: - "${AD_SERVICE_PORT}" environment: @@ -60,8 +63,11 @@ services: # CartService cartservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-cartservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-cartservice container_name: cart-service + build: + context: ./ + dockerfile: ./src/cartservice/src/Dockerfile ports: - "${CART_SERVICE_PORT}" environment: @@ -76,8 +82,11 @@ services: # CheckoutService checkoutservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-checkoutservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-checkoutservice container_name: checkout-service + build: + context: ./ + dockerfile: ./src/checkoutservice/Dockerfile ports: - "${CHECKOUT_SERVICE_PORT}" environment: @@ -101,8 +110,13 @@ services: # CurrencyService currencyservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-currencyservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice container_name: currency-service + build: + context: ./src/currencyservice + args: + - GRPC_VERSION=1.46.0 + - OPENTELEMETRY_VERSION=1.4.0 ports: - "${CURRENCY_SERVICE_PORT}" environment: @@ -114,8 +128,10 @@ services: # EmailService emailservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-emailservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-emailservice container_name: email-service + build: + context: ./src/emailservice ports: - "${EMAIL_SERVICE_PORT}" environment: @@ -128,8 +144,11 @@ services: # Frontend frontend: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-frontend + image: ${IMAGE_NAME}:${IMAGE_VERSION}-frontend container_name: frontend + build: + context: ./ + dockerfile: ./src/frontend/Dockerfile ports: - "${FRONTEND_PORT}:${FRONTEND_PORT}" environment: @@ -156,8 +175,11 @@ services: # PaymentService paymentservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-paymentservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-paymentservice container_name: payment-service + build: + context: ./ + dockerfile: ./src/paymentservice/Dockerfile ports: - "${PAYMENT_SERVICE_PORT}" environment: @@ -169,8 +191,11 @@ services: # ProductCatalogService productcatalogservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-productcatalogservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-productcatalogservice container_name: product-catalog-service + build: + context: ./ + dockerfile: ./src/productcatalogservice/Dockerfile ports: - "${PRODUCT_CATALOG_SERVICE_PORT}" environment: @@ -182,8 +207,11 @@ services: # RecommendationService recommendationservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-recommendationservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-recommendationservice container_name: recommendation-service + build: + context: ./ + dockerfile: ./src/recommendationservice/Dockerfile ports: - "${RECOMMENDATION_SERVICE_PORT}" depends_on: @@ -198,8 +226,11 @@ services: # ShippingService shippingservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-shippingservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice container_name: shipping-service + build: + context: ./ + dockerfile: ./src/shippingservice/Dockerfile ports: - "${SHIPPING_SERVICE_PORT}" environment: @@ -211,8 +242,10 @@ services: # FeatureFlagService featureflagservice: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-featureflagservice + image: ${IMAGE_NAME}:${IMAGE_VERSION}-featureflagservice container_name: feature-flag-service + build: + context: ./src/featureflagservice ports: - "${FEATURE_FLAG_SERVICE_PORT}:${FEATURE_FLAG_SERVICE_PORT}" - "${FEATURE_FLAG_GRPC_SERVICE_PORT}" @@ -235,8 +268,11 @@ services: # LoadGenerator loadgenerator: - image: ghcr.io/open-telemetry/demo:v0.2.0-alpha-loadgenerator + image: ${IMAGE_NAME}:${IMAGE_VERSION}-loadgenerator container_name: load-generator + build: + context: ./ + dockerfile: ./src/loadgenerator/Dockerfile environment: - FRONTEND_ADDR - USERS From 19926a88b1b63e16b2d5dd164eb714cd05407283 Mon Sep 17 00:00:00 2001 From: Murphy Chen Date: Thu, 28 Jul 2022 08:13:09 +0800 Subject: [PATCH 3/9] Apply suggestions from code review Co-authored-by: Cijo Thomas --- src/otelcollector/otelcol-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/otelcollector/otelcol-config.yml b/src/otelcollector/otelcol-config.yml index 5bec05ca69..36aeead78c 100644 --- a/src/otelcollector/otelcol-config.yml +++ b/src/otelcollector/otelcol-config.yml @@ -27,7 +27,7 @@ service: pipelines: traces: receivers: [otlp] - processors: [spanmetrics,batch] + processors: [spanmetrics, batch] exporters: [logging, jaeger] metrics: receivers: [otlp] From 2d1c2d32dcf0d6fbc4ed9a85e42794b258781358 Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Thu, 28 Jul 2022 08:17:00 +0800 Subject: [PATCH 4/9] apply reviewer's suggestion --- src/otelcollector/otelcol-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/otelcollector/otelcol-config.yml b/src/otelcollector/otelcol-config.yml index 36aeead78c..8dc9950445 100644 --- a/src/otelcollector/otelcol-config.yml +++ b/src/otelcollector/otelcol-config.yml @@ -35,4 +35,4 @@ service: exporters: [prometheus, logging] metrics/spanmetrics: receivers: [ otlp/spanmetrics ] - exporters: [ prometheus ] + exporters: [ prometheus, logging ] From b31861bd1ae66426c4fda112819ee371d9b6ab22 Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Mon, 1 Aug 2022 16:14:59 +0800 Subject: [PATCH 5/9] apply reviewer's suggestion --- docker-compose.yml | 5 ----- src/jaeger/jaeger-ui.json | 8 -------- 2 files changed, 13 deletions(-) delete mode 100644 src/jaeger/jaeger-ui.json diff --git a/docker-compose.yml b/docker-compose.yml index d9f8c79444..2a9ac08dcb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,9 +5,6 @@ services: jaeger: image: jaegertracing/all-in-one container_name: jaeger - volumes: - - ./src/jaeger/jaeger-ui.json:/etc/jaeger/jaeger-ui.json - command: --query.ui-config /etc/jaeger/jaeger-ui.json ports: - "5775:5775" - "5778:5778" @@ -20,8 +17,6 @@ services: - "14269:14269" environment: - COLLECTOR_ZIPKIN_HOST_PORT - - METRICS_STORAGE_TYPE=prometheus - - PROMETHEUS_SERVER_URL=http://prometheus:9090 # Collector otelcol: diff --git a/src/jaeger/jaeger-ui.json b/src/jaeger/jaeger-ui.json deleted file mode 100644 index b435b6ffa6..0000000000 --- a/src/jaeger/jaeger-ui.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "monitor": { - "menuEnabled": true - }, - "dependencies": { - "menuEnabled": true - } -} From be08941e0426d3349b657a02847d0d561251595c Mon Sep 17 00:00:00 2001 From: Murphy Chen Date: Wed, 3 Aug 2022 16:52:46 +0800 Subject: [PATCH 6/9] Apply suggestions from code review Co-authored-by: Juliano Costa --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0f6aef26f4..baaff11f3a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,7 +26,7 @@ services: # Collector otelcol: - image: otel/opentelemetry-collector-contrib:0.52.0 + image: otel/opentelemetry-collector-contrib:0.56.0 container_name: otel-col command: [ "--config=/etc/otelcol-config.yml" ] volumes: From 54fc540a00bd7ba743164a62082959d61c74c8fc Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Thu, 4 Aug 2022 09:37:02 +0800 Subject: [PATCH 7/9] add changelog entry. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea51adbe27..4606dfdf28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,3 +51,5 @@ significant modifications will be credited to OpenTelemetry Authors. ([#244](https://github.com/open-telemetry/opentelemetry-demo/pull/244)) * Pulling java agent from the Java instrumentation releases instead. ([#253](https://github.com/open-telemetry/opentelemetry-demo/pull/253)) +* Added spanmetrics processor to otelcol +(https://github.com/open-telemetry/opentelemetry-demo/pull/212) From aea17a7120a5993205c212e0d1d4f44feb41fc2d Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Thu, 4 Aug 2022 09:42:41 +0800 Subject: [PATCH 8/9] fix markdown --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a0e4427d6..442e8035ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,4 +55,3 @@ significant modifications will be credited to OpenTelemetry Authors. ([#255](https://github.com/open-telemetry/opentelemetry-demo/pull/255)) * Added spanmetrics processor to otelcol ([#212]((https://github.com/open-telemetry/opentelemetry-demo/pull/212))) - From fa2cfb7d0e8beabfa760a1fc2701074bd92346e2 Mon Sep 17 00:00:00 2001 From: Murphy Chen Date: Thu, 4 Aug 2022 10:20:35 +0800 Subject: [PATCH 9/9] Apply suggestions from code review Co-authored-by: JustWPH <2732352+wph95@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 442e8035ed..cc38c355b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,4 +54,4 @@ significant modifications will be credited to OpenTelemetry Authors. * Added explicit support for Kubernetes. ([#255](https://github.com/open-telemetry/opentelemetry-demo/pull/255)) * Added spanmetrics processor to otelcol -([#212]((https://github.com/open-telemetry/opentelemetry-demo/pull/212))) +([#212](https://github.com/open-telemetry/opentelemetry-demo/pull/212))