Added support for Sentry

Change-Id: I410e54e2f729d1bb9fdc056ea2527b8c7d73b631
This commit is contained in:
Mohammed Naser 2020-08-06 19:58:47 -04:00
parent ae6ec4216a
commit a3c3252b8f
3 changed files with 12 additions and 0 deletions

View File

@ -22,6 +22,10 @@ spec:
image: vexxhost/openstack-operator:latest image: vexxhost/openstack-operator:latest
command: ["/usr/local/bin/kopf"] command: ["/usr/local/bin/kopf"]
env: env:
{{- with .Values.sentryDSN }}
- name: SENTRY_DSN
value: {{ .Values.sentryDSN }}
{{- end }}
- name: OPERATOR_NAMESPACE - name: OPERATOR_NAMESPACE
valueFrom: valueFrom:
fieldRef: fieldRef:

View File

@ -21,6 +21,8 @@ the appropriate deployments, an instance of Keystone, Heat and Horizon
import os import os
import kopf import kopf
import sentry_sdk
from sentry_sdk.integrations import aiohttp
from openstack_operator import ceilometer from openstack_operator import ceilometer
from openstack_operator import chronyd from openstack_operator import chronyd
@ -35,6 +37,11 @@ from openstack_operator import utils
OPERATOR_CONFIGMAP = "operator-config" OPERATOR_CONFIGMAP = "operator-config"
sentry_sdk.init(
integrations=[aiohttp.AioHttpIntegration()],
traces_sample_rate=1.0
)
def operator_configmap(namespace, name, **_): def operator_configmap(namespace, name, **_):
"""Filter on the operator's ConfigMap.""" """Filter on the operator's ConfigMap."""

View File

@ -1,3 +1,4 @@
kopf==0.27rc6 kopf==0.27rc6
Jinja2 Jinja2
sentry-sdk==0.16.3
openstacksdk openstacksdk