The deployment is working and the standalone monitors I've created are working, however, I'm also attempting to use the Autodiscover feature with pods annotated according to the documentation and they're all failing to start with the following error:
{
"log.level": "warn",
"@timestamp": "2023-11-23T11:20:52.889Z",
"log.origin": {
"file.name": "hints/monitors.go",
"file.line": 123
},
"message": "unable to find valid hosts for {"name":"platform-admin","schedule":"@every 30s","type":"http","urls":"platform-admin.foundations.svc.cluster.local/health/ping"}: %!w(*errors.errorString=&{no hosts selected for port 5000 with hints: })",
"service.name": "heartbeat",
"ecs.version": "1.6.0"
}
This is an example of the set of annotations on each pod:
Interestingly I also have some annotated pods that need a TCP monitor and they all work fine.
I've tried shelling into the heartbeat container and doing a curl request to the above HTTP health endpoint and I can get a 200 back so the pod/container itself has connectivity to the namespace in which the other service lives.
I think you want to use service... I am looking and a bit confused on urls vs host I see urls in some of my code. If you use service the annotation need to be on the service not the pod.
BTW this is the sample Google Online Boutique App.
Now I am purposely monitoring the Service not the Pod .... I want to know when the service is down not 1 of the 3 pods if that makes sense...
data:
heartbeat.yml: |-
heartbeat.autodiscover: # Enable one or more of the providers below
providers:
- type: kubernetes
resource: service
scope: cluster
node: ${NODE_NAME}
hints.enabled: true
Here is a sample service yes it is hosts not urls I still had URLs in my code not sure if that changed at some point but hosts works urls does not.
Also exec into the heartbeat container and make sure your urls resolve ...
@stephenb brilliant! I think that might have sorted it
I'll add the annotation to a few more services and see how it goes. Also yes it makes perfect sense to target the services not the pods, thanks for the tip!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.