Language Specific Profiling
ObserveNow Profiler allows you to instrument applications with language specific SDKs to allow you to bring in profiling information to allow easier identification of code hotspots and provide more visibility into CPU/Memory usage of your code. To instrument your applications, you can use the following guide depending on your application language.
To use any of these instrumentations, ensure you have ObserveNow Profiler enabled for your stack.
Login to the profiling server with your credentials, and then navigate to Settings -> API keys -> Add API Key and create a new API Key with following config:
Name: AppProfilingKey
Role: Agent
Valid for: 0 # No expiry
Make sure you copy the API Key created as we'll use this key below.
Java Instrumentation
Download the latest version of pyroscope.jar from pyroscope release page
Set environment variables and then use the pyroscope jar you downloaded as a javaagent to start profiling your application
export PYROSCOPE_FORMAT="jfr"
export PYROSCOPE_PROFILER_ALLOC=0
export PYROSCOPE_APPLICATION_NAME=java-instrumentation
export PYROSCOPE_SERVER_ADDRESS=<ADD_SERVER_ENDPOINT_HERE>
export PYROSCOPE_AUTH_TOKEN=<ADD_APIKEY_HERE>
java -javaagent:pyroscope.jar -jar your-application.jar
NodeJS Instrumentation
Install the NodeJS SDK using npm install @pyroscope/nodejs
You can then initialize profiling using the following block of code:
const Pyroscope = require('@pyroscope/nodejs');
Pyroscope.init({ serverAddress: '<ADD_SERVER_ENDPOINT_HERE>',
authToken: <ADD_APIKEY_HERE>,
appName: 'nodeJSAppName' });
Pyroscope.start()
For more configuration options, you can use the Pyroscope NodeJS SDK repo
Python Instrumentation
Install the Python SDK using pip install pyroscope-io
Then you can initialize profiling using the following block of code:
import pyroscope
pyroscope.configure(
application_name = "my.python.app",
server_address = "<ADD_SERVER_ENDPOINT_HERE>",
auth_token = "<ADD_APIKEY_HERE>"
)
For more configuration options, you can reference the Pyroscope Python SDK