Hello, I’m encountering an issue while configuring...
# support
k
Hello, I’m encountering an issue while configuring the Alert channel type email in Signoz. In the documentation provided here, it mentions that I need to configure a few environment variables. However, in the UI, when configuring it, it only asks for the recipient mail address. Where do I need to configure those values to use the Email Type alert channel? I deployed Self-Hosted Signoz using the Helm chart in Kubernetes.
j
i think you need to update it in the docker compose for the container signoz-alertmanager
k
If we’re using the Helm chart, do I still need to make changes in the Docker Compose file, or is it handled differently? Specifically, I’m referring to the configurations mentioned here.
Hi @Prashant Shahi , @Srikanth Chekuri I’m having some trouble configuring SMTP for Alertmanager .Here’s my
alertmanager
configuration within the
additionalEnvs
section: YAML
Copy code
alertmanager:
  additionalEnvs:
    SMTP_PORT: "25"
    SMTP_USERNAME: "abc..."  # Replace with actual username
    SMTP_FROM: "<mailto:signozalertmanager@abc.com|signozalertmanager@abc.com>"
    SMTP_PASSWORD: "xyz..."  # Replace with actual password
    SMTP_HOST: "mailserver-01.infra.lokal"
However, the signoz trying to connect to “signoz-alertmanager:9093" . Here’s the expected connection string: “signoz-alertmanager.tds:9093” (since Signoz is in the
tds
namespace). Additionally, could you advise on how to disable TLS for SMTP in this configuration and query-service SMTP configuration aswell.
p
@kamal sai perla are you using latest version of SigNoz helm chart?
k
Yes @Prashant Shahi version: 0.42.0 appVersion: 0.46.0
p
can you share the error logs that you are seeing when trying to send email alert?
k
{“level”“ERROR”,“timestamp”“2024-05-27T102156.831Z”,“caller”“alertManager/manager.go175",“msg”:“Received Server Error response for API call to alertmanager”,“error”:“Received Server Error response for API call to alertmanager(POST http://signoz-alertmanager:9093/api/v1/testReceiver)\n%!(EXTRA string=500 Internal Server Error)“,”stacktrace”:“go.signoz.io/signoz/pkg/query-service/integrations/alertManager.(*manager).TestReceiver\n\t/home/runner/work/signoz/signoz/pkg/query-service/integrations/alertManager/manager.go:175\ngo.signoz.io/signoz/pkg/query-service/app.(*APIHandler).testChannel\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/http_handler.go:943\ngo.signoz.io/signoz/pkg/query-service/app.(*APIHandler).RegisterRoutes.(*AuthMiddleware).EditAccess.func8\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/auth.go73\nnet/http.HandlerFunc.ServeHTTP\n\t/opt/hostedtoolcache/go/1.21.10/x64/src/net/http/server.go2136\ngo.signoz.io/signoz/ee/query-service/app.loggingMiddleware.func1\n\t/home/runner/work/signoz/signoz/ee/query-service/app/server.go358\nnet/http.HandlerFunc.ServeHTTP\n\t/opt/hostedtoolcache/go/1.21.10/x64/src/net/http/server.go2136\ngo.signoz.io/signoz/ee/query-service/app.(*Server).analyticsMiddleware-fm.(*Server).analyticsMiddleware.func1\n\t/home/runner/work/signoz/signoz/ee/query-service/app/server.go513\nnet/http.HandlerFunc.ServeHTTP\n\t/opt/hostedtoolcache/go/1.21.10/x64/src/net/http/server.go2136\ngo.signoz.io/signoz/ee/query-service/app.setTimeoutMiddleware.func1\n\t/home/runner/work/signoz/signoz/ee/query-service/app/server.go544\nnet/http.HandlerFunc.ServeHTTP\n\t/opt/hostedtoolcache/go/1.21.10/x64/src/net/http/server.go2136\ngo.signoz.io/signoz/pkg/query-service/app.LogCommentEnricher.func1\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/server.go365\nnet/http.HandlerFunc.ServeHTTP\n\t/opt/hostedtoolcache/go/1.21.10/x64/src/net/http/server.go2136\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\t/home/runner/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210\ngo.signoz.io/signoz/ee/query-service/app.(*Server).createPublicServer.(*Cors).Handler.func2\n\t/home/runner/go/pkg/mod/github.com/rs/cors@v1.10.1/cors.go281\nnet/http.HandlerFunc.ServeHTTP\n\t/opt/hostedtoolcache/go/1.21.10/x64/src/net/http/server.go2136\ngo.signoz.io/signoz/ee/query-service/app.(*Server).createPublicServer.CompressHandler.CompressHandlerLevel.func3\n\t/home/runner/go/pkg/mod/github.com/gorilla/handlers@v1.5.1/compress.go141\nnet/http.HandlerFunc.ServeHTTP\n\t/opt/hostedtoolcache/go/1.21.10/x64/src/net/http/server.go2136\nnet/http.serverHandler.ServeHTTP\n\t/opt/hostedtoolcache/go/1.21.10/x64/src/net/http/server.go:2938\nnet/http.(*conn).serve\n\t/opt/hostedtoolcache/go/1.21.10/x64/src/net/http/server.go:2009”}
p
can you check alertmanager logs?
@kamal sai perla Environment variables are not correct. • `ALERTMANAGER_SMTP_FROM`: The email address from which the alerts are sent. • `ALERTMANAGER_SMTP_HOST`: The SMTP host obtained from your email provider. • `ALERTMANAGER_SMTP_PORT`: The SMTP port obtained from your email provider. • `ALERTMANAGER_SMTP_AUTH_USERNAME`: The SMTP user obtained from your email provider. • `ALERTMANAGER_SMTP_AUTH_PASSWORD`: The SMTP password obtained from your email provider. Ref: https://signoz.io/docs/alerts-management/notification-channel/email/#configuring-alertmanager
k
Untitled
After updating the environment variables, I’m encountering an issue. Can you provide the correct environment variable to disable TLS? Example:
SMTP_REQUIRE_TLS: "false"
I need similar kind of this for both queryService and alertmanager. I couldn’t find any relevant value in the code here: https://github.com/SigNoz/signoz/blob/develop/pkg/query-service/utils/smtpService/smtp.go
p
^ For alertmanager, @Srikanth Chekuri would be the best person to answer that.
k
Hi @Srikanth Chekuri, Can you please help with this request related to disable TLS for SMTP.
j
@kamal sai perla Did you manage to resolve the situation? I have exactly the same problem and I honestly think it is not possible to disable TLS for SMTP. If we check the code in the repository the variable is hardcoded:
return GlobalConfig{
ResolveTimeout: resolveTimeout, HTTPConfig: &defaultHTTPConfig, SMTPSmarthost: defaultSMTPSmarthost, SMTPFrom: defaultSMTPFrom, SMTPAuthUsername: defaultSMTPUsername, SMTPAuthPassword: Secret(defaultSMTPPassword), SMTPAuthSecret: Secret(defaultSMTPAuthSecret), SMTPAuthIdentity: defaultSMTPAuthIdentity, SMTPHello: "localhost", SMTPRequireTLS: true, PagerdutyURL: mustParseURL("https://events.pagerduty.com/v2/enqueue"), OpsGenieAPIURL: mustParseURL("https://api.opsgenie.com/"), WeChatAPIURL: mustParseURL("https://qyapi.weixin.qq.com/cgi-bin/"), VictorOpsAPIURL: mustParseURL("https://alert.victorops.com/integrations/generic/20131114/alert/"),
k
I’m unable to resolve this currently. As you mentioned, the current code doesn’t support disabling TLS for SMTP. We’ll need to wait for them to make the necessary code changes @João Cardoso