From 288aa64a5e0c39cabc758ef922b0587720914806 Mon Sep 17 00:00:00 2001 From: Giovanni Berti Date: Wed, 12 Jul 2023 17:18:08 +0200 Subject: [PATCH] feat(tracing): use OpenTelemtry agent instead of Elastic APM --- Dockerfile | 4 ++-- helm/values-dev.yaml | 10 +++++----- helm/values-prod.yaml | 20 ++++++++++---------- helm/values-uat.yaml | 20 ++++++++++---------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index b11f126b..fde12263 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ WORKDIR /app/ ARG EXTRACTED=/workspace/app/target/extracted # ELK apm agent -ADD --chown=user https://search.maven.org/remotecontent?filepath=co/elastic/apm/elastic-apm-agent/1.38.0/elastic-apm-agent-1.38.0.jar ./apm-elk-agent.jar +ADD --chown=user https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar . COPY --from=build --chown=user ${EXTRACTED}/dependencies/ ./ RUN true @@ -37,4 +37,4 @@ COPY --from=build --chown=user ${EXTRACTED}/application/ ./ RUN true -ENTRYPOINT ["java","-javaagent:apm-elk-agent.jar","--enable-preview","org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java","-javaagent:opentelemetry-javaagent.jar","--enable-preview","org.springframework.boot.loader.JarLauncher"] diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 9bceec8f..f664b160 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -81,16 +81,16 @@ microservice-chart: PENDING_TRANSACTIONS_MAX_TRANSACTIONS_PER_PAGE: "5" PENDING_TRANSACTIONS_PAGE_ANALYSIS_DELAY_SECONDS: "1" PENDING_TRANSACTIONS_SEND_PAYMENT_RESULT_TIMEOUT_SECONDS: "3900" - ELASTIC_APM_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service - ELASTIC_APM_APPLICATION_PACKAGES: it.pagopa.ecommerce.transactions.scheduler - ELASTIC_APM_SERVER_URL: http://quickstart-apm-http.elastic-system.svc:8200 - ELASTIC_APM_LOG_SENDING: "false" + OTEL_RESOURCE_ATTRIBUTES: "service.name=pagopa-ecommerce-transactions-scheduler-service,service.deployment.environment=dev" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" + OTEL_LOGS_EXPORTER: none + OTEL_TRACES_SAMPLER: "always_on" ECS_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service ECS_SERVICE_ENVIRONMENT: "dev" envSecret: MONGO_PASSWORD: mongo-ecommerce-password QUEUE_TRANSIENT_CONNECTION_STRING: ecommerce-storage-transient-connection-string - ELASTIC_APM_SECRET_TOKEN: elastic-apm-secret-token + OTEL_EXPORTER_OTLP_HEADERS: elastic-otel-token-header keyvault: name: "pagopa-d-ecommerce-kv" tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 5e92e16c..b9e4accb 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -30,16 +30,16 @@ microservice-chart: PENDING_TRANSACTIONS_PAGE_ANALYSIS_DELAY_SECONDS: "1" PENDING_TRANSACTIONS_SEND_PAYMENT_RESULT_TIMEOUT_SECONDS: "3900" TRANSIENT_QUEUES_TTL_SECONDS: "2592000" - ELASTIC_APM_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service-blue - ELASTIC_APM_APPLICATION_PACKAGES: it.pagopa.ecommerce.transactions.scheduler - ELASTIC_APM_SERVER_URL: http://quickstart-apm-http.elastic-system.svc:8200 - ELASTIC_APM_LOG_SENDING: "false" + OTEL_RESOURCE_ATTRIBUTES: "service.name=pagopa-ecommerce-transactions-scheduler-service-blue,service.deployment.environment=prod" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" + OTEL_LOGS_EXPORTER: none + OTEL_TRACES_SAMPLER: "always_on" ECS_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service-blue ECS_SERVICE_ENVIRONMENT: "prod" envSecret: MONGO_PASSWORD: mongo-ecommerce-password QUEUE_TRANSIENT_CONNECTION_STRING: ecommerce-storage-transient-connection-string - ELASTIC_APM_SECRET_TOKEN: elastic-apm-secret-token + OTEL_EXPORTER_OTLP_HEADERS: elastic-otel-token-header image: repository: pagopapcommonacr.azurecr.io/pagopaecommercetransactionsschedulerservice tag: "0.2.8" @@ -120,16 +120,16 @@ microservice-chart: PENDING_TRANSACTIONS_PARALLEL_EVENTS_TO_PROCESS: "1" PENDING_TRANSACTIONS_SEND_PAYMENT_RESULT_TIMEOUT_SECONDS: "3900" TRANSIENT_QUEUES_TTL_SECONDS: "2592000" - ELASTIC_APM_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service - ELASTIC_APM_APPLICATION_PACKAGES: it.pagopa.ecommerce.transactions.scheduler - ELASTIC_APM_SERVER_URL: http://quickstart-apm-http.elastic-system.svc:8200 - ELASTIC_APM_LOG_SENDING: "false" + OTEL_RESOURCE_ATTRIBUTES: "service.name=pagopa-ecommerce-transactions-scheduler-service,service.deployment.environment=prod" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" + OTEL_LOGS_EXPORTER: none + OTEL_TRACES_SAMPLER: "always_on" ECS_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service ECS_SERVICE_ENVIRONMENT: "prod" envSecret: MONGO_PASSWORD: mongo-ecommerce-password QUEUE_TRANSIENT_CONNECTION_STRING: ecommerce-storage-transient-connection-string - ELASTIC_APM_SECRET_TOKEN: elastic-apm-secret-token + OTEL_EXPORTER_OTLP_HEADERS: elastic-otel-token-header keyvault: name: "pagopa-p-ecommerce-kv" tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d" diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 2723685f..f042cf24 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -29,16 +29,16 @@ microservice-chart: PENDING_TRANSACTIONS_MAX_TRANSACTIONS_PER_PAGE: "5" PENDING_TRANSACTIONS_PAGE_ANALYSIS_DELAY_SECONDS: "1" PENDING_TRANSACTIONS_SEND_PAYMENT_RESULT_TIMEOUT_SECONDS: "3900" - ELASTIC_APM_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service-blue - ELASTIC_APM_APPLICATION_PACKAGES: it.pagopa.ecommerce.transactions.scheduler - ELASTIC_APM_SERVER_URL: http://quickstart-apm-http.elastic-system.svc:8200 - ELASTIC_APM_LOG_SENDING: "false" + OTEL_RESOURCE_ATTRIBUTES: "service.name=pagopa-ecommerce-transactions-scheduler-service-blue,service.deployment.environment=uat" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" + OTEL_LOGS_EXPORTER: none + OTEL_TRACES_SAMPLER: "always_on" ECS_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service-blue ECS_SERVICE_ENVIRONMENT: "uat" envSecret: MONGO_PASSWORD: mongo-ecommerce-password QUEUE_TRANSIENT_CONNECTION_STRING: ecommerce-storage-transient-connection-string - ELASTIC_APM_SECRET_TOKEN: elastic-apm-secret-token + OTEL_EXPORTER_OTLP_HEADERS: elastic-otel-token-header image: repository: pagopaucommonacr.azurecr.io/pagopaecommercetransactionsschedulerservice tag: "0.2.8" @@ -118,16 +118,16 @@ microservice-chart: PENDING_TRANSACTIONS_MAX_TRANSACTIONS_PER_PAGE: "5" PENDING_TRANSACTIONS_PAGE_ANALYSIS_DELAY_SECONDS: "1" PENDING_TRANSACTIONS_SEND_PAYMENT_RESULT_TIMEOUT_SECONDS: "3900" - ELASTIC_APM_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service - ELASTIC_APM_APPLICATION_PACKAGES: it.pagopa.ecommerce.transactions.scheduler - ELASTIC_APM_SERVER_URL: http://quickstart-apm-http.elastic-system.svc:8200 - ELASTIC_APM_LOG_SENDING: "false" + OTEL_RESOURCE_ATTRIBUTES: "service.name=pagopa-ecommerce-transactions-scheduler-service,service.deployment.environment=uat" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" + OTEL_LOGS_EXPORTER: none + OTEL_TRACES_SAMPLER: "always_on" ECS_SERVICE_NAME: pagopa-ecommerce-transactions-scheduler-service ECS_SERVICE_ENVIRONMENT: "uat" envSecret: MONGO_PASSWORD: mongo-ecommerce-password QUEUE_TRANSIENT_CONNECTION_STRING: ecommerce-storage-transient-connection-string - ELASTIC_APM_SECRET_TOKEN: elastic-apm-secret-token + OTEL_EXPORTER_OTLP_HEADERS: elastic-otel-token-header keyvault: name: "pagopa-u-ecommerce-kv" tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"