Skip to content

Added overview of Prometheus #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions content/prometheus_overview.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[prometheus_overview]]
= Prometheus Overview
////
First draft
////

Prometheus is an open-source, microservice monitoring system designed for reliability. This toolkit collects metrics from applications and makes them viewable. DevOps teams can use Prometheus to view application statistics and configure alerts. The toolkit's built-in query language gives DevOps the power to view the data they need to see.

Prometheus servers pull data from targets at a regular frequency and save it for a set period. The application applies rules to collected data to create time-based series or generate alerts. Prometheus users can aggregate time series data and view it in tabular or graph form.

Prometheus is a standalone server application with minimal infrastructure requirements. It is independent from remote services to increase reliability. If infrastructure problems arise, DevOps teams can still rely on Prometheus for diagnostics.
126 changes: 126 additions & 0 deletions content/querying_istio_metrics.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
[[querying-istio-metrics-with-prometheus]]
= Querying Istio Metrics With Prometheus

////
Pulled from istio.github.io and converted from Markdown to Asciidoc
////

This process illustrates how to query Istio metrics with Prometheus from the web interface.

The link:/istio-docs/Doc-Installing-ServiceMesh/topics/tutorial-bookinfo.adoc/[Bookinfo] application is used in the examples presented here.

[[before-you-begin]]
== Before You Begin

link:/docs/setup/[Install Istio] in your cluster and deploy an
application.

[[querying-istio-metrics]]
== Querying Istio Metrics

1. Verify that the `prometheus` service is running in your cluster.
+
In Kubernetes environments, issue the following command:
+
----
kubectl -n istio-system get svc prometheus NAME
CLUSTER-IP EXTERNAL-IP PORT(S) AGE prometheus 10.59.241.54 9090/TCP 2m
----
+
2. Send traffic to the mesh.
+
For the Bookinfo sample, visit `http://$GATEWAY_URL/productpage` in your
web browser or issue the following command:
+
----
curl http://$GATEWAY_URL/productpage
----
+
[NOTE]
====
`$GATEWAY_URL` is the value set in the
link:/istio-docs/Doc-Installing-ServiceMesh/topics/tutorial-bookinfo.adoc/[Bookinfo] example.
====

3. Start the Prometheus web interface.
+
In Kubernetes environments, issue this command:
+
----
kubectl -n istio-system port-forward $(kubectl -n
istio-system get pod -l app=prometheus -o
jsonpath=`\{.items[0].metadata.name}') 9090:9090 &
----
+
4. Visit http://localhost:9090/graph in your web browser.

5. Run a Prometheus query.
+
In the `Expression` input box at the top of the web page, enter the
text: `istio_requests_total` and click *Execute*.
+
The result will resemble this:
+
----
< image width=``100%'' ratio=``42.63%''
link=``./prometheus_query_result.png'' caption=``Prometheus Query
Result'' >
----

[[additional-queries]]
=== Additional Queries

* Total count of all requests to the `productpage` service:
+
----
istio_requests_total\{destination_service=``productpage.default.svc.cluster.local''}
----

* Total count of all requests to `v3` of the `reviews` service:
+
----
istio_requests_total\{destination_service=``reviews.default.svc.cluster.local'',
destination_version=``v3''}
----

* Rate of requests over the past 5 minutes to all instances of the
`productpage` service:
+
----
rate(istio_requests_total\{destination_service=~“productpage.*``,
response_code=''200“}[5m])
----

[[about-the-prometheus-add-on]]
== About the Prometheus Add-On

Mixer includes a built-in https://prometheus.io[Prometheus] adapter
that exposes an endpoint serving generated metric values. The Prometheus
add-on is a Prometheus server preconfigured to scrape Mixer
endpoints to collect the exposed metrics. It provides a mechanism for
persistent storage and querying of Istio metrics.

The configured Prometheus add-on scrapes three endpoints:

1. *istio-mesh* (`istio-mixer.istio-system:42422`): all Mixer-generated
mesh metrics.
2. *mixer* (`istio-mixer.istio-system:9093`): all Mixer-specific
metrics for monitoring the Mixer.
3. *envoy* (`istio-mixer.istio-system:9102`): raw stats generated by
Envoy translated from Statsd to Prometheus.

For more on querying Prometheus, see
https://prometheus.io/docs/querying/basics/[the Prometheus query documentation].

[[cleanup]]
== Cleanup

1. Remove any `kubectl port-forward` processes that are still running:
+
----
killall kubectl
----

2. When you are finished, see the
link:/istio-docs/Doc-Installing-ServiceMesh/topics/tutorial-bookinfo.adoc/[Removing the Bookinfo Application] instructions to
remove the application.