yes the example is working . I need to check with the api provider
http_post_2xx:
    prober: http
    http:
      method: POST
      headers:
        Content-Type: application/json
      body: '{"name":"test","salary":"123","age":"23"}'
    scrape_interval: 45s
    metrics_path: /probe
    params:
      module: [http_post_2xx]  # Look for a HTTP 200 response.
    static_configs:
      - targets:
        - http://dummy.restapiexample.com/api/v1/create
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 127.0.0.1:9115  # Blackbox exporter.
thank you for the help

On Wednesday, 20 May 2020 16:05:42 UTC+5:30, Suresh Mallampati wrote:
>
> If any one can help using the api  http://dummy.restapiexample.com/create 
> sample 
> prometheus.yml,blackbox.yml files for http post
>
> On Wednesday, 20 May 2020 15:58:13 UTC+5:30, Suresh Mallampati wrote:
>>
>> Thank you very much .
>> After doing the  corrections also i am facing the same issue . If there 
>> is any sample or document could helpful for me.
>>
>> On Monday, 18 May 2020 21:35:20 UTC+5:30, Brian Candler wrote:
>>>
>>> https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415
>>>
>>> Perhaps it doesn't like your Content-Type with trailing semicolon?  
>>> Also, the body you've given is not valid JSON:
>>>
>>> body: '{aaaa: "355987085036738",status: "Active"}
>>> --->
>>> body: '{"aaaa": "355987085036738","status": "Active"}'
>>>
>>> I'd suggest the easiest way to debug this is to use "curl" interactively 
>>> until you can find a series of options that works, and then you can 
>>> translate that into blackbox_exporter configuration.
>>>
>>> Another thing you can do is to use tcpdump to capture the response from 
>>> the remote webserver when blackbox_exporter scrapes it.  It may include 
>>> text in the response body which explains the problem with the request.  
>>> Something like this (adjust the interface name as necessary):
>>> tcpdump -i eth0 -nn -s0 -A host xxx.yyy and tcp port 80
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/80d2056e-678b-4ca8-b7a2-da89527c6902%40googlegroups.com.

Reply via email to