Skip to content

Commit 34889a1

Browse files
authored
Feature/istio metrics (#4253)
Metrics, dashboards and docs
1 parent 5582513 commit 34889a1

File tree

30 files changed

+5530
-8
lines changed

30 files changed

+5530
-8
lines changed

packages/istio/_dev/build/docs/README.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Istio Integration
22

3-
This integration ingest access logs created by the [Istio](https://istio.io/) service mesh.
3+
This integration ingest access logs and metrics created by the [Istio](https://istio.io/) service mesh.
44

55
## Compatibility
66

@@ -15,3 +15,61 @@ The `access_logs` data stream collects Istio access logs.
1515
{{event "access_logs"}}
1616

1717
{{fields "access_logs"}}
18+
19+
20+
## Metrics
21+
22+
### Istiod Metrics
23+
24+
The `istiod_metrics` data stream collects Istiod metrics.
25+
26+
{{event "istiod_metrics"}}
27+
28+
{{fields "istiod_metrics"}}
29+
30+
### Proxy Metrics
31+
32+
The `proxy_metrics` data stream collects Istio proxy metrics.
33+
34+
{{event "proxy_metrics"}}
35+
36+
{{fields "proxy_metrics"}}
37+
38+
39+
## How to setup and test Istio locally
40+
41+
1. Setup a Kubernetes cluster. Since the Istio sample app requires lots of RAM (> 10GB) it's preferable to use a managed Kubernetes cluster (any cloud provider will do).
42+
2. Setup a EK cluster on Elastic Cloud. For the same reason that Istio sample app requires a lot of RAM, it's unfeasible to run the Elastic cluster on your laptop via elastic-package. As an alternative ECK might be used as well.
43+
3. Start elastic agents on Kubernetes cluster. The easiest way to achieve this is by using Fleet Server. You can find instructions [here](https://www.elastic.co/guide/en/fleet/master/running-on-kubernetes-managed-by-fleet.html)
44+
4. Download Istio cli following the [instructions](https://istio.io/latest/docs/setup/getting-started/#download).
45+
5. Install Istio via [instructions](https://istio.io/latest/docs/setup/getting-started/#install). The namespace `default` is used with this basic installation. This is the same namespace where we are going to run the Istio sample app.
46+
6. Deploy the sample application via [instructions](https://istio.io/latest/docs/setup/getting-started/#bookinfo)
47+
7. Open the application to external traffic and determine the ingress IP and ports. This step is slightly different depending where Kubernetes is running. More info at [here](https://istio.io/latest/docs/setup/getting-started/#ip) and [here](https://istio.io/latest/docs/setup/getting-started/#determining-the-ingress-ip-and-ports). The following commands should be enough to get this working.
48+
49+
```bash
50+
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
51+
istioctl analyze
52+
53+
# since we are using a cloud environment with an external load balancer
54+
export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
55+
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
56+
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}')
57+
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
58+
```
59+
60+
From the same terminal run the following command to open a browser to that link. This should verify that the sample application is reachable.
61+
62+
```bash
63+
open "http://$GATEWAY_URL/productpage"
64+
```
65+
66+
8. Generate some traffic to the sample application
67+
68+
69+
```bash
70+
for i in $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_URL/productpage"; done
71+
```
72+
73+
9. (Optional) You can visualize the graph of microservices in the sample app via [instructions](https://istio.io/latest/docs/setup/getting-started/#dashboard).
74+
9. Add the Istio integration from the registry.
75+
10. View logs and/or metrics from the Istio integration using the Discovery tab and selecting the right Data view
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: '2.3'
2+
services:
3+
istio_is_ready:
4+
image: tianon/true
5+
depends_on:
6+
istio:
7+
condition: service_healthy
8+
istio:
9+
image: nginx:alpine
10+
ports:
11+
- 8080
12+
volumes:
13+
- ./nginx.conf:/etc/nginx/nginx.conf
14+
- ./istiod.txt:/www/data/metrics/istiod.txt
15+
- ./proxy.txt:/www/data/metrics/proxy.txt
16+
healthcheck:
17+
interval: 1s
18+
retries: 120
19+
timeout: 120s
20+
test: |-
21+
curl -f -s http://localhost:8080/metrics/ -o /dev/null

packages/istio/_dev/deploy/docker/istiod.txt

Lines changed: 525 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
worker_processes 1;
2+
3+
events { worker_connections 1024; }
4+
5+
http {
6+
sendfile on;
7+
8+
server {
9+
listen 8080;
10+
11+
root /www/data;
12+
13+
location /metrics {
14+
autoindex on;
15+
}
16+
}
17+
}

packages/istio/_dev/deploy/docker/proxy.txt

Lines changed: 961 additions & 0 deletions
Large diffs are not rendered by default.

packages/istio/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "0.2.0"
3+
changes:
4+
- description: Metrics for Istiod and Proxy sidecar container
5+
type: enhancement # can be one of: enhancement, bugfix, breaking-change
6+
link: https://github.com/elastic/integrations/pull/4253
27
- version: "0.1.0"
38
changes:
49
- description: Initial release

packages/istio/data_stream/access_logs/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type: logs
33
release: experimental
44
streams:
55
- input: filestream
6-
title: Collect Istio access logs
6+
title: Istio access logs
77
description: Collect Istio access logs either in text or json format
88
vars:
99
- name: paths

packages/istio/data_stream/access_logs/sample_event.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"@timestamp": "2022-07-20T09:52:24.955Z",
3+
"data_stream": {
4+
"namespace": "default",
5+
"type": "logs",
6+
"dataset": "istio.access_logs"
7+
},
38
"destination": {
49
"address": "10.68.2.10:9080",
510
"ip": "10.68.2.10",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
service: istio
2+
data_stream:
3+
vars:
4+
period: 1s
5+
hosts:
6+
- "http://{{Hostname}}:8080"
7+
metrics_path: "/metrics/istiod.txt"
8+
condition: "true"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
metricsets: ["collector"]
2+
period: {{period}}
3+
hosts:
4+
{{#each hosts}}
5+
- {{this}}
6+
{{/each}}
7+
condition: {{ condition }}
8+
{{#if metrics_path}}
9+
metrics_path: {{metrics_path}}
10+
{{/if}}
11+
metrics_filters.exclude:
12+
{{#each metrics_filters.exclude}}
13+
- {{this}}
14+
{{/each}}
15+
metrics_filters.include:
16+
{{#each metrics_filters.include}}
17+
- {{this}}
18+
{{/each}}
19+
use_types: true
20+
rate_counters: true

0 commit comments

Comments
 (0)