---
title: prometheus.scrape() function
description: prometheus.scrape() scrapes Prometheus metrics from an HTTP-accessible endpoint and returns them as a stream of tables.
url: https://docs.influxdata.com/flux/v0/stdlib/experimental/prometheus/scrape/
estimated_tokens: 624
product: Flux
version: v0
---

# prometheus.scrape() function

-   Flux 0.50.0+
-   View InfluxDB support

`prometheus.scrape()` is experimental and [subject to change at any time](/flux/v0/stdlib/experimental/#experimental-packages-are-subject-to-change).

`prometheus.scrape()` scrapes Prometheus metrics from an HTTP-accessible endpoint and returns them as a stream of tables.

##### Function type signature

```js
(url: string) => stream[A] where A: Record
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### url

(Required) URL to scrape Prometheus metrics from.

## Examples

### Scrape InfluxDB OSS internal metrics

```js
import "experimental/prometheus"

prometheus.scrape(url: "http://localhost:8086/metrics")
```

#### Related

-   [Create scrapable endpoints](/influxdb/v2/write-data/no-code/scrape-data/scrapable-endpoints/)

[inputs](/flux/v0/tags/inputs/) [prometheus](/flux/v0/tags/prometheus/)
