I'm trying to mimic metrics in Prometheus using Push Gateway. When I'm passing these values in PostMan, I'm able to see the entry of metrics in Push Gateway. But, when I'm trying the same with Rest Assured, it is not working. I'm getting error as RESPONSE :text format parsing error in line 1: invalid metric name.
Anyone has any idea?
public void sendRequestsToPushGateway() {
System.out.println("Send request to Push Gateway");
validatableResponse = given().contentType(ContentType.TEXT)
.body("\"container_cpu_cfs_throttled_seconds_total\"" + "{" + "\"container_name\" = \"test\", "
+ "\"pod_name\"=\"test-stable\"," + "\"exported_namespace\"=\"demo\"" + "} "
+ "100.0\n")
.when()
.put("http://prometheus-pushgateway.eu-mesh-poc-aws.dev.io/metrics/job/cpusaturationtest/instance/3")
.then();
String RESPONSE = validatableResponse.extract().asString();
System.out.println("RESPONSE :" + RESPONSE);
}