Quickstart¶
This document describes the steps to enable Okahu tracing in your GenAI application. With that your application will send the traces to Okahu SAS endpoint where they can be viewed and used by Okahu to maintain the application details and generate insights.
Create a virtual environment with Monocle¶
If you don't have a Python virtual environment, you'll only need to do this once in your project folder:
Activate the virtual environment¶
Do this every time you start a new terminal session.
Install Monocle¶
Note
-
For Azure support (to upload traces to Azure), install with the azure extra:
-
For AWS support (to upload traces to AWS), install with the aws extra:
Set an OpenAI API key¶
Create Okahu tenant¶
Login to Okahu portal with your Github or Linkedin account and a new tenant will be provisioned automatically.
Obtain Okahu API key¶
Navigate to Settings. Then click on Generate API Key.
Export the API Key in the project environment.
Enable Monocle tracing¶
To enable your application sending traces to Okahu cloud, add two lines of code on the top of your main application file.
from monocle_apptrace import setup_monocle_telemetry
setup_monocle_telemetry(workflow_name = "my_workflow")
Test the changes¶
-
Login to Okahu portal
-
Click on New Application
-
Click on the Browse Discovered Components under the Components section. This will bring up the list of known components
-
The workflow name (e.g.
my_workflow) that's set in your application should show up in the component list -
Click Add Selection then Save to finish
Troubleshooting¶
1. Error in installing the Monocle SDK library
Make sure that you have network path open to Okahu's Pypi compatible repository. Verify the connectivity by running nslookup -port=443 okahu.jfrog.io
2. The verification steps didn't show the configured workflow name
If the workflow-name is not there in the list of components per the [Test the changes] steps(#test-the-changes) mentioned above, Okahu is not receiving traces from your application.
- Verify that you have set the correct API key for your Okahu tenant. Debug variable os.environ["OKAHU_API_KEY"] inside your app.
- Make sure that you have network path open to Okahu's trace ingestion endpoint. Verify the connectivity by running nslookup -port=443 ingest.okahu.io. If there's not network path, please contact your cloud/network/security admins to enable it.
