Victoriametrics: Question regarding simple use case of collecting metrics

Created on 10 Dec 2020  路  5Comments  路  Source: VictoriaMetrics/VictoriaMetrics

Hello! I am relatively new to metrics collection systems. I have read readme and docs here but still i have some unclear points. Thanks in advance for addressing this. So:

  • what is the right strategy for using VM: in what cases we need vmagent, and is it necessary at all?
  • can we use just JSON HTTP API import and export (/api/v1/import and /api/v1/export) endpoints to get and put (push strategy, not pull) into VM ?
  • what is the simplest use case? Just VM (no vmagent) + pushing app (an app which will use /import method or any other ingestion way), right?
  • what is the right way to configure VM for pulling (scraping) metric endpoints from app? Documentation says a lot about Prometheus configuration file but how it relates to VM? All this became a mess in my mind.

Thanks in advance. Sure that there are simple answers for this.

question

Most helpful comment

Hi @mtfelian! Here's a how-to article for collecting metrics if you're writing a Go application. It includes VM and Grafana configuration https://victoriametrics.medium.com/how-to-monitor-go-applications-with-victoriametrics-c04703110870

All 5 comments

what is the right strategy for using VM: in what cases we need vmagent, and is it necessary at all?

The following docs describe cases for vmagent - https://victoriametrics.github.io/vmagent.html#use-cases .

can we use just JSON HTTP API import and export (/api/v1/import and /api/v1/export) endpoints to get and put (push strategy, not pull) into VM ?

yes.

what is the simplest use case? Just VM (no vmagent) + pushing app (an app which will use /import method or any other ingestion way), right?

yes.

what is the right way to configure VM for pulling (scraping) metric endpoints from app? Documentation says a lot about Prometheus configuration file but how it relates to VM?

Single-node VictoriaMetrics can scrape Prometheus-compatible exporters. It accepts the path to Prometheus configuration file via -promscrape.config command-line flag. The Prometheus configuration file should contain configs for scrape targets according to this specification. See more details at https://victoriametrics.github.io/#how-to-scrape-prometheus-exporters-such-as-node-exporter .

@valyala Oh thank you! Docs are very cool but a bit confusing for first-time experience with metrics gathering solution.

So to have full picture of things (in simple case) in our Grafana we need, as i understood, the following (except the VM and Grafana itself):

  • Unix exporter in case of Unix server (https://github.com/prometheus/node_exporter)
  • Windows exporter in case of Windows server (https://github.com/prometheus-community/windows_exporter)
  • imported library in apps to instrument Go code (https://github.com/prometheus/client_golang)
  • exposed /metrics endpoint for _pull_ strategy or HTTP client to VM (or other type of client) for _push_ strategy in apps to be able to watch for custom apps metrics

Is my understanding right? Thank you.

Yes, your understandings are correct. I'd recommend taking a look at https://github.com/VictoriaMetrics/metrics instead of https://github.com/prometheus/client_golang for exporting app metrics.

Hi @mtfelian! Here's a how-to article for collecting metrics if you're writing a Go application. It includes VM and Grafana configuration https://victoriametrics.medium.com/how-to-monitor-go-applications-with-victoriametrics-c04703110870

Finally, after e.g. having configured vmagent, how can one verify, whether it sends the right data to the vmdb?
I.e. an easy way to make sure, that certain labels/values get replaced/inserted/modified on the right metrics?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

faceair picture faceair  路  3Comments

genericgithubuser picture genericgithubuser  路  4Comments

v98765 picture v98765  路  3Comments

0xBF picture 0xBF  路  3Comments

WilliamDahlen picture WilliamDahlen  路  3Comments