1595389140
In this short video, Rudy de Busscher shows how to connect MicroProfile Metrics with Prometheus and Grafana to produce useful graphics and to help investigate your microservice architecture.
The goal of MicroProfile Metrics is to expose monitoring data from the implementation in a unified way. It also defines a Java API so that the developer can define and supply his own values.
Prometheus is the most popular Open-Source product for gathering metrics. It was started in 2012 by SoundCloud (online audio distribution platform and music sharing) and in 2018 graduated at the Cloud Native Computing Foundation. You can see it as a database for storing time series but has many more features -Multi-dimensional data model with time series -Query Language -Pull data from metric sources -Alert Manager, Therefore, MicroProfile Metrics exposes the values in the Prometheus format by default. So it can be consumed easily by the scrapers.
Grafana is a multi-platform open-source solution for running data analytics, pulling up metrics that make sense of the massive amount of data, and monitoring apps through customizable dashboards.
#java #microservices #microprofile #grafana #prometheus
1595389140
In this short video, Rudy de Busscher shows how to connect MicroProfile Metrics with Prometheus and Grafana to produce useful graphics and to help investigate your microservice architecture.
The goal of MicroProfile Metrics is to expose monitoring data from the implementation in a unified way. It also defines a Java API so that the developer can define and supply his own values.
Prometheus is the most popular Open-Source product for gathering metrics. It was started in 2012 by SoundCloud (online audio distribution platform and music sharing) and in 2018 graduated at the Cloud Native Computing Foundation. You can see it as a database for storing time series but has many more features -Multi-dimensional data model with time series -Query Language -Pull data from metric sources -Alert Manager, Therefore, MicroProfile Metrics exposes the values in the Prometheus format by default. So it can be consumed easily by the scrapers.
Grafana is a multi-platform open-source solution for running data analytics, pulling up metrics that make sense of the massive amount of data, and monitoring apps through customizable dashboards.
#java #microservices #microprofile #grafana #prometheus
1593102660
Metrics are a great way to find useful information about our application and infrastructure. Before we start using metrics and preparing reports for the business, we need to integrate our app with some tools. That’s why today our focus is on how to measure, which means that we’re going to delve deep into how our application code works in the first place.
In the previous article, we described how it is possible to uncover various problems with an app by finding bottlenecks in the project, why metrics are great to do this, and why we went for the Prometheus tool to accomplish our objectives. Today, we’re going to actually start measuring the app.
Most of us prefer to check things by themselves rather than implementing them without knowing if this whole thing works as expected. Luckily, there is a live demothat contains the default Prometheus dashboard and is integrated with Grafana.
One of the best things about Prometheus is the support for many languages. In most cases, we don’t need to worry about how to write integration and handle all the best practices. Here you can find a list of client libraries to work with Prometheus.
Currently, there are around 20 libraries for different technologies! If your technology is not on the list, you can follow a special guide which explains how to write your own integration.
The application which we needed to optimize and integrate metrics for was written in PHP/Symfony. We’re going to present examples in these technologies. Still, it would be easy enough to transfer it to something else.
Let’s get back to the application.
We wanted to save time and deliver a solution as soon as possible. We used the existing bundle instead of writing a new one. Our choice was the tweedgolf bundle. It’s a nice and small library which has got everything that we needed.
#developer stories #devops #grafana #metrics #php #prometheus #symfony
1604034000
This blog post is written by guest author Bhavin Gandhi, Software Engineer at InfraCloud Technologies, Inc. InfraCloud helps startups, SMBs, and enterprises scale by adopting cloud-native technologies.
Using the Prometheus Operator has become a common choice when it comes to running Prometheus in a Kubernetes cluster. It can manage Prometheus and Alertmanager for us with the help of CRDs in Kubernetes. The kube-prometheus-stack Helm chart (formerly known as prometheus-operator) comes with Grafana, node_exporter, and more out of the box.
In a previous blog post about Prometheus, we took a look at setting up Prometheus and Grafana using manifest files. We also explored a few of the metrics exposed by YugabyteDB. In this post, we will be setting up Prometheus and Grafana using the kube-prometheus-stack chart. And we will configure Prometheus to scrape YugabyteDB pods. At the end we will take a look at the YugabyteDB Grafana dashboard that can be used to visualize all the collected metrics.
Before we get started with the setup, make sure you have a Kubernetes 1.16+ cluster with kubectl pointing to it. You can create a GKE cluster or an equivalent in other cloud providers or use Minikube to create a local cluster.
We will be using Helm 3 to install the charts, make sure you have it installed on your machine as well.
The kube-prometheus-stack Helm chart installs the required CRDs as well as the operator itself. The chart creates instances of Prometheus and Alertmanager, which are the custom resources managed by the operator.
It also comes with a set of components which one would expect to have while setting up monitoring in a Kubernetes cluster. These components include: node_exporter for collecting node level metrics, kube-state-metrics which exposes Kubernetes related metrics, and Grafana for visualizing the metrics collected by Prometheus. The chart also comes with default Grafana dashboards and Prometheus alerts.
To setup Helm with the prometheus-community and yugabytedb repositories, run the following command:
$ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
"prometheus-community" has been added to your repositories
$ helm repo add yugabytedb https://charts.yugabyte.com
"yugabytedb" has been added to your repositories
$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "yugabytedb" chart repository
...Successfully got an update from the "prometheus-community" chart repository
Update Complete. ⎈ Happy Helming!⎈
To create a values file for kube-prometheus-stack, execute:
cat <<EOF > kube-prom-stack-values.yaml
grafana:
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /var/lib/grafana/dashboards/default
dashboards:
default:
yugabytedb:
url: https://raw.githubusercontent.com/yugabyte/yugabyte-db/master/cloud/grafana/YugabyteDB.json
EOF
The above kube-prom-stack-values.yaml file tells Grafana to import the YugabyteDB dashboard from the given GitHub URL.
Now we will create a namespace and install kube-prometheus-stack in it.
$ kubectl create namespace monitoring
namespace/monitoring created
$ helm install prom prometheus-community/kube-prometheus-stack \
--namespace monitoring \
--values kube-prom-stack-values.yaml
To check if all the components are running fine, check the status of pods from the monitoring
namespace.
$ kubectl get pods --namespace monitoring
NOTE: To keep things simple, we are not providing any other options to the Helm chart. Make sure you go through the README of kube-prometheus-stack and grafana chart to explore other options that you may need.
With the monitoring setup done, let’s install the YugabyteDB Helm chart. It will install YugabyteDB and configure Prometheus to scrape (collect) the metrics from our pods. It uses the ServiceMonitor Custom Resource (CR) to achieve that.
To create a namespace and install the chart, run the following command:
$ kubectl create namespace yb-demo
namespace/yb-demo created
$ helm install cluster-1 yugabytedb/yugabyte \
--namespace yb-demo \
--set serviceMonitor.enabled=true \
--set serviceMonitor.extraLabels.release=prom
If you are using Minikube, refer to this documentation section and add the resource requirements accordingly.
To check the status of all the pods from the yb-demo
namespace, execute the following command. Wait till all the pods have a Running
status.
#databases #distributed sql #kubernetes #grafana #prometheus #prometheus operator
1621253580
You may already know how important it is to measure the performance of your app, or even how to integrate with tools such as Prometheus. But if you can’t visualize your data in an easy-to-read and organized manner, you won’t get much out of it. There’s a cool, open-source tool for that. In the last part of the Metrics in optimization process series, we’re teaching you how to create a dashboard in Grafana, so that you can produce a new dashboard that even the business department will follow.
In the previous three articles, we talked about why you should measure your app’s metrics, how you can integrate it with Prometheus and how to go about collecting statistics.
Since we have now a lot of data to show we should think about the presentation layer. The true purpose of it is to present data in a way that gives us what we need, rather than just as a disorganized pile of trash. It will not just make pretties, but also far more useful. Another important thing is that the data, which we collected with Prometheus, doesn’t have an easy-to-read format. Today it’s time to show ugly metrics data in a beautiful way.
As you know from previous articles, we collect data from Kubernetes and our application. We are going to show an example of how to configure a dashboard, what is important, and why we did it this way. We are not going to show and describe all options in Grafana, just the ones that we needed to configure our charts (hey, it’s a crash course, after all!).
#developer stories #data #devops #grafana #kubernetes #prometheus
1625838420
The MicroProfile Metrics specification is all about creating metrics (counter, timer, etc.) and exposing them via HTTP to get insights into your application. Watch this video to learn everything you need to know about this specification.
» Corresponding blog post: https://rieckpil.de/whatis-eclipse-microprofile-metrics/
» Source code on GitHub: https://github.com/rieckpil/getting-started-with-eclipse-microprofile
» More about MicroProfile: https://rieckpil.de/category/microprofile/
#microprofile #metrics