Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kibana #98

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/deploy_with_github_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
container_app_environment_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_NAME }}
resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }} # RG of the runner
pat_token: ${{ secrets.BOT_TOKEN_GITHUB }}
self_hosted_runner_image_tag: "v1.4.1"

deploy:
needs: [ create_runner ]
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN java -Djarmode=layertools -jar application.jar extract


FROM ghcr.io/pagopa/docker-base-springboot-openjdk11:v1.0.1@sha256:bbbe948e91efa0a3e66d8f308047ec255f64898e7f9250bdb63985efd3a95dbf
ADD --chown=spring:spring https://search.maven.org/remotecontent?filepath=co/elastic/apm/elastic-apm-agent/1.36.0/elastic-apm-agent-1.36.0.jar ./apm-elk-agent.jar
ADD --chown=spring:spring https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar .

COPY --chown=spring:spring --from=builder dependencies/ ./
COPY --chown=spring:spring --from=builder snapshot-dependencies/ ./
Expand All @@ -24,4 +24,4 @@ COPY --chown=spring:spring --from=builder application/ ./

EXPOSE 8080

ENTRYPOINT ["java","-javaagent:apm-elk-agent.jar","-javaagent:applicationinsights-agent.jar","org.springframework.boot.loader.JarLauncher"]
ENTRYPOINT ["java","-javaagent:opentelemetry-javaagent.jar","--enable-preview","org.springframework.boot.loader.JarLauncher"]
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-afm-calculator
description: Microservice that handles calculation for pagoPA Advanced Fees Management
type: application
version: 2.24.0
appVersion: 2.6.6
version: 2.24.5
appVersion: 2.6.6-5-kibana
dependencies:
- name: microservice-chart
version: 1.21.0
Expand Down
17 changes: 9 additions & 8 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ microservice-chart:
ISSUER_RANGE_TABLE: 'pagopadweuafmsaissuerrangetable'
AMOUNT_THRESHOLD: '0'
ID_PSP_POSTE: 'POSTE1'
ELASTIC_APM_SERVICE_NAME: pagopa-afm-calculator
ELASTIC_APM_APPLICATION_PACKAGES: it.gov.pagopa.afm.calculator
ELASTIC_APM_SERVER_URL: http://quickstart-apm-http.elastic-system.svc:8200
ELASTIC_APM_LOG_SENDING: 'true'
OTEL_SERVICE_NAME: "pagopa-afm-calculator"
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=azure-dev"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317"
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
envSecret:
# required
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-d-connection-string'
COSMOS_KEY: afm-marketplace-d-cosmos-pkey
AFM_SA_CONNECTION_STRING: afm-d-sa-connection-string
ELASTIC_APM_SECRET_TOKEN: elastic-apm-secret-token
OTEL_EXPORTER_OTLP_HEADERS: elastic-apm-secret-token
keyvault:
name: "pagopa-d-afm-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
Expand Down Expand Up @@ -109,7 +110,7 @@ microservice-chart:
create: true
image:
repository: ghcr.io/pagopa/pagopa-afm-calculator
tag: "2.6.6"
tag: "2.6.6-5-kibana"
pullPolicy: Always
envConfig:
envSecret:
envConfig: {OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=azure-dev-beta"}
envSecret: {}
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ microservice-chart:
create: true
image:
repository: ghcr.io/pagopa/pagopa-afm-calculator
tag: "2.6.6"
tag: "2.6.6-5-kibana"
pullPolicy: Always
envConfig:
envSecret:
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ microservice-chart:
create: true
image:
repository: ghcr.io/pagopa/pagopa-afm-calculator
tag: "2.6.6"
tag: "2.6.6-5-kibana"
pullPolicy: Always
envConfig:
envSecret:
2 changes: 1 addition & 1 deletion openapi/openapi-node.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "PagoPA API Calculator Logic for Node",
"description": "Calculator Logic microservice for pagoPA AFM",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "2.6.6"
"version": "2.6.6-5-kibana"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "PagoPA API Calculator Logic",
"description": "Calculator Logic microservice for pagoPA AFM",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "2.6.6"
"version": "2.6.6-5-kibana"
},
"servers": [
{
Expand Down
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>it.gov.pagopa</groupId>
<artifactId>calculator</artifactId>
<version>2.6.6</version>
<version>2.6.6-5-kibana</version>
<name>afm-calculator</name>
<description>Calculator Logic microservice for pagoPA AFM</description>

Expand Down Expand Up @@ -156,6 +156,12 @@
<artifactId>javaniotcpproxy</artifactId>
<version>1.6</version>
</dependency>

<dependency>
<groupId>co.elastic.logging</groupId>
<artifactId>logback-ecs-encoder</artifactId>
<version>1.5.0</version>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
36 changes: 36 additions & 0 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProfile name="local">
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />

<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m %clr(%mdc){magenta}%n%wEx
</Pattern>
</layout>
</appender>

<root level="INFO">
<appender-ref ref="stdout"/>
</root>
</springProfile>

<springProfile name="!local">
<springProperty name="ECS_SERVICE_VERSION" source="info.application.version"/>
<appender name="ECS_JSON_CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="co.elastic.logging.logback.EcsEncoder">
<serviceName>${OTEL_SERVICE_NAME}</serviceName>
<serviceVersion>${ECS_SERVICE_VERSION}</serviceVersion>
<serviceEnvironment>${ENV}</serviceEnvironment>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="ECS_JSON_CONSOLE"/>
</root>
</springProfile>

</configuration>