Skip to content

Commit 1719c07

Browse files
Merge pull request #5162 from segmentio/fix-5131
Created new section in Anomaly Detection page about Slack (Actions) forwarding
2 parents 5870a94 + f0df760 commit 1719c07

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/protocols/apis-and-extensions/anomaly_detection.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: 'Anomaly Detection'
33
plan: protocols
44
---
55

6-
If you're using Protocols, you might want to get notifications when an anomaly in event volumes or [Protocols violation](/docs/protocols/validate/forward-violations/) counts occurs. This document clarifies what we mean by anomaly detection, gives examples of anomalies that might be relevant to your business, and provides some example solutions of how to monitor and alert on anomalies using some standard tools available today.
6+
If you're using Protocols, you might want to get notifications when an anomaly in event volumes or [Protocols violation](/docs/protocols/validate/forward-violations/) counts occurs. This document clarifies what Segment means by anomaly detection, gives examples of anomalies that might be relevant to your business, and provides some example solutions of how to monitor and alert on anomalies using some standard tools available today.
77

88
## What is anomaly detection?
99

10-
Anomaly detection means finding out when your data collection is broken, missing, or incorrect. This covers a huge range of functionality!
10+
Anomaly detection means finding out when your data collection is broken, missing, or incorrect.
1111

12-
When you first start using Protocols, you might focus on fixing data quality issues for a limited set of business critical events. After those first issues are resolved, you might get notifications if new issues occur or if old issues reoccur, so you can avoid manually monitoring data quality. New issues often occur when a new app version is released, and for many companies, that's weekly!
12+
When you first start using Protocols, you might focus on fixing data quality issues for a limited set of business critical events. After those first issues are resolved, you might get notifications if new issues occur or if old issues reoccur, so you can avoid manually monitoring data quality. New issues often occur when a new app version is released, and for many companies, that's weekly.
1313

1414
The issues you care about for anomaly detection are different for each business. An anomaly for one company could be completely normal for another company. For example, an B2B company would expect a steep drop-off of traffic and event volume on weekends, while a media or entertainment company would expect to see a rise in activity in the evenings and on weekends for their different locales.
1515

@@ -22,17 +22,25 @@ Other types of issues you can monitor for include:
2222

2323
## Anomaly Detection solutions
2424

25-
There are several easy ways to set up anomaly detection using the destination partner tools you probably already use. Many of these solutions come from our Segment customers using Protocols. They use these solutions to help manage data quality, and get notified when relevant anomalies are detected.
25+
There are several easy ways to set up anomaly detection using the destination partner tools you probably already use. Many of these solutions come from Segment customers using Protocols. They use these solutions to help manage data quality and get notified when relevant anomalies are detected.
2626

27-
Regardless of the solution you choose, we recommend that you create a new Segment source to collect all violations and Segment workspace activity. To do this, create a new HTTP source in your workspace, and assign a name that you can easily understand (for example, `Protocols Audit Source`).
27+
You can send anomalous events directly from your source to a Slack channel using the Slack (Actions) destination. To get started:
28+
1. Create a [Slack (Actions)](/docs/connections/destinations/catalog/actions-slack/#getting-started) destination.
29+
2. Once you've created your destination, select the **Mappings** tab and click **+ New Mapping**.
30+
3. On the Add Mapping popup, select **Post Message**.
31+
4. Under "Select events to map and send", create an event with the following format: <br>
32+
![A screenshot of the Post Message setup screen in the Slack (Actions) destination.](images/slack-actions-forwarding.jpeg)
33+
5. Configure the rest of the Post Message settings and click **Save**.
2834

29-
Next, set up [Violation forwarding](/docs/protocols/validate/forward-violations/) for each Tracking Plan connected to the Source. Once connected, your sources will look like:
35+
If you're not using the Slack (Actions) destination to forward violations, Segment recommends that you create a new Segment source to collect all violations and Segment workspace activity. To do this, create a new HTTP source in your workspace, and assign a name that you can easily understand (for example, `Protocols Audit Source`).
36+
37+
Next, set up [Violation forwarding](/docs/protocols/validate/forward-violations/) for each Tracking Plan connected to the Source. Once connected, your sources will look like the following diagram:
3038

3139
![Diagram showing how violations and production events are routed to their respective destinations.](images/protocols_meta_source_setup.png)
3240

3341
**Note: When you enable violation forwarding, it counts as 1 MTU toward your monthly MTU limit. If you are on an API plan, all forwarded violations count against your API limit. Violations might also generate costs in downstream destinations and data warehouses.**
3442

35-
Once violation forwarding is enabled, you can build a custom anomaly detection solution that works for your business. The examples we cover here include:
43+
Once violation forwarding is enabled, you can build a custom anomaly detection solution that works for your business. The examples Segment covers here include:
3644

3745
1. [Forward violations to a Slack channel](#forward-violations-to-a-slack-channel)
3846
2. [Create violation and event count Anomaly Detection dashboards in a BI tool](#create-customized-anomaly-detection-dashboards-in-a-bi-tool)
@@ -52,7 +60,7 @@ When you're done, it'll look like the screenshot below.
5260

5361

5462
### Create customized Anomaly Detection dashboards in a BI tool
55-
Custom dashboards are a great way to focus your teams around the metrics and events that matter most to your business. With a few simple queries you can build a dashboard to share with teams, so everyone can understand how well they're doing against your data quality objectives. Here's an example dashboard that combines [forwarded Violations](/docs/protocols/validate/forward-violations/) with production event data to track data quality. See below for detailed SQL queries!
63+
Custom dashboards are a great way to focus your teams around the metrics and events that matter most to your business. With a few simple queries you can build a dashboard to share with teams, so everyone can understand how well they're doing against your data quality objectives. Here's an example dashboard that combines [forwarded Violations](/docs/protocols/validate/forward-violations/) with production event data to track data quality. See below for detailed SQL queries.
5664

5765
![Graphic with five bar charts created with sample data, showing different comparisons of violations across events and sources.](images/anomaly_detection_dashboard.png)
5866

@@ -90,7 +98,7 @@ total_violations as (
9098
```
9199

92100
**Ratio of High priority events to violation counts:**
93-
This query produces a table showing all violations and event counts by day for a single event sent to Segment. A bar chart from this data can show when violations increase or decrease disproportionately to event volume for the single event. We recommend selecting a few events that are important for your business (for example, `Order Completed`, `Video Viewed`, `User Signed Up`) and creating a separate query and chart for each event.
101+
This query produces a table showing all violations and event counts by day for a single event sent to Segment. A bar chart from this data can show when violations increase or decrease disproportionately to event volume for the single event. Segment recommends selecting a few events that are important for your business (for example, `Order Completed`, `Video Viewed`, `User Signed Up`) and creating a separate query and chart for each event.
94102

95103
```sql
96104
with
@@ -122,7 +130,7 @@ distinct_track_event_violations as (
122130

123131
**Source-level distinct and total violation count (Last 7 days):**
124132

125-
This query produces a table that lists all sources connected to a Tracking Plan. For each source, the table shows distinct violations and total violations seen in the source. This table is similar to the [violations summary](/docs/protocols/validate/forward-violations/) view in the Segment app!
133+
This query produces a table that lists all sources connected to a Tracking Plan. For each source, the table shows distinct violations and total violations seen in the source. This table is similar to the [violations summary](/docs/protocols/validate/forward-violations/) view in the Segment app.
126134

127135
```sql
128136
select source_name,
9.96 KB
Loading

0 commit comments

Comments
 (0)