influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.21k stars 3.51k forks source link

Replace scrapers functionality with tasks using prometheus.scrape #15445

Open russorat opened 4 years ago

russorat commented 4 years ago

as a user when i create and configure a scraper then i would like a task created to actually scrape the data

so now that flux has the prometheus.scrape endpoint, we can replace the existing scraper functionality with Flux tasks.

Example Flux:

import "experimental/prometheus"

option task = {name: "Flux Scrape Data", every: 5s}

prometheus.scrape(url: "http://localhost:9999/metrics")
    |> map(fn: (r) =>
        ({r with scrape_interval: string(v: task.every)}))
    |> to(bucket: "flux_scrape_data", org: "influxdata")

and updated template dashboard: influxdb_2.0_oss_metrics_update.json.zip

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

russorat commented 4 years ago

blocked by https://github.com/influxdata/flux/issues/2076

tgmpje commented 2 years ago

@SnoozeThis https://github.com/influxdata/flux/issues/2076

SnoozeThis commented 2 years ago

(https://snoozeth.is/GeqRPsE4D28) I will wait until https://github.com/influxdata/flux/issues/2076 is closed and then add a comment.

SnoozeThis commented 2 months ago

Resolved.