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

Fix tracing for zipkin, fix mongodb tracing with SpringBoot 3 for APM #147

Merged
merged 3 commits into from
Oct 11, 2023
Merged
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
2 changes: 1 addition & 1 deletion local/application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local: &localConfig

global:
tracing:
url: http://zipkin.istio-system:9411
endpoint: http://zipkin.istio-system:9411/api/v2/spans

dima-frontend:
image:
Expand Down
6 changes: 3 additions & 3 deletions stack/application/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM eclipse-temurin:17.0.6_10-jdk-focal AS builder
FROM eclipse-temurin:17.0.8.1_1-jdk-jammy AS builder

WORKDIR /build

ARG ELASTIC_APM_AGENT_VERSION=1.36.0
ARG ELASTIC_APM_AGENT_VERSION=1.43.0

# apm
RUN wget -q https://search.maven.org/remotecontent?filepath=co/elastic/apm/elastic-apm-agent/${ELASTIC_APM_AGENT_VERSION}/elastic-apm-agent-${ELASTIC_APM_AGENT_VERSION}.jar -O /elastic-apm-agent.jar
Expand All @@ -22,7 +22,7 @@ COPY $SERVICE $SERVICE

RUN ./gradlew "$SERVICE:build"

FROM eclipse-temurin:17.0.6_10-jre-focal AS final
FROM eclipse-temurin:17.0.8.1_1-jre-jammy AS final
ARG SERVICE

COPY --from=builder /elastic-apm-agent.jar /
Expand Down
5 changes: 2 additions & 3 deletions stack/application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ subprojects {
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:2022.0.2"
mavenBom "org.springframework.boot:spring-boot-dependencies:3.0.6"
mavenBom "org.springframework.boot:spring-boot-dependencies:3.1.4"
}
}

