kapacitor icon indicating copy to clipboard operation
kapacitor copied to clipboard

Pushover title template variables

Open m4rcu5 opened this issue 4 years ago • 2 comments

Hi,

It seems that the Pushover alert service does not support template variables in the title parameter.

Example use-case:

state_data  
  |window()
    .period(150m)
    .every(5m)
    .fillPeriod()
  |mode('code')
    .as('state_code')
  |alert()
    .info(lambda: "state_code" <= 3)
    .stateChangesOnly()

    .message('<Detailed alert info goes here>') 

    .pushover()
      .title('{{ .Level }} System Alert: {{ index .Tags "name" }} on {{ index .Tags "cloud" }}')

Would it be possible to support templating in the title parameter?

m4rcu5 avatar Aug 10 '20 15:08 m4rcu5

So you're trying to use template variables in the title parameter of the Pushover alert service, but it is not supported. If the service does not support templating in the title parameter, there is not much you can do within the service itself. However, you may be able to work around this limitation by preprocessing your alerts before sending them to Pushover.

One approach could be to use a script or a service that interprets the alerts, processes them, and then sends them to Pushover with the appropriate title format. For example, you could use a scripting language like Python or a tool like Node-RED to handle the templating and then send the formatted alerts to Pushover.

Without direct access to the Pushover service codebase, it's not feasible for an external party to add this feature. Only developers of Pushover have the ability to modify their service to support templating in the title parameter. I would recommend keeping an eye out for any updates from Pushover regarding new features or improvements to their service.

chiaranocentini avatar Mar 25 '24 23:03 chiaranocentini

It feels like an AI dropped by and commented on a 4 year old issue. But I'll bite.

The issue is not related to the Pushover service itself, it's related to the processing code in Kapacitor to process template variables in the title before sending it to the Pushover service.

m4rcu5 avatar Mar 27 '24 09:03 m4rcu5