https://github.com/danny-yamamoto/synthetic-monintoring
Verify synthetic monitor.
https://github.com/danny-yamamoto/synthetic-monintoring
Last synced: about 2 months ago
JSON representation
Verify synthetic monitor.
- Host: GitHub
- URL: https://github.com/danny-yamamoto/synthetic-monintoring
- Owner: danny-yamamoto
- Created: 2023-12-05T22:44:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-10T09:45:06.000Z (over 1 year ago)
- Last Synced: 2025-02-02T18:21:08.461Z (4 months ago)
- Language: JavaScript
- Size: 439 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# synthetic-monintoring
Verify synthetic monitor.## Environment variable
```bash
export PROJECT_ID=sanbox-334000
export DISPLAY_NAME="sm-kaizen-e"
export REGION="us-central1"
export FUNC_NAME="kaizen-e"
export FUNCTION_NAME="projects/${PROJECT_ID}/locations/${REGION}/functions/${FUNC_NAME}"
export ACCESS_TOKEN=`gcloud auth print-access-token`echo $PROJECT_ID
echo $DISPLAY_NAME
echo $REGION
echo $FUNC_NAME
echo $FUNCTION_NAME
echo $ACCESS_TOKEN
```## Create a Function
### Notes
- Ensure that more memory is available. `--memory`
- Set a longer timeout. `--timeout`
```bash
sudo gcloud functions deploy $FUNC_NAME \
--gen2 --region=$REGION --source="." \
--entry-point=CustomPuppeteerSynthetic --trigger-http --runtime=nodejs18 --project=$PROJECT_ID --memory=2G --timeout=60
```## Create a synthetic monitor
```bash
sudo curl https://monitoring.googleapis.com/v3/projects/${PROJECT_ID}/uptimeCheckConfigs \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json" --request POST \
--data '{ "displayName": "'"${DISPLAY_NAME}"'", "synthetic_monitor": {"cloud_function_v2": {"name": "'"${FUNCTION_NAME}"'"} },}'
```