Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] How do I ingest Prometheus metric txt files into VictoriaMetrics #614

Closed
anjakefala opened this issue Jul 9, 2020 · 9 comments
Labels
question The question issue

Comments

@anjakefala
Copy link

The documentation lead to me to believe that it should be possible to backfill with metrics from Prometheus exporters:

Supports metrics’ scraping, ingestion and backfilling via the following protocols:
Metrics from Prometheus exporters such as node_exporter. See these docs for details.

We have txt files which contain the raw Prometheus metrics in Prometheus metric format. i.e.

up{instance="foo:1337", job="node", origin="foo"} 1.000000 1594285791544

However, clicking on the linked documentation did not really help me figure out how to ingest these files. I see documentation for scraping node exporter targets, but I am confused from reading it how I ingest metrics these txt files that already exist. /import does not work because it only accepts json files. It cannot parse these.

@valyala valyala added the question The question issue label Jul 9, 2020
@valyala
Copy link
Collaborator

valyala commented Jul 9, 2020

VictoriaMetrics doesn't have a handler for importing data in Prometheus format. You need to scrape it by exposing it via Prometheus exporter - see https://victoriametrics.github.io/#how-to-scrape-prometheus-exporters-such-as-node-exporter for details. Note that you should set honor_timestamps: true in scrape_config in order to honor the given timestamps.

See also backfilling docs about importing historical data into VictoriaMetrics.

@anjakefala
Copy link
Author

You need to scrape it by exposing it via Prometheus exporter - see https://victoriametrics.github.io/#how-to-scrape-prometheus-exporters-such-as-node-exporter for details.

Thanks for the swift response! I saw those documents, but had trouble understanding them. The confusion is that I do not understand what is meant by the words scrape and exposing.

@valyala
Copy link
Collaborator

valyala commented Jul 10, 2020

scraping means collecting metrics from Prometheus exporters such as node_exporter. VictoriaMetrics can be configured to collect such metrics if -promscrape.config command-lime arg points to Prometheus config with scrape targets (i.e. addresses of Prometheus exporters to collect metrics from).
exposing means returning metrics in Prometheus format be http server when /metrics page is requested.

BTW, the next version of VictoriaMetrics will support data ingestion in Prometheus format via /api/v1/import/prometheus. See more details at https://victoriametrics.github.io/#how-to-import-data-in-prometheus-exposition-format . You can try this feature by building VictoriaMetrics from sources. See https://victoriametrics.github.io/#how-to-build-from-sources

@anjakefala
Copy link
Author

Thanks, @valyala! I will give it a try.

By the way, I really like that in the docs you include a "verifying the ingestion worked" section.

@anjakefala
Copy link
Author

Great news, @valyala! It totally works. Thank you so much for this feature.

@anjakefala
Copy link
Author

Hi @valyala, as an open source maintainer, I feel like the scum of the Earth asking this question.

Do you know which version of VM this feature is slated for? I see that you have a very rapid/frequent release process. =)

@valyala
Copy link
Collaborator

valyala commented Jul 14, 2020

Do you know which version of VM this feature is slated for?

This will be included in v1.38.1 release. I'll post a message here when the release will be published (until the end of this week).

Re-opening this issue until v1.38.1 is released.

@valyala valyala reopened this Jul 14, 2020
@valyala
Copy link
Collaborator

valyala commented Jul 14, 2020

@anjakefala , VictoriaMetrics v1.38.1 has been released. It supports /api/v1/import/prometheus handler for importing data in Prometheus exposition format. Closing this issue as done.

@valyala valyala closed this as completed Jul 14, 2020
@anjakefala
Copy link
Author

👏 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The question issue
Projects
None yet
Development

No branches or pull requests

2 participants