GUIDE.md

Getting Started

Set up ProdWatch in under 10 minutes.

Step 1: Sign up for hosting.

ProdWatch listens in your editor(s) for requests to watch function calls. These requests need to be securely coordinated with your production apps. When a function is watched, any live function calls will be sent to your editor(s) for display.

If you want us to do this coordination for you, sign up on ProdWatch here.

Looking to self host?

If you'd like to self host, there are a few extra steps to take. The source code for the editor extension and the process manager are both available on GitHub. To coordinate your production apps with your code editor(s), you'll need to set up a hosting server. Send your AI coding assistant over to this OpenAPI spec and ask it to spin up a server for you.

Step 2: Create an API key.

Once you've signed up, go to your tokens page and create an API key. Copy it down and have it ready to use shortly.

Step 3: Install the ProdWatch client library.

Install the ProdWatch Python package using pip:

pip install prodwatch

This will install the ProdWatch client library that connects your application to the monitoring service.

The client library is fully documented on GitHub.

Step 4: Run ProdWatch in your code.

First, set your API token as an environment variable:

export PRODWATCH_API_TOKEN=your_token_here

Then, import and start ProdWatch in your Python application:

# your_program.py

from prodwatch import start_prodwatch

if __name__ == "__main__":
    start_prodwatch("my-app")

Once you call start_prodwatch(), you'll be ready to start watching function calls.

Step 5: Set up the VS Code extension.

Now we're ready to set up the VS Code extension.

The extension is configurable and has a comprehensive usage guide on GitHub, but we will cover a minimum setup here.

Install the extension.

Install the VS Code extension here, or by searching for "ProdWatch" in the VS Code Extensions Marketplace.

Set your app name.

Setting up the extension requires usage of the command pallete: Cmd+Shift+P on Mac or Ctrl+Shift+P on Windows/Linux.

ProdWatch: Set App Name

Enter the same app name string you used in Step 4 to run your application.

Authenticate.

Open the Command Palette again and run:

ProdWatch: Login

Enter your username and password when prompted.

Step 6: Watch a function call.

Hover over a function definition in your code and you'll see a blue button at the bottom of the popover. Click it to start watching the function call.

ProdWatch will now track the function call and display the number of times it's been called in the VS Code status bar.

Hover over the function in your code to see what the arguments were when the function was called.

The setup is now complete! Happy watching!