# How to create a simple Prometheus exporter?

The simplest way is just to create an API with the `/metrics` route that will serve your metrics to Prometheus in a typical way.  Your API get a response should look like this:

```
# HELP metric_name metric_help
# TYPE metric_name counter
metric_name 10
```

Where `# HELP` is your metric name and some brief description of your metric, `# TYPE` it is the type of the metric([the list of supported types](https://prometheus.io/docs/concepts/metric_types/)), and the last row is the value of your metric.&#x20;

To configure your Prometheus to read from this API(let's imagine it runs locally on a 3000 port), add the next configuration to your Prometheus server:

```yaml
scrape_configs:
  - job_name: prometheus
    metrics_path: /metrics
    scrape_interval: 30s
    static_configs:
    - targets:
      - localhost:3000
```

You can also use already existing libraries and frameworks for this purpose. A nice example of a library like this is [prom-client](https://www.npmjs.com/package/prom-client) for NodeJS.&#x20;
