@@ -111,78 +111,78 @@ void init() {
111111 @ Test
112112 public void testCounterComplete () throws IOException {
113113 String openMetricsText =
114- "# TYPE service_time_seconds counter\n "
115- + "# UNIT service_time_seconds seconds\n "
116- + "# HELP service_time_seconds total time spent serving\n "
117- + "service_time_seconds_total {path=\" /hello\" ,status=\" 200\" } 0.8 "
114+ "# TYPE service:time_seconds counter\n "
115+ + "# UNIT service:time_seconds seconds\n "
116+ + "# HELP service:time_seconds total time spent serving\n "
117+ + "service:time_seconds_total {path=\" /hello\" ,status=\" 200\" } 0.8 "
118118 + scrapeTimestamp1s
119119 + " # "
120120 + exemplar1String
121121 + "\n "
122- + "service_time_seconds_created {path=\" /hello\" ,status=\" 200\" } "
122+ + "service:time_seconds_created {path=\" /hello\" ,status=\" 200\" } "
123123 + createdTimestamp1s
124124 + " "
125125 + scrapeTimestamp1s
126126 + "\n "
127- + "service_time_seconds_total {path=\" /hello\" ,status=\" 500\" } 0.9 "
127+ + "service:time_seconds_total {path=\" /hello\" ,status=\" 500\" } 0.9 "
128128 + scrapeTimestamp2s
129129 + " # "
130130 + exemplar2String
131131 + "\n "
132- + "service_time_seconds_created {path=\" /hello\" ,status=\" 500\" } "
132+ + "service:time_seconds_created {path=\" /hello\" ,status=\" 500\" } "
133133 + createdTimestamp2s
134134 + " "
135135 + scrapeTimestamp2s
136136 + "\n "
137137 + "# EOF\n " ;
138138 String prometheusText =
139- "# HELP service_time_seconds_total total time spent serving\n "
140- + "# TYPE service_time_seconds_total counter\n "
141- + "service_time_seconds_total {path=\" /hello\" ,status=\" 200\" } 0.8 "
139+ "# HELP service:time_seconds_total total time spent serving\n "
140+ + "# TYPE service:time_seconds_total counter\n "
141+ + "service:time_seconds_total {path=\" /hello\" ,status=\" 200\" } 0.8 "
142142 + scrapeTimestamp1s
143143 + "\n "
144- + "service_time_seconds_total {path=\" /hello\" ,status=\" 500\" } 0.9 "
144+ + "service:time_seconds_total {path=\" /hello\" ,status=\" 500\" } 0.9 "
145145 + scrapeTimestamp2s
146146 + "\n "
147- + "# HELP service_time_seconds_created total time spent serving\n "
148- + "# TYPE service_time_seconds_created gauge\n "
149- + "service_time_seconds_created {path=\" /hello\" ,status=\" 200\" } "
147+ + "# HELP service:time_seconds_created total time spent serving\n "
148+ + "# TYPE service:time_seconds_created gauge\n "
149+ + "service:time_seconds_created {path=\" /hello\" ,status=\" 200\" } "
150150 + createdTimestamp1s
151151 + " "
152152 + scrapeTimestamp1s
153153 + "\n "
154- + "service_time_seconds_created {path=\" /hello\" ,status=\" 500\" } "
154+ + "service:time_seconds_created {path=\" /hello\" ,status=\" 500\" } "
155155 + createdTimestamp2s
156156 + " "
157157 + scrapeTimestamp2s
158158 + "\n " ;
159159 String openMetricsTextWithoutCreated =
160- "# TYPE service_time_seconds counter\n "
161- + "# UNIT service_time_seconds seconds\n "
162- + "# HELP service_time_seconds total time spent serving\n "
163- + "service_time_seconds_total {path=\" /hello\" ,status=\" 200\" } 0.8 "
160+ "# TYPE service:time_seconds counter\n "
161+ + "# UNIT service:time_seconds seconds\n "
162+ + "# HELP service:time_seconds total time spent serving\n "
163+ + "service:time_seconds_total {path=\" /hello\" ,status=\" 200\" } 0.8 "
164164 + scrapeTimestamp1s
165165 + " # "
166166 + exemplar1String
167167 + "\n "
168- + "service_time_seconds_total {path=\" /hello\" ,status=\" 500\" } 0.9 "
168+ + "service:time_seconds_total {path=\" /hello\" ,status=\" 500\" } 0.9 "
169169 + scrapeTimestamp2s
170170 + " # "
171171 + exemplar2String
172172 + "\n "
173173 + "# EOF\n " ;
174174 String prometheusTextWithoutCreated =
175- "# HELP service_time_seconds_total total time spent serving\n "
176- + "# TYPE service_time_seconds_total counter\n "
177- + "service_time_seconds_total {path=\" /hello\" ,status=\" 200\" } 0.8 "
175+ "# HELP service:time_seconds_total total time spent serving\n "
176+ + "# TYPE service:time_seconds_total counter\n "
177+ + "service:time_seconds_total {path=\" /hello\" ,status=\" 200\" } 0.8 "
178178 + scrapeTimestamp1s
179179 + "\n "
180- + "service_time_seconds_total {path=\" /hello\" ,status=\" 500\" } 0.9 "
180+ + "service:time_seconds_total {path=\" /hello\" ,status=\" 500\" } 0.9 "
181181 + scrapeTimestamp2s
182182 + "\n " ;
183183 String prometheusProtobuf =
184184 // @formatter:off
185- "name: \" service_time_seconds_total \" "
185+ "name: \" service:time_seconds_total \" "
186186 + "help: \" total time spent serving\" "
187187 + "type: COUNTER "
188188 + "metric { "
@@ -211,7 +211,7 @@ public void testCounterComplete() throws IOException {
211211
212212 CounterSnapshot counter =
213213 CounterSnapshot .builder ()
214- .name ("service_time_seconds " )
214+ .name ("service:time_seconds " )
215215 .help ("total time spent serving" )
216216 .unit (Unit .SECONDS )
217217 .dataPoint (
0 commit comments