|
1 | | -# preq |
2 | | - |
3 | | -[](https://github.com/prequel-dev/cre/actions/workflows/build.yml) |
4 | | -[](https://github.com/prequel-dev/preq/actions/workflows/build.yml) |
5 | | -[](https://github.com/prequel-dev/prequel-compiler/actions/workflows/build.yml) |
6 | | - |
7 | | -preq (prounounced "preek") is a free and open community-driven reliability problem detector |
8 | | - |
9 | | -[Documentation](https://docs.prequel.dev) | [Slack](https://inviter.co/prequel) | [Playground](https://play.prequel.dev/) | [Mailing List](https://www.detect.sh) |
| 1 | +<h1 align="center" style="border-bottom: none"> |
| 2 | + <a href="https://prequel.dev" target="_blank"> |
| 3 | + <img alt="Preq" src="assets/prequel.png" width="120"> |
| 4 | + </a> |
| 5 | + <br> |
| 6 | + preq |
| 7 | +</h1> |
| 8 | + |
| 9 | +<p align="center"> |
| 10 | + Visit <a href="https://docs.prequel.dev" target="_blank">docs.prequel.dev</a> for full documentation, |
| 11 | + examples, and guides. |
| 12 | +</p> |
| 13 | + |
| 14 | +<div align="center"> |
| 15 | + |
| 16 | +[](https://github.com/prequel-dev/preq/actions/workflows/build.yml) |
| 17 | +[](#) |
| 18 | +[](https://github.com/prequel-dev/preq/releases) |
| 19 | +[](https://www.apache.org/licenses/LICENSE-2.0) |
| 20 | +[](https://inviter.co/prequel) |
| 21 | +[](https://play.prequel.dev/) |
| 22 | +[](#kubernetes-krew) |
| 23 | + |
| 24 | +</div> |
10 | 25 |
|
11 | 26 | --- |
| 27 | +`preq` (pronounced "preek") is a free and open community-driven reliability problem detector |
12 | 28 |
|
13 | | -Use preq to: |
| 29 | +<p align="center"> |
| 30 | + <img src="assets/demo.gif" alt="preq demo" width="700"> |
| 31 | +</p> |
| 32 | + |
| 33 | +Use `preq` to: |
14 | 34 |
|
15 | 35 | - detect the latest bugs, misconfigurations, anti-patterns, and known issues from a community of practitioners |
16 | | -- provide engineers, on-call support, and SRE agents with impact and community recommended mitigations |
| 36 | +- provide engineers, on-call support, and SRE agents with impact and community-recommended mitigations |
17 | 37 | - hunt for new problems in distributed systems |
18 | 38 |
|
19 | | -preq is powered by [Common Reliability Enumerations (CREs)](https://github.com/prequel-dev/cre) that are contributed by the community and Prequel's Reliability Research Team. Reliability intelligence helps teams see a broad range of problems earlier, so they can prioritize, pinpoint, and reduce the risk of outages. |
| 39 | +`preq` is powered by [Common Reliability Enumerations (CREs)](https://github.com/prequel-dev/cre) that are contributed by the community and Prequel's Reliability Research Team. Reliability intelligence helps teams see a broad range of problems earlier, so they can prioritize, pinpoint, and reduce the risk of outages. |
| 40 | + |
20 | 41 |
|
21 | | -## Download and Install |
| 42 | + |
| 43 | +## Install `preq` |
22 | 44 |
|
23 | 45 | ### Binary Distributions |
24 | 46 |
|
25 | | -Official binary distributions are available at [latest release](https://github.com/prequel-dev/preq/releases) for Linux (amd64), macOS (amd64 and arm64), and Windows (amd64). All macOS binaries are signed and notarized. No configuration is necessary to start using preq. |
| 47 | +Official binary distributions are available at [latest release](https://github.com/prequel-dev/preq/releases) for Linux (amd64 and arm64), macOS (arm64), and Windows (amd64). All macOS binaries are signed and notarized. No configuration is necessary to start using preq. |
26 | 48 |
|
27 | 49 | ### Kubernetes |
28 | 50 |
|
29 | | -You can also install preq as a Krew plugin: |
| 51 | +You can also install `preq` as a Krew plugin: |
30 | 52 |
|
31 | 53 | ```bash |
32 | 54 | kubectl krew install preq |
33 | 55 | ``` |
34 | 56 |
|
35 | 57 | See https://docs.prequel.dev/install for more information. |
36 | 58 |
|
37 | | -## Overview |
| 59 | +## Quick Usage |
| 60 | + |
| 61 | +**Step 1**: Install and run the demo service (example macOS command below) |
| 62 | + |
| 63 | +```bash |
| 64 | +curl -sL "$(curl -s https://api.github.com/repos/prequel-dev/preq-demo-app/releases/latest \ |
| 65 | + | jq -r '.assets[] | select(.name | test("demo-darwin-arm64$")) .browser_download_url')" \ |
| 66 | + -o demo && chmod +x demo && ./demo > preq-demo.log 2>&1 |
| 67 | +``` |
| 68 | +**Step 2**: Trigger a problem |
| 69 | +```bash |
| 70 | +curl http://localhost:8080/panic |
| 71 | +``` |
| 72 | +**Step 3**: Detect the problem |
| 73 | +```bash |
| 74 | +cat preq-demo.log | preq -o - |
| 75 | +``` |
| 76 | +You will see a detection printed with the corresponding CRE ID, severity, and suggested mitigation. |
| 77 | + |
| 78 | +```bash |
| 79 | +Parsing rules done! [3 rules in 3ms; 433 rules/s] |
| 80 | +Problems detected done! [1 in 7ms; 144/s] |
| 81 | +Reading stdin done! [208.64KB in 4ms; 53.01MB/s] |
| 82 | +Matching lines done! [1.01K lines in 4ms; 275.29K lines/s] |
| 83 | +CRE-2025-0918 critical [1 hits @ 2025-03-11T10:00:19-04:00] |
| 84 | +``` |
| 85 | +See our running `preq` guide for full walkthrough, including writing your own rules: https://docs.prequel.dev/running |
| 86 | + |
38 | 87 |
|
39 | | -preq is powered by a rules engine that performs distributed matching and correlation of sequences of events across logs, metrics, traces, and other data sources to detect reliability problems. CREs provides accurate and timely context for a human or SRE agent to take action on problems. |
| 88 | +## Example CRE |
40 | 89 |
|
41 | | -Below is simple rule that looks for a sequence of events in a single log source over a window of time along with a negative condition (an event that should not occur during the window). |
| 90 | +This rule detects a specific sequence of events from one log source within a set time period. It also checks that a certain event does not occur during that period. If it does, the rule will not trigger. |
42 | 91 |
|
43 | 92 | ```yaml title="cre-2024-0007.yaml" showLineNumbers |
44 | 93 | cre: |
@@ -84,11 +133,41 @@ rule: |
84 | 133 | - SIGTERM received - shutting down |
85 | 134 | ``` |
86 | 135 |
|
87 | | -## Running |
| 136 | +## Automated Actions using `preq` |
| 137 | + |
| 138 | +You can connect detections to automated runbooks that take action when a CRE fires. For example, restarting a service or notifying your on-call team. |
| 139 | + |
| 140 | +You can run automated actions on new detections using `preq -a <actions.yaml>`. |
| 141 | + |
| 142 | +See https://docs.prequel.dev/running#automated-runbooks for examples of how to setup automated runbooks when a CRE is detected and trigger actions like: |
| 143 | +- Slack Notifications |
| 144 | +- Jira Issue Creation |
| 145 | +- Runbook executables |
| 146 | +- CronJobs |
| 147 | + |
| 148 | +## Data sources other than `stdin` |
| 149 | + |
| 150 | +`preq` works on any timestamped data source, not just `stdin`. |
| 151 | +You can define multiple sources (e.g., app logs, system logs, metric dumps) in a YAML template and let `preq` automatically map CRE rules to the right data. |
| 152 | + |
| 153 | +Learn more about data sources here: https://docs.prequel.dev/data-sources |
88 | 154 |
|
89 | | -* See https://docs.prequel.dev/running for examples of how to run preq |
90 | | -* See https://docs.prequel.dev/running#automated-runbooks for examples of how to setup automated runbooks when a CRE is detected |
| 155 | +## Community |
| 156 | +We are building an open reliability detection community and we would love you to join! |
| 157 | + |
| 158 | +- [Slack](https://inviter.co/prequel): Ask questions, share detections, propose new CREs. |
| 159 | + |
| 160 | +- [Playground](https://play.prequel.dev/): Try rules in your browser with WebAssembly, no data leaves your machine. |
| 161 | + |
| 162 | +- [Docs](https://docs.prequel.dev): Explore the documentation to learn how to install, run, automate, and write CREs. |
| 163 | + |
| 164 | +- [CRE Repository](https://github.com/prequel-dev/cre): Contribute new community detection rules and help the reliability community grow. |
91 | 165 |
|
92 | 166 | ## Contributing |
93 | 167 |
|
94 | | -Open a PR and let's go! |
| 168 | +We welcome contributions of all kinds: bug fixes, docs, new CRE rules, or feature ideas! |
| 169 | + |
| 170 | +See the contribution guide for more details: https://docs.prequel.dev/cres/contributing |
| 171 | + |
| 172 | +--- |
| 173 | +Licensed under the [Apache License 2.0](https://github.com/prequel-dev/preq/blob/main/LICENSE) |
0 commit comments