Skip to content

Can not add Source.Results to alerts #70

@saneksem

Description

@saneksem

I can not find a way to use notification properties like Source.Results listed in docs for Seq alerts triggered by query conditions.

I investigated source code and that's what I tried:

  • Message template in app instance settings is attached as raw string value without any additional parsing. Even [RenderedMessage] is not being replaced.
AlertV2MessageBuilder
...
if (_messageTemplate != null)
{
    message.Attachments.Add(new SlackMessageAttachment(color, _messageTemplate, null, true));
}
  • Listing including properties in app instance settings works as a filter for exceptions properties. If it's not populated all properties are included by default (except for SpecialProperties which I need).
  • All attached properties in notification settings are actually filtered to NOT include special properties listed in seq docs.
foreach (var property in evt.Data.Properties)
            {
                if (SpecialProperties.Contains(property.Key)) continue;

Only Source.ContributingEvents are being processed in a separate block of code if they are included in event properties. Everything else is ignored because of SpecialProperties.
Using [Source.Results] or [@Source.Results] in text does nothing and I couldn't find any parsing for attached properties in code.

  • Using different values/properties for message template in alert settings did not affect alert body at all.

I need to be able to include Source.Results like any alert property in HTML application template.
Reason: alert can have hundreds of contributing events every time it triggers but results may be very informative with just a few records using query with grouping and important fields selection.
Maybe we can add new checkbox "Include results" in notification/instance settings and process it similar to contributing events in AlertV2MessageBuilder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions