influxdata / influxdata/kapacitor

.email() recipient built using variable substitution not working

Open
#2,397 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

Hello,

I'm building my email recipient by getting a specific tag value and concatenating it in a string but it is not sending an alert.

var email_target = '{{ index .Tags "Product" }}@example.com'

var email_target = '{{ index .Tags "Product" }}' + '@example.com'

Both are not working, but if initialize the variable directly I was able to receive the alert.

var email_target = 'my-product@example.com'

Here is what the alert node looks like:

data
|alert()
.warn(lambda: "state_duration" >= warn_duration AND "value" != running_threshold)
.stateChangesOnly()
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.details(details)
.email()
.to(email_target)

Is this not supported yet? I'm not seeing any errors as well when this TICK script is deployed.

Contributor guide

Open the contributing guide

Research direction

Start with the alert node shown in the issue, especially .email().to(email_target), and reproduce both tag-substitution and string-concatenation forms against the literal recipient. Check how dynamic recipient values are evaluated and whether deployment reports an error; done means the behavior is defined, verified, and the missing-error behavior is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.