You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Robert Cullen <ci...@gmail.com> on 2021/12/13 20:07:58 UTC

Sending an Alert to Slack, AWS sns, mattermost

Hello,

I'm looking for some guidance on how to send alert notifications from a
DataStream to a Slack channel and possibly other alerting tools (ie. AWS
sns, mattermost)

-- 
Robert Cullen
240-475-4490

Re: Sending an Alert to Slack, AWS sns, mattermost

Posted by Arvid Heise <ar...@apache.org>.
I recommend using AsyncIO [1] and RichAsyncFunction instead. SinkFunction
will be removed at the end of Flink 1.X and can quickly turn into a
bottleneck if used on many requests.

[1]
https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/asyncio/

On Tue, Dec 14, 2021 at 4:12 PM Seth Wiesman <sj...@gmail.com> wrote:

> Sure,
>
> Just implement `RichSinkFunction`. You will initialize your client inside
> the open method and then send alerts from invoke.
>
> Seth
>
> On Mon, Dec 13, 2021 at 9:17 PM Robert Cullen <ci...@gmail.com>
> wrote:
>
>> Yes, That's the correct use case.  Will this work with the DataStream
>> API?  UDFs are for the Table API, correct?  Is there a custom sink that can
>> be applied?  Such as this Fraud Detection example [1].  But in this use
>> case instead of sending the alert to a log it sends the message to a
>> webhook?
>>
>> [1]
>> https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/try-flink/datastream/
>>
>> On Mon, Dec 13, 2021 at 8:25 PM Caizhi Weng <ts...@gmail.com> wrote:
>>
>>> Hi!
>>>
>>> Could you please elaborate more on your use case? Do you want to check
>>> the records in a data stream and if some condition is met then send an
>>> alert?
>>>
>>> If that is the case, you can use a UDF for checking and sending alerts.
>>> See [1] for detailed explanation about UDF.
>>>
>>> [1]
>>> https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/table/functions/udfs/
>>>
>>> Robert Cullen <ci...@gmail.com> 于2021年12月14日周二 04:08写道:
>>>
>>>> Hello,
>>>>
>>>> I'm looking for some guidance on how to send alert notifications from a
>>>> DataStream to a Slack channel and possibly other alerting tools (ie. AWS
>>>> sns, mattermost)
>>>>
>>>> --
>>>> Robert Cullen
>>>> 240-475-4490
>>>>
>>>
>>
>> --
>> Robert Cullen
>> 240-475-4490
>>
>

Re: Sending an Alert to Slack, AWS sns, mattermost

Posted by Seth Wiesman <sj...@gmail.com>.
Sure,

Just implement `RichSinkFunction`. You will initialize your client inside
the open method and then send alerts from invoke.

Seth

On Mon, Dec 13, 2021 at 9:17 PM Robert Cullen <ci...@gmail.com> wrote:

> Yes, That's the correct use case.  Will this work with the DataStream
> API?  UDFs are for the Table API, correct?  Is there a custom sink that can
> be applied?  Such as this Fraud Detection example [1].  But in this use
> case instead of sending the alert to a log it sends the message to a
> webhook?
>
> [1]
> https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/try-flink/datastream/
>
> On Mon, Dec 13, 2021 at 8:25 PM Caizhi Weng <ts...@gmail.com> wrote:
>
>> Hi!
>>
>> Could you please elaborate more on your use case? Do you want to check
>> the records in a data stream and if some condition is met then send an
>> alert?
>>
>> If that is the case, you can use a UDF for checking and sending alerts.
>> See [1] for detailed explanation about UDF.
>>
>> [1]
>> https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/table/functions/udfs/
>>
>> Robert Cullen <ci...@gmail.com> 于2021年12月14日周二 04:08写道:
>>
>>> Hello,
>>>
>>> I'm looking for some guidance on how to send alert notifications from a
>>> DataStream to a Slack channel and possibly other alerting tools (ie. AWS
>>> sns, mattermost)
>>>
>>> --
>>> Robert Cullen
>>> 240-475-4490
>>>
>>
>
> --
> Robert Cullen
> 240-475-4490
>

Re: Sending an Alert to Slack, AWS sns, mattermost

Posted by Robert Cullen <ci...@gmail.com>.
Yes, That's the correct use case.  Will this work with the DataStream API?
UDFs are for the Table API, correct?  Is there a custom sink that can be
applied?  Such as this Fraud Detection example [1].  But in this use case
instead of sending the alert to a log it sends the message to a webhook?

[1]
https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/try-flink/datastream/

On Mon, Dec 13, 2021 at 8:25 PM Caizhi Weng <ts...@gmail.com> wrote:

> Hi!
>
> Could you please elaborate more on your use case? Do you want to check the
> records in a data stream and if some condition is met then send an alert?
>
> If that is the case, you can use a UDF for checking and sending alerts.
> See [1] for detailed explanation about UDF.
>
> [1]
> https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/table/functions/udfs/
>
> Robert Cullen <ci...@gmail.com> 于2021年12月14日周二 04:08写道:
>
>> Hello,
>>
>> I'm looking for some guidance on how to send alert notifications from a
>> DataStream to a Slack channel and possibly other alerting tools (ie. AWS
>> sns, mattermost)
>>
>> --
>> Robert Cullen
>> 240-475-4490
>>
>

-- 
Robert Cullen
240-475-4490

Re: Sending an Alert to Slack, AWS sns, mattermost

Posted by Caizhi Weng <ts...@gmail.com>.
Hi!

Could you please elaborate more on your use case? Do you want to check the
records in a data stream and if some condition is met then send an alert?

If that is the case, you can use a UDF for checking and sending alerts. See
[1] for detailed explanation about UDF.

[1]
https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/table/functions/udfs/

Robert Cullen <ci...@gmail.com> 于2021年12月14日周二 04:08写道:

> Hello,
>
> I'm looking for some guidance on how to send alert notifications from a
> DataStream to a Slack channel and possibly other alerting tools (ie. AWS
> sns, mattermost)
>
> --
> Robert Cullen
> 240-475-4490
>