How to configure SMTP server for integrated Grafana

I was wondering if there is a way to configure the smtp settings from the grafana.ini below through the gitlab.rb configuration file?

grafana.ini

=====================

    ################################## SMTP / Emailing #########################
    [smtp]
    enabled = true
    host = smtp.office365.com:587
    user = "username"
    password = "password"
    from_address = grafana@domain.com
    from_name = Grafana

I’v tried going into the grafana.ini and changing the configuration directly but the changes are overwritten when I run gitlab-ctl reconfigure. I’ve also tried using the gitlab.rb general convention when it comes to other other grafana configuration optionsThis text will be hidden grafana['poperty_name'] = "value"

gitlab.rb

==============================

grafana['enable'] = true
grafana['log_directory'] = '/var/log/gitlab/grafana'
grafana['home'] = '/var/opt/gitlab/grafana'
grafana['admin_password'] = 'secretpassword'

#### Guesses based on convention:
grafana['smtp_enabled'] = true
grafana['smtp_host'] = 'smtp.office365.com:587'
grafana['smtp_user'] = 'username'
grafana['smtp_password'] = 'password'
grafana['from_address'] = 'grafana@domain.com'
grafana['from_name'] = 'Grafana'

The goal is to be able to send user invitation emails when adding a user from the grafana dashboard. Open to any advice on how to have functional email alerts and invitations.

2 Likes

I got same problem. I can’t setup notification via Email
I hope we have other way to modify stmp of grafana