2023-02-22 11:23:04 +00:00
|
|
|
|
# Saleor Monitoring app
|
|
|
|
|
|
|
|
|
|
❗️NOTE: This is Alpha version of the app.❗️
|
|
|
|
|
|
|
|
|
|
## Local development
|
|
|
|
|
|
|
|
|
|
### Start Monitoring backend
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
Run:
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
|
|
|
|
```shell
|
2023-02-22 11:23:04 +00:00
|
|
|
|
docker-compose up
|
2023-02-23 07:22:37 +00:00
|
|
|
|
```
|
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
It is beneficial to run this command in a separate terminal tab to observe backend logs easily.
|
|
|
|
|
|
|
|
|
|
By default, backend will run at `localhost:5001` with:
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
|
|
|
|
- Manifest at `/manifest`
|
|
|
|
|
- Graphql Playground at `/graphql`
|
|
|
|
|
- OpenApi viewer at `/docs`
|
2023-02-22 11:23:04 +00:00
|
|
|
|
|
|
|
|
|
### Develop frontend:
|
|
|
|
|
|
|
|
|
|
Installing dependencies with:
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
```shell
|
|
|
|
|
pnpm i
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Running dev server
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
```shell
|
|
|
|
|
pnpm dev
|
|
|
|
|
```
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
The frontend app will run at `localhost:3000`.
|
|
|
|
|
By default, it acts as a proxy and redirects all unhandled requests to the backend (configured by `MONITORING_APP_API_URL` env).
|
|
|
|
|
This way, all frontend and backend endpoints are accessible at `http://localhost:3000`
|
|
|
|
|
|
|
|
|
|
### Test with Saleor
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
Expose `http://localhost:3000` using a tunnel and use `https://your.tunnel/manifest` manifest URL to install `Monitoring` app
|
|
|
|
|
|
|
|
|
|
### Graphql Playground
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
To use Graphql Playground, `Monitoring` app needs to be installed in Saleor, and HTTP headers must be set:
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"authorization-bearer": "token",
|
|
|
|
|
"saleor-api-url": "https://my-env.saleor.cloud/graphql/"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Testing DataDog integration
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
Use these credentials sets to test DataDog integration:
|
|
|
|
|
|
|
|
|
|
Working credentials:
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"site": "US1",
|
|
|
|
|
"apiKey": "156e22d50c4e8b6816e1fd4794d3fd8c"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Credentials that validate but generate an error while sending events
|
2023-02-23 07:22:37 +00:00
|
|
|
|
|
2023-02-22 11:23:04 +00:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"site": "EU1",
|
|
|
|
|
"apiKey": "156e22d50c4e8b6816e1fd4794d3fd8c"
|
|
|
|
|
}
|
|
|
|
|
```
|