1919<archetype-script xmlns =" https://helidon.io/archetype/2.0"
2020 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2121 xsi : schemaLocation =" https://helidon.io/archetype/2.0 https://helidon.io/xsd/archetype-2.0.xsd" >
22- <output >
23- <model if =" ${tracing}" >
24- <list key =" Main-helidon-imports" >
25- <value >io.helidon.tracing.TracerBuilder</value >
26- </list >
27- <list key =" Main-serverBuilder" >
28- <value > .tracer(TracerBuilder.create(config.get("tracing")).build())</value >
29- </list >
30- <list key =" application-yaml-entries" >
31- <value if =" ${tracing.provider} == 'jaeger'" ><![CDATA[
22+
23+ <methods >
24+ <method name =" metrics" >
25+ <output if =" ${metrics}" >
26+ <model >
27+ <list key =" dependencies" >
28+ <map order =" 800" >
29+ <value key =" groupId" >io.helidon.metrics</value >
30+ <value key =" artifactId" >helidon-metrics-api</value >
31+ </map >
32+ <map if =" ${db}" >
33+ <value key =" groupId" >io.helidon.dbclient</value >
34+ <value key =" artifactId" >helidon-dbclient-metrics-jdbc</value >
35+ </map >
36+ <map if =" ${db}" >
37+ <value key =" groupId" >io.helidon.dbclient</value >
38+ <value key =" artifactId" >helidon-dbclient-metrics</value >
39+ </map >
40+ </list >
41+ <list key =" Main-helidon-imports" >
42+ <value >io.helidon.metrics.MetricsSupport</value >
43+ </list >
44+ <list key =" Main-routingBuilder" >
45+ <value ><![CDATA[ .register(MetricsSupport.create()) // Metrics at "/metrics"]]>
46+ </value >
47+ </list >
48+ <list key =" MainTest-methods" >
49+ <value ><![CDATA[
50+ @Test
51+ void testMetrics() {
52+ WebClientResponse response = webClient.get()
53+ .path("/metrics")
54+ .request()
55+ .await(Duration.ofSeconds(5));
56+ assertThat(response.status().code(), is(200));
57+ }]]>
58+ </value >
59+ </list >
60+ <list key =" module-requires" >
61+ <value >io.helidon.metrics</value >
62+ </list >
63+ <list key =" readme-sections" >
64+ <value ><![CDATA[
65+ ## Try metrics
66+
67+ ```
68+ # Prometheus Format
69+ curl -s -X GET http://localhost:8080/metrics
70+ # TYPE base:gc_g1_young_generation_count gauge
71+ . . .
72+
73+ # JSON Format
74+ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
75+ {"base":...
76+ . . .
77+ ```]]>
78+ </value >
79+ </list >
80+ </model >
81+ </output >
82+ </method >
83+ <method name =" metrics.builtin" >
84+ <output if =" ${metrics}" >
85+ <model if =" ${metrics.builtin}" >
86+ <list key =" dependencies" >
87+ <map >
88+ <value key =" groupId" >io.helidon.metrics</value >
89+ <value key =" artifactId" >helidon-metrics</value >
90+ </map >
91+ </list >
92+ </model >
93+ </output >
94+ </method >
95+ <method name =" tracing" >
96+ <output if =" ${tracing}" >
97+ <model >
98+ <list key =" Main-helidon-imports" >
99+ <value >io.helidon.tracing.TracerBuilder</value >
100+ </list >
101+ <list key =" Main-serverBuilder" >
102+ <value > .tracer(TracerBuilder.create(config.get("tracing")).build())</value >
103+ </list >
104+ <list key =" application-yaml-entries" >
105+ <value if =" ${tracing.provider} == 'jaeger'" ><![CDATA[
32106tracing:
33107 service: "helidon-full-http"
34108 host: "localhost" # JAEGER_ENDPOINT
35109 port: 14250 # JAEGER_ENDPOINT
36110 sampler-type: "ratio" # JAEGER_SAMPLER_TYPE (https://www.jaegertracing.io/docs/latest/sampling/#client-sampling-configuration)
37- sampler-param: 0.5 # JAEGER_SAMPLER_PARAM (number)
38- ]]> </value >
39- <value if =" ${tracing.provider} == 'zipkin'" ><![CDATA[
111+ sampler-param: 0.5 # JAEGER_SAMPLER_PARAM (number)]]>
112+ </value >
113+ <value if =" ${tracing.provider} == 'zipkin'" ><![CDATA[
40114tracing:
41115 service: "helidon-service"
42116 protocol: "http"
@@ -53,15 +127,21 @@ tracing:
53127 tag4: false
54128 int-tags:
55129 tag5: 145
56- tag6: 741]]> </value >
57- </list >
58- <list key =" config-test" >
59- <value ><![CDATA[
130+ tag6: 741]]>
131+ </value >
132+ </list >
133+ <list key =" config-test" >
134+ <value ><![CDATA[
60135tracing:
61136 service: "testing-service"
62- global: false
63- ]]> </value >
64- </list >
65- </model >
66- </output >
137+ global: false]]>
138+ </value >
139+ </list >
140+ </model >
141+ </output >
142+ </method >
143+ </methods >
144+ <call method =" metrics" />
145+ <call method =" metrics.builtin" />
146+ <call method =" tracing" />
67147</archetype-script >
0 commit comments