Merge pull request #515 from influxdata/flux/prometheus-package

Flux Prometheus package
pull/516/head
Scott Anderson 2019-10-12 07:21:01 -06:00 committed by GitHub
commit af24739894
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 95 additions and 14 deletions

View File

@ -19,7 +19,7 @@ _**Function type:** Transformation_
{{% warn %}}
The `experimental.addDuration()` function is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
This specific function will be removed once duration vectors are implemented.
See [influxdata/flux#413](https://github.com/influxdata/flux/issues/413).

View File

@ -16,8 +16,8 @@ The Flux Bigtable package provides tools for working with data in
[Google Cloud Bigtable](https://cloud.google.com/bigtable/) databases.
{{% warn %}}
The Bigtable package is currently experimental and is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
The Bigtable package is currently experimental and subject to change at any time.
By using this package, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
{{% /warn %}}
Import the `experimental/bigtable` package:

View File

@ -15,8 +15,8 @@ data source.
_**Function type:** Input_
{{% warn %}}
The `bigtable.from()` function is currently experimental and is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
The `bigtable.from()` function is currently experimental and subject to change at any time.
By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
{{% /warn %}}
```js

View File

@ -19,7 +19,7 @@ _**Function type:** Transformation_
{{% warn %}}
The `experimental.group()` function is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
This specific function will be removed once the proposed `extend` mode is sufficiently vetted.
{{% /warn %}}

View File

@ -15,8 +15,8 @@ v2.0/tags: [functions, mqtt, package]
Flux MQTT functions provide tools for working with Message Queuing Telemetry Transport (MQTT) protocol.
{{% warn %}}
The MQTT package is currently experimental and is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
The MQTT package is currently experimental and subject to change at any time.
By using this package, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
{{% /warn %}}
Import the `experimental/mqtt` package:

View File

@ -14,8 +14,8 @@ The `mqtt.to()` function outputs data to an MQTT broker using MQTT protocol.
_**Function type:** Output_
{{% warn %}}
The `mqtt.to()` function is currently experimental and is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
The `mqtt.to()` function is currently experimental and subject to change at any time.
By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
{{% /warn %}}
```js

View File

@ -15,7 +15,7 @@ _**Function type:** Transformation_
{{% warn %}}
The `experimental.objectKeys()` function is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
{{% /warn %}}
```js

View File

@ -0,0 +1,29 @@
---
title: Flux Prometheus package
list_title: Prometheus package
description: >
The Flux Prometheus package provides functions for working with Prometheus-formatted metrics.
Import the `experimental/prometheus` package.
menu:
v2_0_ref:
name: Prometheus
parent: Experimental
weight: 201
v2.0/tags: [functions, prometheus, package]
---
Flux Prometheus functions provide tools for working with
[Prometheus-formatted metrics](https://prometheus.io/docs/instrumenting/exposition_formats/).
{{% warn %}}
The Prometheus package is currently experimental and subject to change at any time.
By using this package, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
{{% /warn %}}
Import the `experimental/prometheus` package:
```js
import "experimental/prometheus"
```
{{< children type="functions" show="pages" >}}

View File

@ -0,0 +1,52 @@
---
title: prometheus.scrape() function
description: >
The `prometheus.scrape()` function retrieves Prometheus-formatted metrics
from a specified URL.
menu:
v2_0_ref:
name: prometheus.scrape
parent: Prometheus
weight: 301
related:
- /v2.0/write-data/scrape-data/scrapable-endpoints/
---
The `prometheus.scrape()` function retrieves [Prometheus-formatted metrics](https://prometheus.io/docs/instrumenting/exposition_formats/)
from a specified URL.
The function groups metrics (including histogram and summary values) into individual tables.
_**Function type:** Input_
{{% warn %}}
The `prometheus.scrape()` function is currently experimental and subject to change at any time.
By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
{{% /warn %}}
```js
import "experimental/prometheus"
prometheus.scrape(
url: "http://localhost:9999/metrics"
)
```
## Parameters
### url
The URL to scrape Prometheus-formatted metrics from.
_**Data type: String**_
## Examples
### Scrape Prometheus metrics and write them to InfluxDB
```js
import "experimental/prometheus"
prometheus.scrape(url: "https://example-url.com/metrics")
|> to(
org: "example-org",
bucket: "example-bucket"
)
```

View File

@ -22,7 +22,7 @@ _**Function type:** Transformation_
{{% warn %}}
The `experimental.set()` function is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
{{% /warn %}}
```js

View File

@ -19,7 +19,7 @@ _**Function type:** Transformation_
{{% warn %}}
The `experimental.subDuration()` function is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
This specific function will be removed once duration vectors are implemented.
See [influxdata/flux#413](https://github.com/influxdata/flux/issues/413).

View File

@ -20,7 +20,7 @@ _**Function type:** Output_
{{% warn %}}
The `experimental.to()` function is subject to change at any time.
By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
{{% /warn %}}
```js