When the exporter starts, it binds to a configured port and exposes the internal state of whatever is being collected in an HTTP endpoint of your choosing (the default being /metrics). The instrumentation data is collected when an HTTP GET request is made to the configured endpoint. For example, node exporter, one of the most commonly used exporters, relies on a number of kernel statistics to present data such as disk I/O, CPU, memory, network, filesystem usage, and much, much more. Every single time that endpoint is scraped, the information is quickly gathered and exposed in a synchronous operation.
If you are the one writing the service, the best option is to instrument the code directly using a Prometheus client library. There are official client libraries available for the following programming languages:
- Go
- Java/JVM
- Python
- Ruby
There are community-driven client libraries for the following programming languages:
- Bash
- C++
- Common Lisp
- Elixir
- Erlang
- Haskell
- Lua for NGINX
- Lua for Tarantool
- .NET
- C#
- Node.js
- Perl
- PHP
- Rust
Due to an ever-growing community around Prometheus, this list is constantly expanding.
Usually, exporters are very light and the performance footprint is mostly negligible but, as always, there are exceptions for this rule, on which we will go into considerable detail later in this book.