bneradt commented on code in PR #12792:
URL: https://github.com/apache/trafficserver/pull/12792#discussion_r2674132394


##########
tests/gold_tests/pluginTest/stats_over_http/stats_over_http.test.py:
##########
@@ -93,6 +93,44 @@ def __checkPrometheusMetrics(self, p: 'Test.Process', 
from_prometheus: bool):
             p.Streams.stdout += Testers.ContainsExpression(
                 'proxy_process_http_delete_requests 0', 'Verify the successful 
parsing of Prometheus metrics for a counter.')
 
+    def __checkPrometheusV2Metrics(self, p: "Test.Process"):
+        """Check the Prometheus v2 metrics output.
+        :param p: The process whose output to check.
+        """
+        p.Streams.stdout += Testers.ContainsExpression(
+            "# HELP proxy_process_http_requests proxy.process.http.requests",
+            "Output should have a help line for the base metric name.",
+        )
+        p.Streams.stdout += Testers.ContainsExpression(
+            "# TYPE proxy_process_http_requests counter",
+            "Output should have a type line for the base metric name.",
+        )
+
+        p.Streams.stdout += Testers.ContainsExpression(
+            'proxy_process_http_requests{method="completed"}',
+            "Verify that method labels are extracted correctly.",
+        )

Review Comment:
   I'm glad you added this test.
   
   `method="completed"`
   
   `completed` isn't a method, POST, GET, PUT, etc., are methods. It seems like 
having `completed` would be misleading for users viewing this data.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to