Skip to content

Commit

Permalink
feat: Basic prometheus exporter & documentation fix (#1747)
Browse files Browse the repository at this point in the history
Signed-off-by: Matvey Kukuy <[email protected]>
Co-authored-by: Vladimir Filonov <[email protected]>
  • Loading branch information
Matvey-Kuk and VladimirFilonov authored Sep 1, 2024
1 parent eb1ead3 commit 4d0c891
Show file tree
Hide file tree
Showing 64 changed files with 699 additions and 476 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test docs
on:
push:
paths:
- 'keep/**'
pull_request:
paths:
- 'keep/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}-${{ github.job }}
cancel-in-progress: true
env:
PYTHON_VERSION: 3.11
STORAGE_MANAGER_DIRECTORY: /tmp/storage-manager

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
with:
src: "./keep"
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install mintlify and validate docs
run: |
npm i -g mintlify
cd docs && mintlify broken-links;
cd ../scripts;
./docs_validate_navigation.sh;
python3 docs_get_providers_list.py --validate;
# Todo: validate if openapi schema is matching with the code
6 changes: 6 additions & 0 deletions .github/workflows/test-pr-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ jobs:
# create the state directory
# mkdir -p ./state && chown -R root:root ./state && chmod -R 777 ./state
- name: Testing if API docs are actual
run: |
# Keeping this test here to avoid spinning Keep's backend it in the docs-test job
./scripts/docs_validate_openapi_is_actual.sh
- name: Run e2e tests and report coverage
run: |
poetry run coverage run --branch -m pytest -s tests/e2e_tests/
Expand Down
3 changes: 0 additions & 3 deletions docs/api-ref/ai/create-alert.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api-ref/ai/repair-alert.mdx

This file was deleted.

3 changes: 3 additions & 0 deletions docs/api-ref/alerts/get-alert-audit.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /alerts/{fingerprint}/audit
---
3 changes: 3 additions & 0 deletions docs/api-ref/alerts/unenrich-alert.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /alerts/unenrich
---
3 changes: 3 additions & 0 deletions docs/api-ref/dashboard/create-dashboard.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /dashboard
---
3 changes: 3 additions & 0 deletions docs/api-ref/dashboard/delete-dashboard.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: delete /dashboard/{dashboard_id}
---
3 changes: 3 additions & 0 deletions docs/api-ref/dashboard/read-dashboards.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /dashboard
---
3 changes: 3 additions & 0 deletions docs/api-ref/dashboard/update-dashboard.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: put /dashboard/{dashboard_id}
---
3 changes: 3 additions & 0 deletions docs/api-ref/groups/get-groups.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /groups/
---
3 changes: 3 additions & 0 deletions docs/api-ref/incidents/add-alerts-to-incident.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /incidents/{incident_id}/alerts
---
3 changes: 3 additions & 0 deletions docs/api-ref/incidents/create-incident-endpoint.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /incidents
---
3 changes: 3 additions & 0 deletions docs/api-ref/incidents/delete-alerts-from-incident.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: delete /incidents/{incident_id}/alerts
---
3 changes: 3 additions & 0 deletions docs/api-ref/incidents/delete-incident.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: delete /incidents/{incident_id}
---
3 changes: 3 additions & 0 deletions docs/api-ref/incidents/get-all-incidents.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /incidents
---
3 changes: 3 additions & 0 deletions docs/api-ref/incidents/get-incident-alerts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /incidents/{incident_id}/alerts
---
3 changes: 3 additions & 0 deletions docs/api-ref/incidents/get-incident.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /incidents/{incident_id}
---
3 changes: 3 additions & 0 deletions docs/api-ref/incidents/update-incident-1.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /incidents/{incident_id}/confirm
---
3 changes: 3 additions & 0 deletions docs/api-ref/incidents/update-incident.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: put /incidents/{incident_id}
---
3 changes: 3 additions & 0 deletions docs/api-ref/metrics/get-metrics.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /metrics
---
3 changes: 3 additions & 0 deletions docs/api-ref/preset/create-preset-tab.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /preset/{preset_id}/tab
---
3 changes: 3 additions & 0 deletions docs/api-ref/preset/delete-tab.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: delete /preset/{preset_id}/tab/{tab_id}
---
3 changes: 3 additions & 0 deletions docs/api-ref/preset/get-preset-alerts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /preset/{preset_name}/alerts
---
3 changes: 3 additions & 0 deletions docs/api-ref/providers/get-alert-count.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /providers/{provider_type}/{provider_id}/alerts/count
---
3 changes: 3 additions & 0 deletions docs/api-ref/tags/get-tags.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /tags
---
3 changes: 3 additions & 0 deletions docs/api-ref/topology/get-topology-data.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /topology
---
3 changes: 3 additions & 0 deletions docs/api-ref/workflows/create-workflow-from-body.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /workflows/json
---
3 changes: 3 additions & 0 deletions docs/api-ref/workflows/get-random-workflow-templates.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: get /workflows/random-templates
---
2 changes: 1 addition & 1 deletion docs/cli/commands/extraction-create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Usage: keep extraction create [OPTIONS]
* Default: `0`
* Usage: `--priority <priority>`

The priority of the extraction, higher priority means this rule will execute first. [0<=x<=100].
The priority of the extraction, higher priority means this rule will execute first. `0<=x<=100`.

* `pre`
* Type: BOOL
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/commands/mappings-create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Usage: keep mappings create [OPTIONS]
* Default: `0`
* Usage: `--priority <priority>`

The priority of the mapping, higher priority means this rule will execute first. [0<=x<=100].
The priority of the mapping, higher priority means this rule will execute first. `0<=x<=100`.

* `help`:
* Type: BOOL
Expand Down
39 changes: 39 additions & 0 deletions docs/development/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,45 @@ Next, run
docker compose -f docker-compose.dev.yml up
```

### Install Keep CLI

First, clone Keep repository:

```shell
git clone https://github.com/keephq/keep.git && cd keep
```

Install Keep CLI

```shell
poetry install
```

From now on, Keep should be installed locally and accessible from your CLI, test it by executing:

```
keep version
```

## Enable Auto Completion

**Keep's CLI supports shell auto-completion, which can make your life a whole lot easier 😌**

If you're using zsh

```shell title=~/.zshrc
eval "$(_KEEP_COMPLETE=zsh_source keep)"
```

If you're using bash

```bash title=~/.bashrc
eval "$(_KEEP_COMPLETE=bash_source keep)"
```

> Using eval means that the command is invoked and evaluated every time a shell is started, which can delay shell responsiveness. To speed it up, write the generated script to a file, then source that.

### Testing

Run unittests:
Expand Down
54 changes: 0 additions & 54 deletions docs/development/installation.mdx

This file was deleted.

91 changes: 0 additions & 91 deletions docs/development/overview.mdx

This file was deleted.

Loading

0 comments on commit 4d0c891

Please sign in to comment.