Telefonica / prometheus-kafka-adapter

Use Kafka as a remote storage database for Prometheus (remote write only)
Apache License 2.0
364 stars 135 forks source link

Add more explanation on how prometheus-kafka-adapter work to link to Prometheus #68

Open Tshadowburn opened 3 years ago

Tshadowburn commented 3 years ago

Hello I'm here seeking for help but also to suggest to developp the documentation a little bit more as there are some concepts that aren't natural to grasp.

I find it very difficult to understand how the connexion between Prometheus and prometheus-kafka-adapter is established through the remote-write as the prometheus-kafka-adapter is deployed in a kubernetes cluster for me how does the URL that is in the remote-write can be in anyway associated to my prometheus-kafka-adapter service , and it certainly confuse me more because the readme suggests to use a nodeport type of service which do not have an URL , to do that an ingress should be the way but I tried and it didn't work also so if anyone has the same objectif : have the prometheus-kafka-adapter on a kubernetes cluster and the prometheus in another server . Please share the solution with me . Thank you

palmerabollo commented 3 years ago

Hi @AitZaid, thanks for your feedback.

I'm not sure I understand your setup. Can you confirm that your prometheus-kafka-adapter runs in a Kubernetes cluster and Prometheus runs in a server that is not part of the same cluster? @jpfe-tid could you please confirm that a Service with type: LoadBalancer is a good option to make prometheus-kafka-adapter visible to an external Prometheus (via remote_write)?

Tshadowburn commented 3 years ago

@palmerabollo yes, I confirm that, so here is in this schema the situation we have our Prometheus is run in our docker on another server : Untitled Diagram

the question is how Prometheus connect to Prometheus-Kafka-adapter, for instance, I do understand the connection between Prometheus-Kafka-adapter to Kafka because in my deployment of the Prometheus-Kafka-adapter I define the brokers to access and give the SSL file to connect, the topic name ..., but for the Prometheus, I'm clueless :), so how adding this to my Prometheus.yml will make it reach my prometheus-Kafka-adapter? : `remote_write:

Best regards

jpfe-tid commented 3 years ago

@palmerabollo : @jpfe-tid could you please confirm that a Service with type: LoadBalancer is a good option to make prometheus-kafka-adapter to an external Prometheus (via remote_write)?

Yes, either type: LoadBalancer for a provider managed load balancer or type: NodePort for exposing prometheus-kafka-adapter service in a specific port of all nodes in the cluster, which can later be managed by an external load balancer or DNS discovery.


Hi @AitZaid,

The URL in th example ("http://prometheus-kafka-adapter:8080/receive") is meant to work for a Kubernetes service named prometheus-kafka-adapter with port 8080 exposed and accessed from a workload in the same Kubernetes namespace.

Checkout Kubernetes official documentation (https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) on how to expose a workload for external access.