Yes, you will want to use a PodMonitor or ServiceMonitor.

https://github.com/prometheus-operator/prometheus-operator/blob/main/example/user-guides/getting-started/example-app-pod-monitor.yaml

On Sun, Jul 17, 2022 at 6:50 AM Brian Candler <[email protected]> wrote:

> You need to scrape the individual pods, not the load-balanced service.
>
> On Sunday, 17 July 2022 at 05:27:13 UTC+1 [email protected] wrote:
>
>> Hi all,
>> I would like to collect metrics from multiple microservice instances
>> running in a Kubernetes cluster. Therefore I configure a target in the
>> Prometheus.yml with the target endpoint (e.g.
>> http://xxx.xxx.xx/my-service:3000. There is a loadbalancer before the
>> scaled up microservices. In my understanding it is randomly wich
>> mircoservice metrics Prometheus scrapes. Am I right? What would be the best
>> practice to solve this issue?
>>
>> Thank you in advance!
>>
>> BR
>> Simon
>>
> --
> 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/0173dce4-0e83-40f3-9bfd-bf6758d64c04n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/0173dce4-0e83-40f3-9bfd-bf6758d64c04n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABbyFmqaknpoocDKkg4Vgo6sB%3Dnj2qmSdRBzAq9g%3DaBmOTH8%3DQ%40mail.gmail.com.

Reply via email to