Configure email alert using OpenShift Grafana operator

  • What Grafana version and what operating system are you using?
    Grafana 4.6.0 community operator from Openshift operatorHub
    Linux with OpenShift 4.10

  • What are you trying to achieve?
    I’m trying to set up email alert notifications in Grafana.

  • How are you trying to achieve it?
    Currently I have Grafana configured with the OpenShift built in Prometheus with Slack alerts. When I try to set up email alerts I get a message that says I need to set up SMT using the grafana.ini file. I looked at the documentation and it only mentions grafana.ini file to enable SMTP. Since I used the Grafana operator, I’m not really sure if this file exits or where to find it? How can I enable SMTP to use email alerts? The only files I have to create were the YAML files to create the Grafana instance and datasource. Do I have to specify SMTP in one of those files or somewhere else?

  • Did you follow any online instructions? If so, what is the URL?

https://thriftly.io/docs/components/Thriftly-Deployment-Beyond-the-Basics/Metrics-Prometheus/Creating-Receiving-Email-Alerts.html

Grafana YAML filed used to deploy instance in OpenShift

apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
  creationTimestamp: '2022-09-16T21:06:10Z'
  generation: 1
  managedFields:
    - apiVersion: integreatly.org/v1alpha1
      fieldsType: FieldsV1
      fieldsV1:
        'f:spec':
          .: {}
          'f:config':
            .: {}
            'f:auth':
              .: {}
              'f:disable_signout_menu': {}
            'f:auth.anonymous':
              .: {}
              'f:enabled': {}
            'f:log':
              .: {}
              'f:level': {}
              'f:mode': {}
            'f:security':
              .: {}
              'f:admin_password': {}
              'f:admin_user': {}
          'f:dashboardLabelSelector': {}
          'f:ingress':
            .: {}
            'f:enabled': {}
      manager: Mozilla
      operation: Update
      time: '2022-09-16T21:06:10Z'
    - apiVersion: integreatly.org/v1alpha1
      fieldsType: FieldsV1
      fieldsV1:
        'f:status':
          .: {}
          'f:message': {}
          'f:phase': {}
          'f:previousServiceName': {}
      manager: manager
      operation: Update
      subresource: status
      time: '2022-09-16T21:06:11Z'
  name: cluster-grafana
  namespace: grafana
  resourceVersion: '158944'
  uid: 3736b3f5-f06b-4f42-98e9-bf1648f545f7
spec:
  config:
    auth:
      disable_signout_menu: true
    auth.anonymous:
      enabled: true
    log:
      level: warn
      mode: console
    security:
      admin_password: XXXXXx
      admin_user: XXXXXX
  dashboardLabelSelector:
    - matchExpressions:
        - key: app
          operator: In
          values:
            - grafana
  ingress:
    enabled: true
status:
  message: success
  phase: reconciling
  previousServiceName: grafana-service