Skip to content

Commit

Permalink
display metrics for ignored published events in grafana [resource]
Browse files Browse the repository at this point in the history
  • Loading branch information
montaro committed Apr 30, 2019
1 parent b10c9b4 commit 39e8cc4
Show file tree
Hide file tree
Showing 12 changed files with 385 additions and 1 deletion.
Expand Up @@ -43,6 +43,7 @@ spec:
- --max_source_id_length={{ .Values.global.publishKnative.maxSourceIDLength }}
- --max_event_type_length={{ .Values.global.publishKnative.maxEventTypeLength }}
- --max_event_type_version_length={{ .Values.global.publishKnative.maxEventTypeVersionLength }}
- --monitoring_port={{ .Values.monitoring.port }}
ports:
- name: http
containerPort: {{ .Values.port }}
Expand Down
@@ -0,0 +1,9 @@
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: 'event-bus-publish-knative-metrics-destination-rule'
spec:
host: event-bus-publish-knative-metrics-service.event-bus.svc.cluster.local
trafficPolicy:
tls:
mode: DISABLE
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: '{{ template "publish-knative.fullname" . }}-metrics-service'
labels:
app: {{ template "publish-knative.fullname" . }}
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
spec:
type: {{ .Values.service.type }}
ports:
- name: metrics-port
port: {{ .Values.monitoring.port }}
selector:
app: {{ template "publish-knative.fullname" . }}
release: {{ .Release.Name }}
@@ -0,0 +1,21 @@
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
namespace: kyma-system
name: '{{ template "publish-knative.fullname" . }}-service-monitor'
labels:
prometheus: monitoring
app: {{ template "publish-knative.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
selector:
matchLabels:
app: {{ template "publish-knative.fullname" . }}
endpoints:
- port: metrics-port
interval: {{ .Values.monitoring.interval }}
namespaceSelector:
any: true
2 changes: 2 additions & 0 deletions resources/event-bus/charts/publish-knative/values.yaml
Expand Up @@ -13,3 +13,5 @@ trace:
monitoring:
grafana: enabled
alerts: enabled
port: 9090
interval: 30s
Expand Up @@ -6,6 +6,22 @@
{{- printf "%s-%s" .Release.Name "subscription-controller-knative" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "subscription-controller-knative-metrics.name" -}}
{{- printf "%s-%s" .Release.Name "subscription-controller-knative-metrics" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "subscription-controller-knative-metrics-service.name" -}}
{{- printf "%s-%s" .Release.Name "subscription-controller-knative-metrics-service" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "subscription-controller-knative-metrics-service-monitor.name" -}}
{{- printf "%s-%s" .Release.Name "subscription-controller-knative-metrics-service-monitor" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "subscription-controller-knative-metrics-destination-rule.name" -}}
{{- printf "%s-%s" .Release.Name "subscription-controller-knative-metrics-destination-rule" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "subscription-controller-knative.labels.standard" -}}
app: {{ template "subscription-controller-knative.name" . }}
heritage: {{ .Release.Service | quote }}
Expand Down
@@ -0,0 +1,9 @@
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: {{ template "subscription-controller-knative-metrics-destination-rule.name" . }}
spec:
host: {{ template "subscription-controller-knative-metrics-service.name" . }}.{{ .Release.Namespace }}.svc.cluster.local
trafficPolicy:
tls:
mode: DISABLE
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "subscription-controller-knative-metrics-service.name" . }}
labels:
{{ include "subscription-controller-knative.labels.standard" . | indent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- name: metrics-port
port: {{ .Values.monitoring.port }}
selector:
app: {{ template "subscription-controller-knative.fullname" . }}
release: {{ .Release.Name }}
@@ -0,0 +1,20 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
namespace: kyma-system
name: {{ template "subscription-controller-knative-metrics-service-monitor.name" . }}
labels:
prometheus: monitoring
app: {{ template "subscription-controller-knative.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
selector:
matchLabels:
app: {{ template "subscription-controller-knative.name" . }}
endpoints:
- port: metrics-port
interval: {{ .Values.monitoring.interval }}
namespaceSelector:
any: true
Expand Up @@ -8,5 +8,7 @@ image:
monitoring:
grafana: enabled
alerts: enabled
port: 9090
interval: 30s
service:
type: ClusterIP
2 changes: 1 addition & 1 deletion resources/event-bus/values.yaml
Expand Up @@ -7,7 +7,7 @@ global:
path: eu.gcr.io/kyma-project
event_bus:
dir: develop/
version: 6b02c95f
version: 1362c0a6
event_bus_tests:
dir: develop/
version: f4c58b01
Expand Down

0 comments on commit 39e8cc4

Please sign in to comment.