Contributed by: Isaac Lipszyc
This sample shows how you can trace your Python function code with APM Tracing and Zipkin.
As you make your way through this tutorial, look out for this icon .
Whenever you see it, it's time for you to perform an action.
Before you proceed further, ensure you have followed all the steps outlined in the parent README file located in trace-functions-with-apm
Review the following files in the current folder:
- the code of the function, func.py
- its dependencies, requirements.txt
- the function metadata, func.yaml
In Cloud Shell, run the fn deploy
command to build this function and its dependencies as a Docker image,
push the image to the specified Docker registry, and deploy this function to Oracle Functions
in the application created earlier:
fn -v deploy --app <app-name>
e.g.
fn -v deploy --app myapp
We have already enabled tracing for the Functions application. Now, enable tracing for your function.
-
From the OCI Console navigation menu, select Developer Services, and then select Functions.
-
Select the compartment demo-func-compartment that you created.
-
Click on the application name to go to the Application Details screen.
-
Click on Functions under the Resources section.
-
Click on the Enable Trace toggle switch for the function you deployed.
In Cloud Shell, run the following fn invoke
command to unit test this function:
fn invoke <app-name> <function-name>
e.g.,
fn invoke myapp apm-fn-int-python
You should see your function traces in the APM Trace Explorer.
-
From the OCI Console navigation menu, select Application Performance Monitoring, and then select Trace Explorer.
-
Select the compartment demo-func-compartment and the demo-apm-domain that you created.
-
Select a time window e.g., "Last 15 minutes".
-
You should see your function traces listed on the page. Click on a trace for your function and it will open the "Trace Details" page and show all your spans and the time taken by each span.
-
Click on one of the spans to get the span details, including errors, if any.