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

Add remote_write support to victoria metrics (single) #1645

Open
zbindenren opened this issue Sep 23, 2021 · 10 comments
Open

Add remote_write support to victoria metrics (single) #1645

zbindenren opened this issue Sep 23, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@zbindenren
Copy link

zbindenren commented Sep 23, 2021

Is your feature request related to a problem? Please describe.
Currently if someone wants to replace prometheus (with remote_write configured), he must install and configure two services:

  • vmagent -> scraping and remote write
  • victoria-metrics -> metrics server

vmagent has to be configured to remote write to localhost (victoria-metrics) and to the instance configured in prometheus.yaml.

This makes it harder for someone to switch from prometheus to victoria-metrics or just to try it out.

Describe the solution you'd like

Pefered Solution:
Since victoria-metrics (single) already supports:

  • scraping
  • alerting

via prometheus.yaml it would be great if it would also pick up the configured remote write entries in prometheus.yaml and starts sending metrics to the configured server.

With that change it would be easier to switch from prometheus to victoria-metrics (for people that do not need a cluster yet).

Other Solution:
For me personally it would already be ok to configure the remote write stuff with the already known flags from vmagent (-remoteWrite.url etc).

Describe alternatives you've considered
Use vmagent with two remote urls as described above.

Additional context
This issue was created because it was suggested so in slack channel.

@hagen1778
Copy link
Collaborator

hagen1778 commented Sep 23, 2021

Hi @zbindenren! For people who already own a Prometheus server and wants to try out VictoriaMetrics - why don't just add VictoriaMetrics to remote_write config?
If scraping feature needs to be tested then user can feed prometheus.yaml config directly to VictoriaMetrics.

@hagen1778 hagen1778 added the question The question issue label Sep 23, 2021
@zbindenren
Copy link
Author

Hi @zbindenren! For people who already own a Prometheus server and wants to try out VictoriaMetrics - why don't just add VictoriaMetrics to remote_write config?
If scraping feature needs to be tested then user can feed prometheus.yaml config directly to VictoriaMetrics.

Yes that is true. I just explain our situation.

Currently we are using some prometheus instances to scrape and remote write some data. Each prometheus server scrapes all other prometheus server. We have alert rules in place when one server is down. We have promxy configured to to query all prometheus servers and there are always two prometheus server scraping the same instance.

To accomplish the same with victoria metrics I have to configure 3 services (victoria-metrics, vmagent and vmalert). So I have to monitor on each node 3 services. It would be much simpler if I could do that with one service. In my opinion it is more complex to configure and operate above scenario with victoria metrics.

I see now, that I would still need two services, even if remote write is supported. As I see vmalert is not included too. So if this feature has any chance to get implemented, I would also like vmauth included.

@valyala valyala added the enhancement New feature or request label Sep 23, 2021
@slavitch
Copy link

In my use case I'd like to have a victoria-metrics behind a NAT remote-write to grafana could,

@Haleygo
Copy link
Collaborator

Haleygo commented Nov 11, 2022

In my case, I would like to scrape and recording in worker cluster, then remote write data to global cluster to do query job.
To accomplish that, I need single victoria-metrics, vmagent and vmalert in worker cluster now, it would be great if that can reduce to two services or even one :)

@ptimofee
Copy link

ptimofee commented Apr 17, 2023

Wow, I was really surprised and disappointed when I found out vmsingle can not remote_write like prometheus does.
In this case vmsingle CAN NOT be a prometheus replacement as you can't build the same chain of regional -> global cluster remote_write like prometheus can do.

@hagen1778
Copy link
Collaborator

hagen1778 commented Apr 26, 2023

@ptimofee it is expected that VictoriaMetrics is a final destination in a chain.
For traffic distribution please use vmagent - it provides a wide list of options for traffic routing.

@jensentanlo
Copy link

jensentanlo commented Jul 31, 2023

I think that this feature is useful in the common use case where we want to use recording rules in individual clusters to aggregate metrics and join labels.

Ideally we’d want to use VM here because it deals with high cardinality situations better, which is exactly where using recording rules to aggregate would be useful.

@hagen1778
Copy link
Collaborator

@jensentanlo if I understand it right, you plan to have something like following:

  1. vm-single-node + vmalert installed per k8s cluster
  2. A centralized VM cluster installation to accumulate data from many k8s clusters
  3. vm-single-node will collect metrics from its local k8s cluster and forwards to centralized cluster only limited number of time series. Other are dropped via relabeling rules.
  4. vmalert performs aggregation and forwards to centralized cluster results of recording rules

If my understanding is right, you can still do this but with adding a vmagent. vmagent will be installed per k8s cluster and will be responsible for metrics collection and forwarding to two destinations:

  1. centralized VM cluster will receive only limited number of time series, as in p3.
  2. local vm-single-node will receive only metrics required for aggregation
  3. vmalert will do the same thing as in p4

So you pay some extra for running additional vmagent. But it doesn't look too expensive, since you can store in local vm-single-node not all series, but those are needed for aggregation.

A better solution for this would be using stream aggregation, which potentially could eliminate the need in vmalert and vm-single-node.

@jensentanlo
Copy link

@hagen1778 Thank you for the detailed write-up, I didn’t realize that vmalert would handle recording rules as well. Your second suggestion looks like it’ll work; thanks a bunch!

@Giovanniuum
Copy link

Hi, another use case for me to add in the balance: we have lots of hosts (around 150 or so) that run a Prometheus agent localy, that scrapes localhost for given metrics, and other exporters for hosts monitoring. All this is already setup, and have working alerting using Mimir alertmanager (with a Terraform toolchain etc., so that it's easy to create our alerting rules).

Because we have a company-deployed Mimir remote storage, we remote_write from those agents to those Mimir. But the mimir remote_write from our company has inconveniants for us, so we want to have our own VictoriaMetrics storage in single-node mode (managed by our team, on around 15 nodes).
To monitor those 15 hosts running VictoriaMetrics, we use node_exporter mainly, that is scraped from prometheus.yaml and exporter to VM server.
But to include the monitoring of these hosts alongside our other 150 hosts monitored through Mimir, we want those node_exporter metrics to be written on Mimir too to let Mimir alertmanager handle all this. But that would mean having VM do remote_write to Mimir tenants, which is currently not possible unless running vmagent on the 15 hosts (or deploying a new alerting chain with vmalert but it would complicate things...).

@valyala valyala removed the question The question issue label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants