AlertManager alerts - need the way to add into mail template how long alert already fired and sort alerts by this filed - prometheus-alertmanager

When I add .StartsAt filed into AlertManager mail template I get the following representation in mail:
2023-01-12 00:03:03.584 +0000 UTC
But I need to display how long time each alert already fired and sort them by this field.
I know Go templates have function Since(), but unfortunately it isn't available in AlertManager mail templates.
As a workaround - how to sort on StartsAt field?

Related

Site workflow to send reminder email to Created By based on status of the item

I want to create site workflow to send a reminder email to created by(emails) when Item created is more than 30 days and choice field called "Status" is "open". When someone has more than one items with status open in list then that person get one reminder mail only
Thanks in advance
Aside from the issues of maintaining multiple long-running workflows on a site, each item with an open status would need its own workflow so that when it was updated to any other status it could self-terminate.
To resolve prevent duplicate emails, there would need to be an additional list to track which user received a notification email along with the date/time. This list could be queried by a standard rest API call with $select=Id,Modified&$top=1&$orderby=Modified+desc&$filter=<userIdField>%20eq%20<ID> which would provide the most recent record and based on the date determine if an additional email was warranted. If there is no record of an email sent, then a record can be inserted to indicate that "this" workflow instance will send out an email.
It may be important to run this query a second time before the email is delivered to ensure that a race condition did not occur, but if found, the duplicate record with the newer time-stamp will delete its duplicate and self-terminate.

Prometheus Alertmanager Silencing alerts via UI does not prevent first occurence of alert to trigger

Can the ‘Silences’ feature on the Alertmanager UI be used to silence new alerts before they are sent to a receiver? This would be useful while performing an upgrade in an environment.
My alerts contain a label 'env' (to identify a given environment) and I can add a silence rule via the UI. The problem is that it will only silence AFTER the first occurrence of an alert in the 'env'/environment. In the meantime, an alert has been sent to the Alertmanager receiver.
I have also tried changing values in the alertmanager.conf for
group_interval from 5m to 10s, and group_wait from 30s to 60s.
Alternatively, I could update the receiver when there is a match for the 'env' label...but I would prefer to use the 'Silences' feature (either in UI or API - have not tried using the API to do silence).
Any inputs would be appreciated.
(Using version 0.14.0 of Alertmanager)
I've tried silencing in UI as well as throughly Curl(both are alike) You can do in UI itself for betterment and perfection. I did not get any alerts. The moment alerts fired, it was silenced on the first occurrence itself. Kindly let me know what you have tried. May be you can try regex option if you are not sure of the exact value.

Netsuite timetrack Duration field into a Workflow

I would like to trigger an email when a new Time entry is created in Netsuite. Usually this can be easily accomplished through a Saved Search/Email but for Time searches, sending on Create is not available and already the topic of an enhancement request.
I've created a Workflow which will trigger upon Time entry create. In order to use the time entry fields I first created Workflow Fields and then in State 1 populate those workflow fields with the values. Suiteanswers: Use SQL expressions in Send Email action via the Workflow Manager (ID: 21669)
I can map many of the fields like Customer:Project, Service Item from the Time entry into my Workflow. I am stuck on mapping the Netsuite Duration field which according to the Records Browser is of a type "timetrack" ie 1:05.
I have tried it from the available field types, Date, Date/Time, Integer. I'm now trying to populate is into a Text field but am stuck as to how to convert it from the timetrack record type into Text.
Have tried
TO_CHAR({hours})
CAST({hours} AS text)
I just want a field with the Duration that I can use in an email. :)
How could I achieve this affect? Any thoughts appreciated.
Turns out that somewhere along the track I over-complicated what was needed. In the end I just inserted {hours} into my email text box and it worked. I can't explain why it didn't work initially.

SharePoint SendEmail: override Recipient?

I have a sharepoint workflow I have to maintain. In the workflow a mail is sent using
Microsoft.SharePoint.WorkflowActions.SendEmail
The "To" - property is set correctly to a valid value (like john#doe.com). But when I look into the ULS log the mail is sent to "test#xx.local" instead.
Nowhere in the code there is any hint that another value might be overwriting the ".To"-property. So I expect this might be a sharepoint-property. Where could I possibly find that?

SharePoint Workflows - Custom Approval - Can I get it to email the field that was updated?

Working with a SP list, have a standard approval workflow that kicks off when an item on the list is updated. I have it set to send the alerting email and have my custom message
Is there any way to have the email contain the fields that were updated (as in field x was value A and was updated to value B)?
Can't be done with standard workflow (or even with workflows at all). More suitable would be using SPEventReceiver.ItemUpdating to check what fields have their values changed, and send summary email from there.
Or, you can always turn on versioning (only major) and create custom activity used in workflow, that could extract required information from previous version of item (i'm not aware of any such OOTB functionality availble)

Resources