diff --git a/data/common/common.yaml b/data/common/common.yaml --- a/data/common/common.yaml +++ b/data/common/common.yaml @@ -1837,6 +1837,10 @@ swh::deploy::graph::backend::listen::host: 127.0.0.1 swh::deploy::graph::backend::listen::port: "%{alias('swh::remote_service::graph::port')}" +swh::deploy::graph::sentry_swh_package: swh.graph +swh::deploy::graph::sentry_environment: "%{alias('swh::deploy::environment')}" +swh::deploy::graph::sentry_dsn: "https://%{lookup('swh::deploy::graph::sentry_token')}@sentry.softwareheritage.org/20" + swh::deploy::journal::conf_directory: "%{hiera('swh::conf_directory')}/journal" swh::deploy::journal::brokers: diff --git a/site-modules/profile/manifests/swh/deploy/graph.pp b/site-modules/profile/manifests/swh/deploy/graph.pp --- a/site-modules/profile/manifests/swh/deploy/graph.pp +++ b/site-modules/profile/manifests/swh/deploy/graph.pp @@ -12,6 +12,10 @@ $user = lookup('swh::deploy::graph::user') $group = lookup('swh::deploy::graph::group') + $sentry_dsn = lookup("swh::deploy::graph::sentry_dsn", Optional[String], 'first', undef) + $sentry_environment = lookup("swh::deploy::graph::sentry_environment", Optional[String], 'first', undef) + $sentry_swh_package = lookup("swh::deploy::graph::sentry_swh_package", Optional[String], 'first', undef) + # install services from templates $services = [ { # this matches the current status 'name' => 'swhgraphshm', diff --git a/site-modules/profile/templates/swh/deploy/graph/swhgraphdev.service.erb b/site-modules/profile/templates/swh/deploy/graph/swhgraphdev.service.erb --- a/site-modules/profile/templates/swh/deploy/graph/swhgraphdev.service.erb +++ b/site-modules/profile/templates/swh/deploy/graph/swhgraphdev.service.erb @@ -7,6 +7,15 @@ Requires=swhgraphshm.service [Service] +<%- if !@sentry_dsn.nil? and !@sentry_dsn.empty? -%> +Environment=SWH_SENTRY_DSN=<%= @sentry_dsn %> +<%- end -%> +<%- if !@sentry_environment.nil? and !@sentry_environment.empty? -%> +Environment=SWH_SENTRY_ENVIRONMENT=<%= @sentry_environment %> +<%- end -%> +<%- if !@sentry_swh_package.nil? and !@sentry_swh_package.empty? -%> +Environment=SWH_MAIN_PACKAGE=<%= @sentry_swh_package %> +<%- end -%> Type=simple User=<%= @user %> Group=<%= @group %>