Activating Prometheus on Eclipse Hono? - eclipse-hono

i have recently installed eclipse-hono on a minikube with driver=none.
I want to use Grafana to show me the telemetry data and therefore I need to use Prometheus.
As you can see in the following picture, no port is assigned to Grafana or Prometheus.
This port needs to be exposed as I need to access the application from outside the server, where hono is running.
How can I activate the prometheus and grafana service?

Related

NodeJs + Puppeteer on Azure App Services fails to run

I've wrote a simple NodeJs (ExpressJs) server that uses Puppeteer to generate PDF files on JSON data being passed to it. While locally everything is working like charm, I'm struggling to run this server on Azure App Services.
I've created a Resource group, within it I've created an App Servces instance (running on Linux) that is connected to my repo at Azure DevOps (via the Deployment Center).
My server has two endpoints:
/ - returns a JSON - { status: "ok" }. I'm using this to validate the running server instance.
/generate-pdf - uses the Puppeteer to generate and return a PDF file.
After successfully starting the App Service instance I'm able to access the "/" route and get a valid response but upon accessing the "/generate-pdf" route the result is "502 - Bad Gateway".
Does my instance require some additional configuration that I haven't done?
Does App Services can not run Puppeteer? Perhaps there is a different service on Azure that I need to use?
Is there a way to automate the process via the Azure DevOps pipeline or release?
Any questions/thoughts/FAQs are more than welcomed. Thanks =)
I'm answering my own question: as was mentioned here https://stackoverflow.com... the Azure App Services does not allow the use of GDI (which is required by Chrome) regardless if you're using Linux or Windows based system. The solution was to put the NodeJs application into a Docker container and manually install Chrome. Once you have a container - just upload it to the Azure App Services and viola!
By default App Servies exposes 80 and 443 ports, so if your application listens on a different port be sure to specify it via the WEBSITES_PORT environment variable.
In my case, I had to upload the Docker image to the Docker hub but you can also set up a pipeline to automate the process.
I've built the Docker image on my M1 Pro and it led to some arch issues when the container was uploaded to Azure. Be sure to add the --platform linux/amd64 in the image-building step if you're building for Linux.

Monitor the kubernetes services with grafana dash board-Azure

I have helm to install the git-hub repo for the grafana as shown in below
helm repo add Prometheus Prometheus-community https://promentheus-community.github.io/helm-charts
helm install Prometheus-community/kube-Prometheus-stack -n Prometheus
kubectl get namespaces
After that I have configured the grafana it will work on port 9090, I have exposed to 9090 using port-forward command,
When I open the browser with localhost:9090 I am not able to see any grafana page, its showing ERR_CONECTION error/Localhost refused to connect, After some time when I refresh again now I am able to see the grafana page
Everything works fine till now after that I am trying to open the grafana dashboard to monitor the logs it is asking admin user name credentials but I did not mention any credentials but it is asking
My questions are
1). How to login with grafana to monitor the logs and also I want to import the azure monitor metrics to check in the grafana dashboard
2). Is any thing do we need to add role based polices or service principal we have to add to login the grafana
Can any one help me how to login the grafana dashboard to monitor the logs
Thanks in advance
My grafana page is look like
I tried to reproduce the same issue in m environment and got the below results
For login into the Grafana dashboard we don't need to assign the service principal or role based polices , if we want to get the metrics into the Grafana dashboard than only we have to add the role based polices
I have added the helm repository and updated the helm using below commands
helm repo add prometheus-community [https://prometheus-community.github.io/helm-charts](https://prometheus-community.github.io/helm-charts)
Installed the Prometheus using below command
helm install prometheus prometheus-community/kube-prometheus-stack -n namespace_name
I have configured the Prometheus and Grafana and exposed to port 9090 using port forward
kubectl port-forward -n prometheus prometheus-prometheus-kube-prometheus-prometheus-0 9090
To login to grafana dashboard username and password should require
I have followed the some commands to get the username and password, usually admin name and password are in encrypted format we can decode using base64
kubectl get secret -n namespace_name Prometheus-grafana -o=sonpath=[{.data.admin-user}'|base64 -d
kubectl get secret -n namespace_name Prometheus-grafana -o=sonpath=[{.data.admin-password}'|base64 -d
I have done the local port forwarding for Grafana
kubectl port-forward -n prometheus prometheus-grafana-55b48f4cf9-rzkgv(pod_name) 3000
When I open localhost:3000 and login with username and password I am able to see the Grafana dashboard
If we use role based polices we can able to access the azure metrics for particular service area
You can find the commands list for reference below

Accessing data from a relative kubenetes service url from another service using nodjes in the same cluster

I am in a kubernetes cluster with two services running. One of the services expose a endpoint like /customer/servcie-endpoint and other service is a nodejs application which is trying to access data from this service. Axios doesn't work as it needs a host to work with.
If I do a kubectl exec shell and run curl /customer/servcie-endpoint I receive all the data.
I am not sure how to get this data in a nodejs application. Sry for naive ask!

How to expose metrics to Prometheus from springboot application CF cluster

I am developing an application from scratch using Springboot (Jhipster) and intend to deploy in a cloudfoundry with multiple nodes. Planning to setup prometheus server which can pull metrics from the cluster.
I am trying to understand how can I setup Prometheus to query individual nodes of the cluster. As the application is deployed in cloud foundry, it may not be possible to obtain the ip address of individual nodes.
As I am newbie with Prometheus, want to make sure I am solutioning appropriately.
I would recommend using Micrometer.io
You can use either service discovery (e.g. Netflix Eureka) or use the Pushgateway in some form.
https://prometheus.io/docs/instrumenting/pushing/
https://prometheus.github.io/client_java/io/prometheus/client/exporter/PushGateway.html

Link containers in Azure Container Service with Mesos & Marathon

I'm trying to deploy a simple WordPress example (WordPress & MySQL DB) on Microsofts new Azure Container Service with Mesos & Marathon as the underlying orchestration platform. I already ran this on the services offered by Google (Kubernetes) and Amazon (ECS) and thought it would be an easy task on ACS as well.
I have my Mesos cluster deployed and everything is up and running. Deploying the MySQL container isn't a problem either, but when I deploy my WordPress container I can't get a connection to my MySQL container. I think this might be because MySQL runs on a different Mesos agent?
What I tried so far:
Using the Mesos DNS to get ahold of the MySQL container host (for now I don't really care which container I get ahold of). I set the WORDPRESS_DB_HOST environment var to mysql.marathon.mesos and specified the host of MySQL container as suggested here.
I created a new rule for the Agent Load Balancer and a Probe for port 3306 in Azure itself, this worked but seems like a very complicated way to achieve something so simple. In Kubernetes and ECS links can be simply defined by using the container name as hostname.
An other question that came up, what difference is their in Marathon between setting the Port in the Port Mappings Section and in the Optional Settings section. (See screenshot attached)
Update: If I ssh into the master node than I can dig by using mysql.marathon.mesos, how ever I can't get a connection to work from within an other container (in my case the wordpress container).
So there are essentially two questions here: one around stateful services on Marathon, the other around port management. Let me first clarify that neither has to do anything with Azure or ACS in the first place, they are both Marathon-related.
Q1: Stateful services
Depending on your requirements (development/testing or prod) you can either use Marathon's persistent volumes feature (simple but no automatic failover/HA for the data) or, since you are on Azure, a robust solution like I showed here (essentially mounting a file share).
Q2: Ports
The port mapping you see in the Marathon UI screen shot is only relevant if you launch a Docker image and want to explicitly map container ports to host ports in BRIDGE mode, see the docs for details.

Resources