Steps to run on your vm instances:
- Create a service and grant it access to Metric writing for the VM instance
Steps to create a custom metrics
- Import the Google Monitoring Library
- Create a metric descriptor
- Create a data point
- Create a time series
- Write request object => write!
Monitoring API
- Format: "custom.google.com/[global | <resource_type>]/<custom_metric_name>
- Info:
- global: generic use
- resource_type: specific resource use
Link: https://medium.com/google-cloud/stackdriver-custom-metrics-in-python-30fafb585a1d
- Create a virtualenv
- Install dependencies from requirements.txt file
- Activate the environment
- If using
pyenv
runpipenv install
from the app folder