Python Custom Instrumentation
  • 1 Minute to read
  • Dark
    Light
  • PDF

Python Custom Instrumentation

  • Dark
    Light
  • PDF

Article Summary

Configuration

Custom Instrumentation allows you to track classes and functions not natively supported in our Python Profiler. Include a stackify.json file in your application's root directory.

Example:

{
  "instrumentation": [
    {
      "class": "SampleClass1",
      "method": "execute",
      "module": "path.file"
    },
    {
      "class": "SampleClass2",
      "method": "index",
      "module": "path.file"
    }
  ]
}

Custom Instrumentation is supported in the Stackify Python Profiler 1.1+ versions.

Tracked Functions

Tracked Functions allows you track a specific method call across requests, data will show up in your application dashboard under the Tracked Functions tab.

Example:

{
  "instrumentation": [
    {
      "class": "SampleClass1",
      "method": "execute",
      "module": "path.file"
      "trackedFunction": true,
      "trackedFunctionName": "{{ClassName}}.{{MethodName}}"
    },
    {
      "class": "SampleClass2",
      "method": "index",
      "module": "path.file"
      "trackedFunction": true,
      "trackedFunctionName": "{{ClassName}}.{{MethodName}}"
    }
  ]
}

Was this article helpful?