I use blackbox exporter to monitoring API Endpoint. I able to API using json paramter and POST method manually by curl command with below result :
where is data.json :
{
"NXK":"324410130005",
"NO_XX":"317502141012",
"NM_LGKP_BU":"",
"user_id":"68317101XXXXX",
"password":"XXXXXX",
"msisdn":"123456789",
"IP_User":"XXX"
}
But, when i setup in blackbox exporter with same json paramater its error - server returned HTTP status 400 Bad Request
Here is my configuration :
blackbox.yml :
modules:
http_post_2xx:
prober: http
timeout: 5s
http:
valid_status_codes: [200]
method: POST
headers:
Content-Type: application/json
body: '{"NXK": "324410130005","NXK": "317502141012","NM_LGKP_BU": "","user_id": "68317101XXXXX","password": "XXXXXX","msisdn": "123456789","IP_User": "XXX"}'
prometheus.yml :
- job_name: 'blackbox'
metrics_path: /probe
params:
module: [http_post_2xx]
static_configs:
- targets:
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: xxxxxosb04:9115
Please advise if i missed something in my configuration?
Thank You!