Skip to content

Commit

Permalink
Update sleuth/zipkin dependencies
Browse files Browse the repository at this point in the history
fix #17487
  • Loading branch information
vmartowicz committed Jan 29, 2022
1 parent 31586da commit 235b34e
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 5,400 deletions.
1 change: 1 addition & 0 deletions generators/generator-base-docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = class extends BlueprintBaseGenerator {
this.DOCKER_ELASTICSEARCH = constants.DOCKER_ELASTICSEARCH;
this.DOCKER_PROMETHEUS_OPERATOR = constants.DOCKER_PROMETHEUS_OPERATOR;
this.DOCKER_GRAFANA_WATCHER = constants.DOCKER_GRAFANA_WATCHER;
this.DOCKER_ZIPKIN = constants.DOCKER_ZIPKIN;

this.DOCKER_CASSANDRA = constants.DOCKER_CASSANDRA;
this.DOCKER_GRAFANA = constants.DOCKER_GRAFANA;
Expand Down
2 changes: 2 additions & 0 deletions generators/generator-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const DOCKER_JENKINS = 'jenkins/jenkins:lts-jdk11';
const DOCKER_SWAGGER_EDITOR = 'swaggerapi/swagger-editor:latest';
const DOCKER_PROMETHEUS_OPERATOR = 'quay.io/coreos/prometheus-operator:v0.42.1';
const DOCKER_GRAFANA_WATCHER = 'quay.io/coreos/grafana-watcher:v0.0.8';
const DOCKER_ZIPKIN = 'openzipkin/zipkin:2.23';

// Kubernetes versions
const KUBERNETES_CORE_API_VERSION = 'v1';
Expand Down Expand Up @@ -418,6 +419,7 @@ const constants = {
KUBERNETES_INGRESS_API_VERSION,
KUBERNETES_ISTIO_NETWORKING_API_VERSION,
KUBERNETES_RBAC_API_VERSION,
DOCKER_ZIPKIN,

HELM_KAFKA,
HELM_ELASTICSEARCH,
Expand Down
1 change: 1 addition & 0 deletions generators/server/__snapshots__/generator.spec.mjs.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Object {
"grafana/provisioning/dashboards/dashboard.yml",
"grafana/provisioning/dashboards/JVM.json",
"grafana/provisioning/datasources/datasource.yml",
"zipkin.yml",
],
},
Object {
Expand Down
1 change: 1 addition & 0 deletions generators/server/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ const baseServerFiles = {
'grafana/provisioning/dashboards/dashboard.yml',
'grafana/provisioning/dashboards/JVM.json',
'grafana/provisioning/datasources/datasource.yml',
'zipkin.yml',
],
},
{
Expand Down
1 change: 1 addition & 0 deletions generators/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ module.exports = class JHipsterServerGenerator extends BaseBlueprintGenerator {
this.DOCKER_PROMETHEUS = constants.DOCKER_PROMETHEUS;
this.DOCKER_GRAFANA = constants.DOCKER_GRAFANA;
this.DOCKER_COMPOSE_FORMAT_VERSION = constants.DOCKER_COMPOSE_FORMAT_VERSION;
this.DOCKER_ZIPKIN = constants.DOCKER_ZIPKIN;

this.JAVA_VERSION = constants.JAVA_VERSION;
this.JAVA_COMPATIBLE_VERSIONS = constants.JAVA_COMPATIBLE_VERSIONS;
Expand Down
6 changes: 5 additions & 1 deletion generators/server/templates/pom.xml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,11 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
</dependencies>
</profile>
Expand Down
25 changes: 25 additions & 0 deletions generators/server/templates/src/main/docker/zipkin.yml.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<%#
Copyright 2013-2022 the original author or authors from the JHipster project.
This file is part of the JHipster project, see https://www.jhipster.tech/
for more information.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-%>
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
version: '<%= DOCKER_COMPOSE_FORMAT_VERSION %>'
services:
zipkin:
image: <%= DOCKER_ZIPKIN %>
ports:
- 127.0.0.1:9411:9411
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ spring:
cache: false
<%_ if (serviceDiscoveryType || applicationTypeGateway || applicationTypeMicroservice) { _%>
sleuth:
# https://github.com/spring-projects/spring-framework/issues/27844#issuescomment-1002866885
# https://github.com/spring-cloud/spring-cloud-sleuth/issues/2094
async:
enabled: false
enabled: false
sampler:
probability: 1 # report 100% of traces
zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ spring:
cache: true
<%_ if (serviceDiscoveryType || applicationTypeGateway || applicationTypeMicroservice) { _%>
sleuth:
# https://github.com/spring-projects/spring-framework/issues/27844#issuescomment-1002866885
# https://github.com/spring-cloud/spring-cloud-sleuth/issues/2094
async:
enabled: false
enabled: false
sampler:
probability: 1 # report 100% of traces
zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies
Expand Down
3 changes: 3 additions & 0 deletions test-integration/scripts/20-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ fi
if [ "$JHI_SONAR" = 1 ]; then
docker-compose -f src/main/docker/sonar.yml up -d
fi
if [ -a src/main/docker/zipkin.yml ]; then
docker-compose -f src/main/docker/zipkin.yml up -d
fi
docker ps -a
Loading

0 comments on commit 235b34e

Please sign in to comment.