Git Product home page Git Product logo

gcp-synthetic-monitoring's Introduction

GCP-synthetic-monitoring

Intro

This repo demos a synthetic monitor on GCP, i've used as example https://training.zenika.com.

The business use-case i'm monitoring :

  1. Navigate on the homepage
  2. Type in the search bar for a CKA training
  3. Consult a search result page and chose the first result
  4. Show be redirected to the training detail page.

Requirements

Getting started

make sure dependencies are installed npm install

try executing the monitor locally:

npx functions-framework --target=<YOUR_CLOUD_FUNC_ENTRYPOINT>

next:

  • Authenticate to GCP with the gcloud cli: gcloud auth login
  • Define the correct project: gcloud set-project <YOUR_PROJECT_ID>
  • Deploy your cloud function :
gcloud functions deploy <YOUR_CLOUD_FUNC_NAME> --gen2 --runtime=nodejs18 --region=<REGION> --source=. --entry-point=<YOUR_CLOUD_FUNC_ENTRYPOINT> --memory=2G --timeout=60 --trigger-http
  • Create monitor that relies on our cloud function:
gcloud monitoring uptime create <YOUR_MONITOR_NAME> --synthetic-target=projects/<PROJECT_ID>/locations/<REGION>/functions/<YOUR_CLOUD_FUNC_NAME> --period=5

You should be good to go with monitor setup

Note

The cloud function relies on puppeteer to run headless browser, to be as close as possible to the user behavior and to match the web best practices it relied on pptr-testing-library which is an wrapper around puppeteer that provides a set of useful queries. Feel free to chose to use it or not.

gcp-synthetic-monitoring's People

Contributors

tarektouati avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.