If you "scraping" prometheus through federation endpoint - you need to provide query and this query allows you to limit scopes you requesting from prometheus:
You can play with queries using curl command:
curl -G --data-urlencode 'match[]={__name__!~""}' 'http://<prometheus instance>:<port>/prometheus/federate'
This example will query for all metrics with non-empty name, what can take too much time and probably fail by timeout, so you can start with any small metric name to see results.