Introducing the Instana Python REST API Client

Accessing Your Instana Data Using Python

At Instana we continuously extract and collect huge amounts of infrastructure, application, and tracing data (billions upon billions of metrics & traces every day across our customer base). We then analyze, transform, and apply advanced machine learning algorithms to this data to provide the industries best solution for application performance monitoring of modern applications. We do this for many infrastructure and application technologies, including languages like Python, Java, .NET, Go, and more.

In the end, this is your data. We believe you should be able to access it how you want, either through our advanced dashboards and visualizations, in Grafana, or even in raw form through our REST API.

Based on this philosophy, we continue our efforts to make your data available to you where and when you need it. Today we are pleased to announce that we have released a new Python REST API client. With this client you can now access all of your Instana data programmatically using Python.

Getting Started with the Python REST API Client

You can find the Python REST API Client files on Pypi as part of the Instana Python sensor package.

To instantiate the Python client you can do the following:

from instana.api import APIClient
c = APIClient(base_url="https://yourdashboard.instana.io", api_token=‘yourAPItoken’)

or alternatively you can configure your base URL and API token via environment variables:

export INSTANA_API_TOKEN=yourAPItoken
export INSTANA_BASE_URL=https://yourdashboard.instana.io
from instana.api import APIClient
c = APIClient()

From here, you have access to the full extent of the REST API. For example:

# Retrieve the current application view
x = c.application_view()

# Retrieve snapshots results from a query
y = c.snapshots("entity.selfType:webService entity.service.name:\”instana.com\””)

# Retrieve all recent changes & events
z = c.events()

# Get a specific trace by ID
aa = c.trace(1234567890)

With the Python REST API client, you have access to the entire REST API as documented.

Here are just some of the things you can do with the Instana REST API:

  • Download Audit logs
  • Add/Delete End User Monitoring (EUM) applications
  • Retrieve events for a specific timeframe
  • Download any/all of the large number of metrics we support
  • Configure custom alerts
  • Remotely configure Service Extraction
  • Get the state of your infrastructure and applications at any point in time (up to 2 months back by default)
  • Download your generated traces
  • Manage users of the Instana dashboard; add/edit/remove accounts

At Instana we believe that interoperability within your entire software ecosystem is critical to success. The Instana Python REST API is a great way for you to programatically interact with Instana and the data contained within.

If you’re not an Instana user yet, you should take a look at the value Instana delivers by monitoring your modern, dynamic, containerized applications.

Sign up for a free trial of Instana Application Performance Monitoring today.