[+dev] On Tue, Nov 6, 2018 at 12:47 PM Ruwini Wijesiri <[email protected]> wrote:
> Hi All, > > In APIM Health Monitor alerts, a new alert is added to the specific alert > table only if the same alert hadn't occurred previously within 10 mins > duration. > > The current implementation shown below tries to achieve this by joining > ApiHealthMonitorAlertStreamTemp stream to ApimApiHealthMonitorAlert table > which results in only the first alert being added to the health alert table > and the subsequent alerts gets dropped. > > *from ApiHealthMonitorAlertStreamTemp#window.length(1) as AH left outer >>> join ApimApiHealthMonitorAlert#window.time(10 minutes) as AM* >> >> *on AH.apiName==AM.apiName and AH.apiVersion==AM.apiVersion and >>> AH.message==AM.message* >> >> *select >>> AH.apiName,AH.apiVersion,AH.apiCreator,AH.apiCreatorTenantDomain,AH.message,AH.severity,AH.alertTimestamp* >> >> *having AM.apiName is null and AM.apiVersion is null and AM.message is >>> null* >> >> *insert into ApimApiHealthMonitorAlert;* >> >> > This is fixed in the following PRs[1], [2] by joining > ApiHealthMonitorAlertStreamTemp stream to itself as shown below, to check > whether the same alert has occurred within a window of 10 mins. > > *from ApiHealthMonitorAlertStreamTemp#window.length(1) as AH left outer >>> join ApiHealthMonitorAlertStreamTemp#window.time(10 minutes) as AM* >> >> *on AH.apiName==AM.apiName and AH.apiVersion==AM.apiVersion and >>> AH.message==AM.message* >> >> *select >>> AH.apiName,AH.apiVersion,AH.apiCreator,AH.apiCreatorTenantDomain,AH.message,AH.severity,AH.alertTimestamp* >> >> *having AM.apiName is null and AM.apiVersion is null and AM.message is >>> null* >> >> *insert into ApimApiHealthMonitorAlert;* >> >> > > [1]. https://github.com/wso2/analytics-solutions/pull/183/files > [2]. https://github.com/wso2-support/analytics-solutions/pull/2/files > > Thanks, > Regards, > Ruwini > -- > Ruwini Wijesiri > Software Engineer, > WSO2 Inc. > > Mobile : +94716133480 > > <http://wso2.com/signature> > -- Ruwini Wijesiri Software Engineer, WSO2 Inc. Mobile : +94716133480 <http://wso2.com/signature>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
