hi,

well there is a hacky trick you can do - scrape very often, and make sure
that you add a label that identifies the backend in the backend response.

instead of
node_cpu_seconds{cpu=1} 10
return
node_cpu_seconds{cpu=1,backend=vm1} 10

then ignore or rewrite the instance label as it would be the same for both.

given that you scrape often enough you should gather the data from both the
machines eventually

hth,


On Tue, Mar 17, 2020 at 10:32 PM Christian Hoffmann <
[email protected]> wrote:

> Hi,
>
> On 3/17/20 10:02 AM, Eswar Rao Bevara wrote:
> > I have a spring boot application running on two vms and sitting behind a
> > load balancer. when I try to scrape using the application url/insights ,
> > each time the call goes to one of the two vms. I want to have the
> > metrics scrapped from each vm separately and then would search for a
> > solution on combining them in Grafana.
> >
> > Any suggestion on how to get the metrics from both the vms to the
> > prometheus server.
>
> I guess your Prometheus server does not have access to the
> non-load-balanced services, right? This would of course be the simplest
> variant.
>
> Other than that, you would have to trick your loadbalancer somehow.
> Either it already has some kind of session affinity which you could use
> or you could introduce such a thing (e.g. ?force-backend=1, different
> vhost or something).
>
> I don't think there is a standard way for that...?
>
> Kind regards,
> Christian
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/4f25af97-3df2-7234-b281-10c1b4d98934%40hoffmann-christian.info
> .
>


-- 
Kuba Jakubik

SRE Tech Lead

Netguru - Building software for world changers
[email protected]
netguru.com
[image: facebook] <https://www.facebook.com/netguru> [image: twitter]
<https://twitter.com/netguru> [image: linkedin]
<https://www.linkedin.com/company/netguru/>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAD5xb_F_MD%3D%2B3pV5PPQW_oidzqpRyCumiwWzBVLUT1ruNwXuQw%40mail.gmail.com.

Reply via email to