You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/protocols/apis-and-extensions/anomaly_detection.md
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,13 @@ title: 'Anomaly Detection'
3
3
plan: protocols
4
4
---
5
5
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.
7
7
8
8
## What is anomaly detection?
9
9
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.
11
11
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.
13
13
14
14
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.
15
15
@@ -22,17 +22,25 @@ Other types of issues you can monitor for include:
22
22
23
23
## Anomaly Detection solutions
24
24
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.
26
26
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
+

33
+
5. Configure the rest of the Post Message settings and click **Save**.
28
34
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:
30
38
31
39

32
40
33
41
**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.**
34
42
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:
36
44
37
45
1.[Forward violations to a Slack channel](#forward-violations-to-a-slack-channel)
38
46
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.
52
60
53
61
54
62
### 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.
56
64
57
65

58
66
@@ -90,7 +98,7 @@ total_violations as (
90
98
```
91
99
92
100
**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.
94
102
95
103
```sql
96
104
with
@@ -122,7 +130,7 @@ distinct_track_event_violations as (
122
130
123
131
**Source-level distinct and total violation count (Last 7 days):**
124
132
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.
0 commit comments