I have a micro-service implemented in Ballerina. Whenever I deploy the service using following command, in my local machine ballerina run --observe [name_of_the_file].bal, I get metrics endpoint mapped to port 9797. That is curl localhost:9797/metrics gives server metrics as a response.
Even when I deployed the above service in Docker environment I got the same results. But when I deployed it in Kubernetes (On GoogleCloudPlatform), I don't get the metrics mapped to the port 9797.
kubectl logs [pod_name] gives the following output.
Initiating service(s) in 'ballerina-prime.balx'
[ballerina/http] started HTTP/WS endpoint 0.0.0.0:8688
Can someone help me get the metrics mapped to port 9797?
Dockerfile
FROM ballerina/ballerina:0.991.0
COPY ballerina-prime.balx /home/ballerina
EXPOSE 8688
EXPOSE 9797
CMD ballerina run --observe ballerina-prime.balx
ballerina-prime.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: ballerina-prime
labels:
app: ballerina-prime
spec:
replicas: 1
selector:
matchLabels:
app: ballerina-prime
template:
metadata:
labels:
app: ballerina-prime
spec:
containers:
- name: ballerina-prime
image: anushiya/ballerina-prime:v3
resources:
limits:
cpu: "100m"
requests:
cpu: "100m"
ports:
- containerPort: 8688
name: echo-service
- containerPort: 9797
name: metrics