Skip to content

Commit

Permalink
updated to work with Istio 1.0 metrics (#13)
Browse files Browse the repository at this point in the history
* updated to work with Istio 1.0 metrics

* removed duplicate
  • Loading branch information
nmnellis authored Oct 20, 2018
1 parent c96983a commit 23b5db8
Show file tree
Hide file tree
Showing 5 changed files with 443 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ It has 2 components:

- Vistio-Web: Forked from [Promviz-front](https://github.com/mjhd-devlion/promviz-front): based on Netflix's [vizceral](https://github.com/Netflix/vizceral) to render traffic graph.

## Updated for Istio 1.0
The helm charts have been updated to work with Istio 1.0

## Features:
- Generates and renders traffic graph in realtime
- Able to replay from any time in the past
- Able to generate notices on node and connection from prom query
- Provides a sidecar application for k8s that watches config changes and reload Vistio server in runtime
- Fits with [Istio](https://istio.io)'s metrics


![](https://github.com/nmnellis/vistio/blob/master/documentation/sample.png)

## Architecture
Expand Down
6 changes: 3 additions & 3 deletions helm/vistio/values-mesh-only.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ vistioConfig:
maxVolume: 100
clusterConnections:
# Total requests per second of the mesh
- query: sum(rate(istio_request_count[1m])) by (response_code)
- query: sum(rate(istio_requests_total[1m])) by (response_code)
prometheusURL: http://prometheus.istio-system:9090
source:
replacement: "Total Mesh Requests"
Expand All @@ -27,10 +27,10 @@ vistioConfig:
- cluster: istio-mesh
maxVolume: 100
serviceConnections:
- query: sum(rate(istio_request_count[1m])) by (source_service,destination_service,response_code)
- query: sum(rate(istio_requests_total[1m])) by (source_app,destination_service,response_code)
prometheusURL: http://prometheus.istio-system:9090
source:
label: source_service
label: source_app
target:
label: destination_service
status:
Expand Down
6 changes: 3 additions & 3 deletions helm/vistio/values-with-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ vistioConfig:
maxVolume: 2000000
clusterConnections:
# Total requests per second coming into the ingress controller from internet
- query: sum(rate(istio_request_count{destination_service="istio-ingressgateway.istio-system.svc.cluster.local"}[1m])) by (response_code)
- query: sum(rate(istio_requests_total{reporter="source", source_workload="istio-ingressgateway"}[1m])) by (response_code)
prometheusURL: http://prometheus.istio-system:9090
source:
replacement: INTERNET
Expand All @@ -25,10 +25,10 @@ vistioConfig:
- cluster: istio-mesh
maxVolume: 3000
serviceConnections:
- query: sum(rate(istio_request_count[1m])) by (source_service,destination_service,response_code)
- query: sum(rate(istio_requests_total[1m])) by (source_app,destination_service,response_code)
prometheusURL: http://prometheus.istio-system:9090
source:
label: source_service
label: source_app
target:
label: destination_service
status:
Expand Down
216 changes: 216 additions & 0 deletions vistio-mesh-only-1.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
---
# Source: vistio/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: vistio-api-config
labels:
heritage: Tiller
chart: "vistio-0.1.0"
app: vistio
release: vistio
data:
vistio.yaml: |-
clusterLevel:
- cluster: istio-mesh
maxVolume: 100
serviceConnections:
- notices:
- name: HighErrorRate
severityThreshold:
error: 0.05
warning: 0.01
statusType: danger
title: '[{{ .value }}] High Error Rate'
prometheusURL: http://prometheus.istio-system:9090
query: sum(rate(istio_requests_total[1m])) by (source_app,destination_service,response_code)
source:
label: source_app
status:
dangerRegex: ^5..$
label: response_code
warningRegex: ^4..$
target:
label: destination_service
globalLevel:
clusterConnections:
- prometheusURL: http://prometheus.istio-system:9090
query: sum(rate(istio_requests_total[1m])) by (response_code)
source:
replacement: Total Mesh Requests
status:
dangerRegex: ^5..$
label: response_code
warningRegex: ^4..$
target:
replacement: istio-mesh
maxVolume: 100
graphName: Vistio
---
# Source: vistio/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: vistio-api
labels:
heritage: Tiller
chart: "vistio-0.1.0"
app: vistio-api
release: vistio
spec:
type: ClusterIP
selector:
app: vistio-api
release: vistio
ports:
- name: http
port: 9091
targetPort: 9091
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: vistio-web
labels:
heritage: Tiller
chart: "vistio-0.1.0"
app: vistio-web
release: vistio
spec:
type: ClusterIP
selector:
app: vistio-web
release: vistio
ports:
- name: http
port: 8080
targetPort: 8080
protocol: TCP

---
# Source: vistio/templates/deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: vistio-web
labels:
heritage: Tiller
chart: "vistio-0.1.0"
app: vistio-web
release: vistio
spec:
replicas: 1
template:
metadata:
labels:
app: vistio-web
release: vistio
spec:
containers:
- name: vistio
image: "nmnellis/vistio-web:v0.1.0"
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: UPDATE_URL
value: http://localhost:9091/graph
- name: INTERVAL
value: "1000"
- name: MAX_REPLAY_OFFSET
value: "43200"
resources:
{}


---
# Source: vistio/templates/statefulset.yaml
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: vistio-api
labels:
heritage: Tiller
chart: "vistio-0.1.0"
app: vistio-api
release: vistio
spec:
replicas: 1
serviceName: vistio
template:
metadata:
labels:
app: vistio-api
release: vistio
spec:
containers:
- name: vistio-api
image: nmnellis/vistio-api:v0.1.0
imagePullPolicy: IfNotPresent
args:
- --config.file=/etc/vistio/vistio.yaml
- --log.level=info
- --storage.path=/var/vistio/data
- --storage.retention=24h
- --cache.size=100
- --retrieval.scrape-interval=10s
- --retrieval.scrape-timeout=8s
- --api.port=9091
ports:
- containerPort: 9091
livenessProbe:
httpGet:
path: /
port: 9091
initialDelaySeconds: 30
timeoutSeconds: 30
readinessProbe:
httpGet:
path: /
port: 9091
initialDelaySeconds: 30
timeoutSeconds: 30
resources:
{}

volumeMounts:
- name: config
mountPath: /etc/vistio
- name: vistio-db
mountPath: /var/vistio/data
subPath: vistio-db
- name: reloader
image: nghialv2607/k8s-config-reloader:v0.1.0
imagePullPolicy: IfNotPresent
args:
- --config.promviz-reload-url=http://localhost:9091/reload
- --config.promviz-config-dir=/etc/vistio
- --config.log-level=info
resources:
limits:
cpu: 50m
memory: 64Mi
requests:
cpu: 20m
memory: 32Mi

volumeMounts:
- name: config
mountPath: /etc/vistio
volumes:
- name: config
configMap:
name: vistio-api-config
volumeClaimTemplates:
- metadata:
annotations:
volume.beta.kubernetes.io/storage-class: standard
name: vistio-db
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
Loading

0 comments on commit 23b5db8

Please sign in to comment.