-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tracing config updates in archetype (#5001)
* tracing configuration update Signed-off-by: tvallin <[email protected]> * Add documentation Signed-off-by: tvallin <[email protected]> Signed-off-by: tvallin <[email protected]>
- Loading branch information
Showing
10 changed files
with
218 additions
and
80 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
archetypes/helidon/src/main/archetype/common/files/README.jaeger.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Tracing | ||
|
||
### Set up Jaeger | ||
|
||
First, you need to run the Jaeger tracer. Helidon will communicate with this tracer at runtime. | ||
|
||
Run Jaeger within a docker container: | ||
``` | ||
docker run -d --name jaeger\ | ||
-e COLLECTOR_ZIPKIN_HOST_PORT=:9411\ | ||
-e COLLECTOR_OTLP_ENABLED=true\ | ||
-p 6831:6831/udp\ | ||
-p 6832:6832/udp\ | ||
-p 5778:5778\ | ||
-p 16686:16686\ | ||
-p 4317:4317\ | ||
-p 4318:4318\ | ||
-p 14250:14250\ | ||
-p 14268:14268\ | ||
-p 14269:14269\ | ||
-p 9411:9411\ | ||
jaegertracing/all-in-one:1.38 | ||
``` | ||
|
||
### View Tracing Using Jaeger UI | ||
|
||
Jaeger provides a web-based UI at http://localhost:16686, where you can see a visual representation of | ||
the same data and the relationship between spans within a trace. |
47 changes: 47 additions & 0 deletions
47
archetypes/helidon/src/main/archetype/common/files/README.zipkin.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## Tracing | ||
|
||
### Set up Zipkin | ||
|
||
First, you need to run the Zipkin tracer. Helidon will communicate with this tracer at runtime. | ||
|
||
Run Zipkin within a docker container, then check the Zipkin server health: | ||
``` | ||
docker run -d --name zipkin -p 9411:9411 openzipkin/zipkin | ||
``` | ||
Run the Zipkin docker image named openzipkin/zipkin. | ||
Check the Zipkin server health: | ||
``` | ||
curl http://localhost:9411/health | ||
``` | ||
Invoke the Zipkin REST API to check the Zipkin server health. | ||
``` | ||
Response body | ||
{ | ||
"status": "UP", | ||
"zipkin": { | ||
"status": "UP", | ||
"details": { | ||
"InMemoryStorage{}": { | ||
"status": "UP" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
All status fields should be UP. | ||
|
||
### View Tracing Using Zipkin REST API | ||
|
||
Run the curl command and check the response: | ||
``` | ||
curl http://localhost:9411/api/v2/services | ||
``` | ||
Response body | ||
``` | ||
["helidon-mp-1"] | ||
``` | ||
|
||
### View Tracing Using Zipkin UI | ||
|
||
Zipkin provides a web-based UI at http://localhost:9411/zipkin, where you can see a visual representation of | ||
the same data and the relationship between spans within a trace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
archetypes/helidon/src/main/archetype/mp/custom/observability.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2022 Oracle and/or its affiliates. | ||
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 | ||
http://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. | ||
--> | ||
<archetype-script xmlns="https://helidon.io/archetype/2.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://helidon.io/archetype/2.0 https://helidon.io/xsd/archetype-2.0.xsd"> | ||
<output> | ||
<model if="${tracing}"> | ||
<list key="dependencies"> | ||
<map order="800"> | ||
<value key="groupId">io.helidon.microprofile.tracing</value> | ||
<value key="artifactId">helidon-microprofile-tracing</value> | ||
</map> | ||
</list> | ||
<list key="microprofile-config-entries"> | ||
<value>tracing.service=helidon-service</value> | ||
<value>tracing.components.web-server.spans.0.name="HTTP Request"</value> | ||
</list> | ||
<list if="${tracing.provider} == 'jaeger'" key="microprofile-config-entries"> | ||
<value>tracing.protocol=http</value> | ||
<value>tracing.host=localhost</value> | ||
<value>tracing.port=14250</value> | ||
<value>tracing.path=/api/traces/mine</value> | ||
<value>tracing.token=token</value> | ||
<value>tracing.propagation=jaeger</value> | ||
</list> | ||
<list if="${tracing.provider} == 'zipkin'" key="microprofile-config-entries"> | ||
<value>tracing.protocol=https</value> | ||
<value>tracing.host=192.168.1.1</value> | ||
<value>tracing.port=9987</value> | ||
<value>tracing.path=/api/v2/spans</value> | ||
<value>tracing.api-version=1</value> | ||
</list> | ||
</model> | ||
</output> | ||
</archetype-script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
archetypes/helidon/src/main/archetype/se/custom/observability.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2022 Oracle and/or its affiliates. | ||
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 | ||
http://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. | ||
--> | ||
<archetype-script xmlns="https://helidon.io/archetype/2.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://helidon.io/archetype/2.0 https://helidon.io/xsd/archetype-2.0.xsd"> | ||
<output> | ||
<model if="${tracing}"> | ||
<list key="application-yaml-entries"> | ||
<value if="${tracing.provider} == 'jaeger'"><![CDATA[ | ||
tracing: | ||
service: "helidon-full-http" | ||
protocol: "https" # JAEGER_ENDPOINT (if not udp, http is expected and endpoint is filled) | ||
host: "192.168.1.3" # JAEGER_ENDPOINT | ||
port: 14240 # JAEGER_ENDPOINT | ||
path: "/api/traces/mine" # JAEGER_ENDPOINT | ||
token: "token" # JAEGER_AUTH_TOKEN | ||
# Either token or username/password | ||
#username: "user" # JAEGER_USER | ||
#password: "pass" # JAEGER_PASSWORD | ||
propagation: "jaeger" # JAEGER_PROPAGATION either "jaeger" or "b3" | ||
log-spans: false # JAEGER_REPORTER_LOG_SPANS | ||
max-queue-size: 42 # JAEGER_REPORTER_MAX_QUEUE_SIZE | ||
flush-interval-ms: 10001 # JAEGER_REPORTER_FLUSH_INTERVAL | ||
sampler-type: "remote"# JAEGER_SAMPLER_TYPE (https://www.jaegertracing.io/docs/latest/sampling/#client-sampling-configuration) | ||
sampler-param: 0.5 # JAEGER_SAMPLER_PARAM (number) | ||
sampler-manager: "localhost:47877" # JAEGER_SAMPLER_MANAGER_HOST_PORT | ||
tags: | ||
tag1: "tag1-value" # JAEGER_TAGS | ||
tag2: "tag2-value" # JAEGER_TAGS | ||
boolean-tags: | ||
tag3: true # JAEGER_TAGS | ||
tag4: false # JAEGER_TAGS | ||
int-tags: | ||
tag5: 145 # JAEGER_TAGS | ||
tag6: 741 # JAEGER_TAGS]]></value> | ||
<value if="${tracing.provider} == 'zipkin'"><![CDATA[ | ||
tracing: | ||
zipkin: | ||
service: "helidon-service" | ||
protocol: "https" | ||
host: "192.168.1.1" | ||
port: 9987 | ||
api-version: 1 | ||
# this is the default path for API version 2 | ||
path: "/api/v2/spans" | ||
tags: | ||
tag1: "tag1-value" | ||
tag2: "tag2-value" | ||
boolean-tags: | ||
tag3: true | ||
tag4: false | ||
int-tags: | ||
tag5: 145 | ||
tag6: 741]]></value> | ||
</list> | ||
</model> | ||
</output> | ||
</archetype-script> |