Multi-target exporters

One of our nodes uses a multi-target exporter, in shorts we do this to retrieve metrics:

curl $HOST/probe?target=http://anotherhost.com/data

We’re evaluating PMM and I’m trying to add this exporter as an external service with pmm-admin like this:

pmm-admin --debug add external --listen-port XXXX --service-name=XXXX --metrics-path="/probe?target=http://anotherhost.com/data

but it doesn’t work, I get this error:

DEBUG 2021-07-26 18:49:13.095858754Z: /tmp/go/src/github.com/percona/pmm-admin/vendor/github.com/go-openapi/runtime/client/runtime.go:408 github.com/percona/pmm-admin/vendor/github.com/go-openapi/runtime/client.(*Runtime).Submit() POST /v1/management/External/Add HTTP/1.1
Host: XXXX.YYYYYY.com:8981
User-Agent: Go-http-client/1.1
Content-Length: 243
Accept: application/json
Authorization: Basic GWRtaW...GV1cw==
Content-Type: application/json
Accept-Encoding: gzip

{"runs_on_node_id":"/node_id/df9668a1-6f81-454d-9a33-4e45cbe207e1","service_name":"XXXXXXX","metrics_path":"/probe?target=http://anotherhost.com/data","listen_port":YYYYY,"node_id":"/node_id/df9668a1-6f81-454d-9a33-4e45cbe207e1"}

DEBUG 2021-07-26 18:49:13.640543616Z: /tmp/go/src/github.com/percona/pmm-admin/vendor/github.com/go-openapi/runtime/client/runtime.go:446 github.com/percona/pmm-admin/vendor/github.com/go-openapi/runtime/client.(*Runtime).Submit() HTTP/1.1 400 Bad Request
Content-Length: 193
Connection: keep-alive
Content-Type: application/json
Date: Mon, 26 Jul 2021 18:49:13 GMT
Server: nginx

{
  "error": "Connection check failed: Unexpected HTTP status code: 404. Expected: 200.",
  "code": 9,
  "message": "Connection check failed: Unexpected HTTP status code: 404. Expected: 200."
}
DEBUG 2021-07-26 18:49:13.640805085Z: /tmp/go/src/github.com/percona/pmm-admin/main.go:144 main.main() Result: <nil>
DEBUG 2021-07-26 18:49:13.640873385Z: /tmp/go/src/github.com/percona/pmm-admin/main.go:145 main.main() Error: &external.AddExternalDefault{_statusCode:400, Payload:(*external.AddExternalDefaultBody)(0xc000103940)}
Connection check failed: Unexpected HTTP status code: 404. Expected: 200.

I’ve also tried with and without double quotes in the metrics-path value but still no luck.

Does anyone know if pmm-admin can handle multi-target exporters?

Thank you in advance.

Hi @papasj
Thank you for your question.

Could you check if exporter accessible from PMM Server?
And check node address in inventory address if it’s the same that you use in your curl script

Best regards,
Nurlan

1 Like