External service paths with query string

Hi,

We’re using PMM for all our metric gathering fun, and I was looking to add some stats from a firewall via snmp using the prometheus snmp exporter.

It uses a query string on the http request to specify some parameters, but when attempting to configure PMM paths it strips off the query string so trying to configure /snmp?target=1.2.3.4 only /snmp is kept and used by PMM.

Is there a way to include a query string with the path?

J,

1 Like

Can you provide us with how you are adding this external exporter to your PMM?

1 Like

It hasn’t seemed to matter (I tried pmm-admin and the UI) but for example:
# pmm-admin add external --listen-port=9116 --service-name=snmp_target --metrics-path="snmp?module=if_mib&target=1.2.3.4"

1 Like

Hi @Julian_Davison , I was able to successfully scrape Netdata using PMM by passing /api/v1/allmetrics?format=prometheus to the metrics_path option when using the syntax:

pmm-admin add external-serverless ...

So you’re really close, just swap out external for external-serverless and it should work :+1:

1 Like

Thank you, @Michael_Coburn !

That’s almost solved the problem - the external-serverless does include the entire string, but unfortunately it’s escaping the ? to %3F (so requesting /snmp%3Fmodule=if_mib&target=192.168.42.1 rather than /snmp?module=if_mib&target=192.168.42.1 which the snmp exporter doesn’t cope with.

Is there a way to stop the encoding?

J,

1 Like

Hi @Julian_Davison

Interesting issue. Did you try quoting it, for example:

pmm-admin add external-serverless --metrics-path="/snmp?module..."

In my case I actually didn’t use the cmd line, I used the GUI to add my external-serverless instance. This might be a second option for you to try, using the Add External Instance GUI

1 Like

I have the exact same problem.

Example:

pmm-admin add external-serverless --host=test.something --listen-port=3000 --metrics-path=‘/jobs/metrics?something’ --custom-labels=app=web --server-insecure-tls --scheme=http --external-name=web
Connection check failed: Get “http://test.something:3000/jobs/metrics%3Fsomething”: dial tcp:

adding --skip-connection-check fix problem.

Interestingly, it was not possible to add from graphan GUI (same problem).

2 Likes

Unfortunately, yes, I did not find that quoting it on the command line helped, and the GUI gave me the same result using both “set manually” and “parse from URL string” options.

The issue still exists in 2.31.0

1 Like

Hi @Julian_Davison , @Seweryn_Ozog -
I’ve escalated this within Percona, we’ll get back to you as soon as possible. Thanks!

2 Likes