Learn how to setup metrics in your Python application.
Open the Vigilant dashboard and generate an API key.
Initialize the Vigilant SDK in your Python application. Vigilant automatically captures print statements.
from vigilant import init_vigilant
init_vigilant(
name="backend",
token="tk_1234567890" # Use your API key from the dashboard
)
The Vigilant SDK provides a function to emit metrics.
from vigilant import metric_event
def function():
# Create a metric event
metric_event("user_login", 1)
# Create a metric event with a tag
metric_event("user_login", 1, {"route": "/"})
The Vigilant SDK exposes a few setup options when you initialize it.
from vigilant import init_vigilant
init_vigilant(
# Disable all functionality
noop=True,
)