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

Update sleuth/zipkin dependencies #17615

Merged
merged 2 commits into from
Feb 7, 2022
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
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 @@ -2056,7 +2056,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
3 changes: 3 additions & 0 deletions test/__snapshots__/app-client-custom-path.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down
39 changes: 39 additions & 0 deletions test/__snapshots__/app.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -553,6 +556,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -1946,6 +1952,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -3307,6 +3316,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -4635,6 +4647,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -5972,6 +5987,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -7321,6 +7339,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -8691,6 +8712,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -10034,6 +10058,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -10990,6 +11017,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -12339,6 +12369,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -13655,6 +13688,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -14968,6 +15004,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down
3 changes: 3 additions & 0 deletions test/__snapshots__/server.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down
6 changes: 6 additions & 0 deletions test/blueprint/__snapshots__/app-blueprint.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down Expand Up @@ -1459,6 +1462,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down
3 changes: 3 additions & 0 deletions test/blueprint/__snapshots__/scoped-blueprint.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ Object {
"src/main/docker/sonar.yml": Object {
"stateCleared": "modified",
},
"src/main/docker/zipkin.yml": Object {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/ApplicationWebXml.java": Object {
"stateCleared": "modified",
},
Expand Down