Expand All @@ -42,8 +42,7 @@ subprojects {

// traces
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
// implementation 'io.micrometer:micrometer-tracing-bridge-otel'
implementation 'io.opentelemetry:opentelemetry-exporter-zipkin'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave:2.16.4'

// events
implementation 'io.honeycomb.beeline:beeline-spring-boot-starter:1.7.1'
Expand Down
2 changes: 1 addition & 1 deletion stack/application/imageflip/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version "3.0.6"
id 'org.springframework.boot' version "3.1.4"
id 'java'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.prometheus.metrics.export.enabled=true
management.tracing.sampling.probability=1.0
spring.application.name=imageflip
spring.data.mongodb.host=mongodb
spring.data.mongodb.port=27017
spring.data.mongodb.database=imageflip
server.error.whitelabel.enabled=false
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.sleuth.traceId128=true
spring.zipkin.enabled=${TRACING_ENABLED:true}
spring.zipkin.baseUrl=${ZIPKIN_BASEURL:http://zipkin.istio-system:9411}
management.tracing.enabled=${TRACING_ENABLED:true}
management.tracing.sampling.probability=${TRACING_SAMPLING_PROPABILITY:1.0}
management.zipkin.tracing.endpoint=${SPRING_ZIPKIN_ENDPOINT:http://localhost:9411/api/v2/spans}
honeycomb.beeline.service-name=imageflip
honeycomb.beeline.dataset=${HONEYCOMB_DATASET:workshop}
honeycomb.beeline.write-key=${HONEYCOMB_KEY}
Expand Down
2 changes: 1 addition & 1 deletion stack/application/imagegrayscale/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version "3.0.6"
id 'org.springframework.boot' version "3.1.4"
id 'java'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.prometheus.metrics.export.enabled=true
management.tracing.sampling.probability=1.0
server.error.whitelabel.enabled=false
spring.application.name=imagegrayscale
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.sleuth.traceId128=true
spring.zipkin.enabled=${TRACING_ENABLED:true}
spring.zipkin.baseUrl=${ZIPKIN_BASEURL:http://zipkin.istio-system:9411}
management.tracing.enabled=${TRACING_ENABLED:true}
management.tracing.sampling.probability=${TRACING_SAMPLING_PROPABILITY:1.0}
management.zipkin.tracing.endpoint=${SPRING_ZIPKIN_ENDPOINT:http://localhost:9411/api/v2/spans}
honeycomb.beeline.service-name=imagegrayscale
honeycomb.beeline.dataset=${HONEYCOMB_DATASET:workshop}
honeycomb.beeline.write-key=${HONEYCOMB_KEY}
Expand Down
2 changes: 1 addition & 1 deletion stack/application/imageholder/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version "3.0.6"
id 'org.springframework.boot' version "3.1.4"
id 'java'
id 'groovy'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.prometheus.metrics.export.enabled=true
management.tracing.sampling.probability=1.0
server.error.whitelabel.enabled=false
spring.application.name=imageholder
spring.data.mongodb.host=${MONGODB_HOST:mongodb-service}
spring.data.mongodb.port=${MONGODB_PORT:27017}
spring.data.mongodb.database=imageholder
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.sleuth.traceId128=true
spring.zipkin.enabled=${TRACING_ENABLED:true}
spring.zipkin.baseUrl=${ZIPKIN_BASEURL:http://zipkin.istio-system:9411}
management.tracing.enabled=${TRACING_ENABLED:true}
management.tracing.sampling.probability=${TRACING_SAMPLING_PROPABILITY:1.0}
management.zipkin.tracing.endpoint=${SPRING_ZIPKIN_ENDPOINT:http://localhost:9411/api/v2/spans}
#logging.pattern.console=%date{"yyyy-MM-dd'T'HH:mm:ss.SSSZ", UTC} %5p %t %c{5}:%L [log_framework=logback;app_name=${APP_NAME};app_version=${APP_VERSION};instance_id=${CF_INSTANCE_INDEX}] %m MULTIEXCEPTION %replace(%xException){'\n','\u2028'}%nopex%n</pattern>
honeycomb.beeline.service-name=imageholder
honeycomb.beeline.dataset=${HONEYCOMB_DATASET:workshop}
Expand Down
2 changes: 1 addition & 1 deletion stack/application/imageorchestrator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version "3.0.6"
id 'org.springframework.boot' version "3.1.4"
id 'java'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.prometheus.metrics.export.enabled=true
management.tracing.sampling.probability=1.0
server.error.whitelabel.enabled=false
spring.application.name=imageorchestrator
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.sleuth.traceId128=true
spring.zipkin.enabled=${TRACING_ENABLED:true}
spring.zipkin.baseUrl=${ZIPKIN_BASEURL:http://zipkin.istio-system:9411}
management.tracing.enabled=${TRACING_ENABLED:true}
management.tracing.sampling.probability=${TRACING_SAMPLING_PROPABILITY:1.0}
management.zipkin.tracing.endpoint=${SPRING_ZIPKIN_ENDPOINT:http://localhost:9411/api/v2/spans}
#logging.pattern.console=%date{"yyyy-MM-dd'T'HH:mm:ss.SSSZ", UTC} %5p %t %c{5}:%L [log_framework=logback;app_name=${APP_NAME};app_version=${APP_VERSION};instance_id=${CF_INSTANCE_INDEX}] %m MULTIEXCEPTION %replace(%xException){'\n','\u2028'}%nopex%n</pattern>
honeycomb.beeline.service-name=imageorchestrator
honeycomb.beeline.dataset=${HONEYCOMB_DATASET:workshop}
Expand Down
2 changes: 1 addition & 1 deletion stack/application/imageresize/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version "3.0.6"
id 'org.springframework.boot' version "3.1.4"
id 'java'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.prometheus.metrics.export.enabled=true
management.tracing.sampling.probability=1.0
server.error.whitelabel.enabled=false
spring.application.name=imageresize
spring.data.mongodb.host=mongodb
spring.data.mongodb.port=27017
spring.data.mongodb.database=imageresize
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.sleuth.traceId128=true
spring.zipkin.enabled=${TRACING_ENABLED:true}
spring.zipkin.baseUrl=${ZIPKIN_BASEURL:http://zipkin.istio-system:9411}
management.tracing.enabled=${TRACING_ENABLED:true}
management.tracing.sampling.probability=${TRACING_SAMPLING_PROPABILITY:1.0}
management.zipkin.tracing.endpoint=${SPRING_ZIPKIN_ENDPOINT:http://localhost:9411/api/v2/spans}
#logging.pattern.console=%date{"yyyy-MM-dd'T'HH:mm:ss.SSSZ", UTC} %5p %t %c{5}:%L [log_framework=logback;app_name=${APP_NAME};app_version=${APP_VERSION};instance_id=${CF_INSTANCE_INDEX}] %m MULTIEXCEPTION %replace(%xException){'\n','\u2028'}%nopex%n</pattern>
honeycomb.beeline.service-name=imageresize
honeycomb.beeline.dataset=${HONEYCOMB_DATASET:workshop}
Expand Down
2 changes: 1 addition & 1 deletion stack/application/imagerotator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version "3.0.6"
id 'org.springframework.boot' version "3.1.4"
id 'java'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.prometheus.metrics.export.enabled=true
management.tracing.sampling.probability=1.0
server.error.whitelabel.enabled=false
spring.application.name=imagerotator
spring.data.mongodb.host=mongodb
spring.data.mongodb.port=27017
spring.data.mongodb.database=imagerotator
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.sleuth.traceId128=true
spring.zipkin.enabled=${TRACING_ENABLED:true}
spring.zipkin.baseUrl=${ZIPKIN_BASEURL:http://zipkin.istio-system:9411}
management.tracing.enabled=${TRACING_ENABLED:true}
management.tracing.sampling.probability=${TRACING_SAMPLING_PROPABILITY:1.0}
management.zipkin.tracing.endpoint=${SPRING_ZIPKIN_ENDPOINT:http://localhost:9411/api/v2/spans}
#logging.pattern.console=%date{"yyyy-MM-dd'T'HH:mm:ss.SSSZ", UTC} %5p %t %c{5}:%L [log_framework=logback;app_name=${APP_NAME};app_version=${APP_VERSION};instance_id=${CF_INSTANCE_INDEX}] %m MULTIEXCEPTION %replace(%xException){'\n','\u2028'}%nopex%n</pattern>
honeycomb.beeline.service-name=imagerotator
honeycomb.beeline.dataset=${HONEYCOMB_DATASET:workshop}
Expand Down
2 changes: 1 addition & 1 deletion stack/application/imagethumbnail/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version "3.0.6"
id 'org.springframework.boot' version "3.1.4"
id 'java'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,20 @@ management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.prometheus.metrics.export.enabled=true
management.tracing.sampling.probability=1.0
server.error.whitelabel.enabled=false
spring.application.name=imagethumbnail
spring.data.mongodb.host=mongodb
spring.data.mongodb.port=27017
spring.data.mongodb.database=imagethumbnail
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.sleuth.traceId128=true
spring.zipkin.enabled=${TRACING_ENABLED:true}
spring.zipkin.baseUrl=${ZIPKIN_BASEURL:http://zipkin.istio-system:9411}
management.tracing.enabled=${TRACING_ENABLED:true}
management.tracing.sampling.probability=${TRACING_SAMPLING_PROPABILITY:1.0}
management.zipkin.tracing.endpoint=${SPRING_ZIPKIN_ENDPOINT:http://localhost:9411/api/v2/spans}
#logging.pattern.console=%date{"yyyy-MM-dd'T'HH:mm:ss.SSSZ", UTC} %5p %t %c{5}:%L [log_framework=logback;app_name=${APP_NAME};app_version=${APP_VERSION};instance_id=${CF_INSTANCE_INDEX}] %m MULTIEXCEPTION %replace(%xException){'\n','\u2028'}%nopex%n</pattern>
honeycomb.beeline.service-name=imagethumbnail
honeycomb.beeline.dataset=${HONEYCOMB_DATASET:workshop}
honeycomb.beeline.write-key=${HONEYCOMB_KEY}
honeycomb.beeline.enabled=${HONEYCOMB_ENABLED:false}
honeycomb.beeline.log-honeycomb-responses=true
<<<<<<< HEAD
imageholder.baseUrl=http://imageholder-service:8080
=======
<<<<<<< HEAD
#imageholder.baseUrl=${IMAGEHOLDER_BASEURL:http://imageholder-service:8080}
=======
imageholder.baseUrl=http://imageholder-service:8080
>>>>>>> ba9fcc5 (Simplify configuration of spring)
>>>>>>> anarakhmedov-update-spring
imageholder.baseUrl=${IMAGEHOLDER_BASEURL:http://imageholder-service:8080}
2 changes: 1 addition & 1 deletion stack/application/trafficgen/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version "3.0.6"
id 'org.springframework.boot' version "3.1.4"
id 'java'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.prometheus.metrics.export.enabled=true
management.tracing.sampling.probability=1.0
server.error.whitelabel.enabled=false
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.application.name=trafficgen
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration
spring.sleuth.traceId128=true
spring.zipkin.enabled=${TRACING_ENABLED:true}
spring.zipkin.baseUrl=${ZIPKIN_BASEURL:http://zipkin.istio-system:9411}
#logging.pattern.console=%date{"yyyy-MM-dd'T'HH:mm:ss.SSSZ", UTC} %5p %t %c{5}:%L [log_framework=logback;app_name=${APP_NAME};app_version=${APP_VERSION};instance_id=${CF_INSTANCE_INDEX}] %m MULTIEXCEPTION %replace(%xException){'\n','\u2028'}%nopex%n</pattern>
management.tracing.enabled=${TRACING_ENABLED:true}
management.tracing.sampling.probability=${TRACING_SAMPLING_PROPABILITY:1.0}
management.zipkin.tracing.endpoint=${SPRING_ZIPKIN_ENDPOINT:http://localhost:9411/api/v2/spans}
honeycomb.beeline.service-name=trafficgen
honeycomb.beeline.dataset=${HONEYCOMB_DATASET:workshop}
honeycomb.beeline.write-key=${HONEYCOMB_KEY}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ spec:
value: {{ .Values.tracing.enabled | quote }}
- name: APM_ENABLED
value: {{ .Values.apm.enabled | quote }}
- name: SPRING_ZIPKIN_BASEURL
value: {{ .Values.global.tracing.url }}
- name: SPRING_ZIPKIN_ENDPOINT
value: {{ .Values.global.tracing.endpoint }}
ports:
- containerPort: 8080
resources:
Expand Down
3 changes: 2 additions & 1 deletion stack/kubernetes/application/charts/imageflip/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ ingress:
host: o11y.fans

tracing:
enabled: true
enabled: true
samplingPropability: 1.0
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ spec:
value: "true"
- name: TRACING_ENABLED
value: {{ .Values.tracing.enabled | quote }}
- name: SPRING_ZIPKIN_BASEURL
value: {{ .Values.global.tracing.url }}
- name: TRACING_SAMPLING_PROPABILITY
value: {{ .Values.tracing.samplingPropability | quote }}
- name: SPRING_ZIPKIN_ENDPOINT
value: {{ .Values.global.tracing.endpoint }}
- name: APM_ENABLED
value: {{ .Values.apm.enabled | quote }}
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ ingress:
host: o11y.fans

tracing:
enabled: true
enabled: true
samplingPropability: 1.0
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ spec:
value: "true"
- name: TRACING_ENABLED
value: {{ .Values.tracing.enabled | quote }}
- name: SPRING_ZIPKIN_BASEURL
value: {{ .Values.global.tracing.url }}
- name: TRACING_SAMPLING_PROPABILITY
value: {{ .Values.tracing.samplingPropability | quote }}
- name: SPRING_ZIPKIN_ENDPOINT
value: {{ .Values.global.tracing.endpoint }}
- name: APM_ENABLED
value: {{ .Values.apm.enabled | quote }}
- name: IMAGETHUMBNAIL_BASEURL
Expand Down
3 changes: 2 additions & 1 deletion stack/kubernetes/application/charts/imageholder/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ mongodb:
port: 27017

tracing:
enabled: true
enabled: true
samplingPropability: 1.0
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ spec:
value: "true"
- name: TRACING_ENABLED
value: {{ .Values.tracing.enabled | quote }}
- name: SPRING_ZIPKIN_BASEURL
value: {{ .Values.global.tracing.url }}
- name: TRACING_SAMPLING_PROPABILITY
value: {{ .Values.tracing.samplingPropability | quote }}
- name: SPRING_ZIPKIN_ENDPOINT
value: {{ .Values.global.tracing.endpoint }}
- name: APM_ENABLED
value: {{ .Values.apm.enabled | quote }}
- name: IMAGEROTATOR_BASEURL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ ingress:
host: o11y.fans

tracing:
enabled: true
enabled: true
samplingPropability: 1.0
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ spec:
value: "true"
- name: TRACING_ENABLED
value: {{ .Values.tracing.enabled | quote }}
- name: SPRING_ZIPKIN_BASEURL
value: {{ .Values.global.tracing.url }}
- name: TRACING_SAMPLING_PROPABILITY
value: {{ .Values.tracing.samplingPropability | quote }}
- name: SPRING_ZIPKIN_ENDPOINT
value: {{ .Values.global.tracing.endpoint }}
- name: APM_ENABLED
value: {{ .Values.apm.enabled | quote }}
ports:
Expand Down
3 changes: 2 additions & 1 deletion stack/kubernetes/application/charts/imageresize/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ ingress:
host: o11y.fans

tracing:
enabled: true
enabled: true
samplingPropability: 1.0
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ spec:
value: "true"
- name: TRACING_ENABLED
value: {{ .Values.tracing.enabled | quote }}
- name: SPRING_ZIPKIN_BASEURL
value: {{ .Values.global.tracing.url }}
- name: TRACING_SAMPLING_PROPABILITY
value: {{ .Values.tracing.samplingPropability | quote }}
- name: SPRING_ZIPKIN_ENDPOINT
value: {{ .Values.global.tracing.endpoint }}
- name: APM_ENABLED
value: {{ .Values.apm.enabled | quote }}
ports:
Expand Down
Loading