-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Adds information about metrics 2. Adds information about webhooks 3. How to setup dev environment 4. How to contribute into docs
- Loading branch information
1 parent
405b164
commit ed4163f
Showing
8 changed files
with
348 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Configuration — Metrics | ||
|
||
Buggregator has a new feature that collects metrics on how many events we receive. This feature lets you use tools like | ||
Prometheus and Grafana to check on event trends, find issues, and set up alerts. | ||
|
||
This new feature will keep track of how many events Buggregator gets. It will sort these events by their types like | ||
sentry, monolog, var-dumper, ray, inspector, http-dump, profiler, and smtp. | ||
|
||
### How It Works | ||
|
||
1. **Event Counting:** Each time an event is received, it’s counted and sorted into its type. | ||
2. **Metric Updating:** The system updates the metrics to show the latest counts for each event type. | ||
|
||
## Prometheus Endpoint | ||
|
||
Buggregator has a built-in Prometheus friendly endpoint that you can use to collect metrics. Metrics are available at | ||
`2112` port inside the container. To access the metrics outside the container, you need to expose the port. | ||
|
||
```bash | ||
docker run --pull always \ | ||
... \ | ||
-p 2112:2112 \ | ||
ghcr.io/buggregator/server:latest | ||
``` | ||
|
||
> **Note:** Read more about server configuration [here](../getting-started.md). | ||
After starting the server, you can access the metrics at `http://<server_address>:2112` address. | ||
|
||
## Metric Format | ||
|
||
Here is what the metric format looks like: | ||
|
||
```plaintext | ||
# HELP events The total number of received events. | ||
# TYPE events counter | ||
events{type="sentry"} 10 | ||
events{type="smtp"} 1 | ||
``` | ||
|
||
Each line shows how many events of a specific type we have received. | ||
|
||
## Grafana Integration | ||
|
||
You can use these metrics to make dashboards in Grafana. This helps you see the data in a way that makes sense for you. | ||
We will provide steps on how to connect Buggregator’s metrics to Grafana. | ||
|
||
### Setting Up Grafana | ||
|
||
1. **Add Prometheus as a Data Source:** First, connect Prometheus (which has your Buggregator metrics) to Grafana. | ||
2. **Create Dashboards:** Next, create dashboards in Grafana to show the metrics. You can make graphs and charts that | ||
help you understand the event trends. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Configuration — Webhooks | ||
|
||
Webhooks are a useful way to help Buggregator communicate in real-time with other applications when certain events | ||
happen. This guide simplifies setting up and managing webhooks for enhancing automation and integration with other | ||
tools. | ||
|
||
This guide will help you understand how to set up and use webhooks. | ||
|
||
### What is a Webhook? | ||
|
||
A webhook allows applications to share information as soon as specific events occur. Unlike regular APIs that require | ||
checking for updates periodically, webhooks provide this information automatically, saving time and resources. | ||
|
||
### Why Use Webhooks in Buggregator? | ||
|
||
- **Automate Tasks:** Automatically trigger actions in other services like [n8n](https://n8n.io/) when events happen in | ||
Buggregator. | ||
- **Integrate with Other Tools:** Connect Buggregator with various tools like messaging apps, issue tracking software, | ||
or custom apps effortlessly. | ||
|
||
## Docker Configuration | ||
|
||
Currently, Buggregator does not have an admin interface for managing webhooks. Instead, you manage them through | ||
configuration files within a Docker container. | ||
|
||
**Here's how you can mount a volume containing webhook configurations:** | ||
|
||
```bash | ||
docker run --pull always \ | ||
-v /path/to/webhooks:/app/runtime/webhooks \ | ||
ghcr.io/buggregator/server:latest | ||
``` | ||
|
||
or using `docker-compose`: | ||
|
||
```yaml | ||
buggregator-server: | ||
... | ||
volumes: | ||
- /path/to/webhooks:/app/runtime/webhooks | ||
``` | ||
## Configuring a Webhook | ||
Place each webhook configuration in a YAML file within the `runtime/webhooks` directory. Each configuration file should | ||
contain one webhook setup. | ||
|
||
Here’s what a typical webhook configuration looks like: | ||
|
||
```yaml | ||
webhook: | ||
event: sentry.received | ||
url: http://example.com/webhook | ||
headers: | ||
Content-Type: application/json | ||
Secret-Key: my-secret-key | ||
verify_ssl: false | ||
retry_on_failure: true | ||
``` | ||
|
||
**Key Components of a Webhook Configuration:** | ||
|
||
- **Event:** The specific event in Buggregator that will trigger the webhook. | ||
- **URL:** Where the webhook sends data. | ||
- **Headers:** Any additional headers needed for the webhook request. | ||
- **Verify SSL:** Choose whether to check SSL certificates during the webhook call. | ||
- **Retry on Failure:** If the webhook should retry sending data if the first attempt fails. (3 retries with exponential | ||
backoff) | ||
|
||
> **Note:** You can test webhooks using tools like https://webhook.site. | ||
|
||
### Types of Events Supported: | ||
|
||
Buggregator can currently handle the following events: | ||
|
||
- sentry.received | ||
- monolog.received | ||
- var-dumper.received | ||
- ray.received | ||
- inspector.received | ||
- http-dump.received | ||
- profiler.received | ||
- smtp.received |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Contributing — Documentation | ||
|
||
Buggregator uses [VitePress](https://vitepress.dev/) for its documentation. This makes it easy to contribute to the | ||
project's documentation by following the steps below. | ||
|
||
## Getting Started | ||
|
||
### Clone the Repository | ||
|
||
First of all you need to clone the repository to your local machine. | ||
|
||
```bash | ||
git clone [email protected]:buggregator/docs.git | ||
``` | ||
|
||
> **Note**: If you don't have access to the repository, you can fork it and clone your forked repository. | ||
### Install Dependencies | ||
|
||
After cloning the repository, navigate to the project directory and install the dependencies. | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
### Start the Development Server | ||
|
||
To start the development server and preview the documentation, run the following command: | ||
|
||
```bash | ||
npm run docs:dev | ||
``` | ||
|
||
This command will start a local development server and open the documentation in your default browser. | ||
|
||
## Structure | ||
|
||
The documentation is structured as follows: | ||
|
||
- `docs/`: Contains the documentation files. | ||
- `docs/.vitepress/config.mts`: Site configuration and navigation. | ||
|
||
All you need is to edit the markdown files in the `docs/` directory. If you want to add a new page, create a new | ||
markdown file in the `docs/` directory and add it to the navigation in the `docs/.vitepress/config.mts` file. | ||
|
||
--- | ||
|
||
That's it! You're now ready to contribute to the Buggregator documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.