A client library gives your code the counter, gauge and histogram objects and exposes them on an HTTP endpoint for Prometheus to scrape, which is how first-party instrumentation works in every supported language. An exporter translates a system you cannot modify, a scrape config only says where to look, and a recording rule can only derive from metrics that already exist.
Official docs