influxdata / influxdata/influxdb

prometheus.scrape example in documentation does not work: expected stream[#A] but found [B] (array) (argument tables)`

Open
#23,261 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Steps to reproduce:__

1. Read https://docs.influxdata.com/flux/v0.x/prometheus/scrape-prometheus/
2. Run a query of the form
```
import "experimental/prometheus"

prometheus.scrape(url: "http://example.com/metrics")
|> to(bucket: "example-bucket")
```

__Expected behavior:__
Expect the data in the tables to be written to the target bucket

__Actual behavior:__
An error: ` error @3:1-3:61: expected stream[#A] but found [B] (array) (argument tables)`
Note that removing the `to` line results in a successful query with multiple tables (an array of tables?)

__Environment info:__

* System info: Run `uname -srm` and copy the output here
Linux 5.16.11-76051611-generic x86_64

* InfluxDB version: Run `influxd version` and copy the output here
InfluxDB v2.2.0 (git: a2f8538837) build_date: 2022-04-06T17:36:40Z

* Other relevant environment details: Container runtime, disk info, etc
quay docker image

Contributor guide

Open the contributing guide

Research direction

Start with the prometheus.scrape example at the linked documentation page and reproduce it against the reported InfluxDB v2.2.0 environment. Trace how prometheus.scrape produces its multiple tables and how to(bucket: ...) accepts the tables argument. Done means the documented query runs successfully and writes the scraped data to the target bucket.

Written by the indexing model from the issue text.

Assessment

Tech stack
prometheus
Domain
databases, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.