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

Implement remote_write method #308

Closed
iglov opened this issue Feb 4, 2020 · 8 comments
Closed

Implement remote_write method #308

iglov opened this issue Feb 4, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@iglov
Copy link

iglov commented Feb 4, 2020

So that we can build the scheme
prom-vm-scheme

@valyala valyala added the enhancement New feature or request label Feb 4, 2020
@valyala
Copy link
Collaborator

valyala commented Feb 4, 2020

Thanks for the feature request! It looks useful. I'll think about the best implementation.

Currently the following workarounds exist that allow writing metric subsets into distinct VictoriaMetrics instances:

  1. Prometheus can be configured with multiple remote_write sections. Each section can contain distinct configs for write_relabel_configs and distinct url values pointing to distinct VictoriaMetrics instances. This way Prometheus will write data simultaneously to all the configured remote_write destinations after applying write_relabel_configs to them.

  2. VictoriaMetrics supports /federate endpoint, so it is possible to configure additional Prometheus instances that would scrape the required subset of metrics from VictoriaMetrics via /federate endpoint and write them to another VictoriaMetrics instances.

@valyala
Copy link
Collaborator

valyala commented Feb 21, 2020

@iglov , the outlined scheme with metrics relabeling will be possible soon with the upcoming vmagent tool. It can accept data via remote_write API, relabel it and then write it to other remote storage systems via remote_write API. Read more information about it here.

@valyala
Copy link
Collaborator

valyala commented Feb 25, 2020

@iglov
Copy link
Author

iglov commented Mar 2, 2020

Hey, Sashka! :)
Well, seems like it isn't exactly what i want, but ok. Is this possible with vmagent to do something like this:
prom-vmagent-scheme-1

@valyala
Copy link
Collaborator

valyala commented Mar 2, 2020

Currently -remoteWrite.relabelConfig is shared among all the configured -remoteWrite.url values. I think it would be nice to add ability to set per-remote storage relabel configs in vmagent. In this case your schema should work.

In the mean time you can add yet another vmagent in front of each victoriametrics, which will delete unneeded metrics according to its relabel configs. Note that vmagent instances may be chained, since they support data ingestion via Prometheus remote_write API at http://vmagent:8429/api/v1/write endpoint.

valyala added a commit that referenced this issue Mar 3, 2020
…ual relabeling for each `-remoteWrite.url`

Updates #320
Updates #308
valyala added a commit that referenced this issue Mar 3, 2020
…ual relabeling for each `-remoteWrite.url`

Updates #320
Updates #308
@valyala
Copy link
Collaborator

valyala commented Mar 3, 2020

@iglov , the per-remote storage relabeling has been added to vmagent in the commit 02b55c7 . It allows setting -remoteWrite.urlRelabelConfig for each configured -remoteWrite.url:

/path/to/vmagent \
  -remoteWrite.url=http://vm1:8428/api/v1/write -remoteWrite.urlRelabelConfig=relabel1.yml \
  -remoteWrite.url=http://vm2:8428/api/v1/write -remoteWrite.urlRelabelConfig=relabel2.yml

Try building vmagent from sources according to these instructions and verifying whether it works for your case.

@valyala
Copy link
Collaborator

valyala commented Mar 3, 2020

The per-remote storage relabeling via -remoteWrite.urlRelabelConfig has been added in v1.34.2.

Closing the feature request as done. @iglov , feel free re-opening it or creating new feature request if you feel you need additional functionality related to this feature request.

@valyala valyala closed this as completed Mar 3, 2020
@iglov
Copy link
Author

iglov commented Mar 4, 2020

O-o-ok, i'll see and if i'll have any question, i'll ask on telegram, thx Sashka ;)

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

2 participants