Kensu Documentation

⌘K
Getting started with the Kensu Community Edition
Marketing campaign
Financial data report
Getting credentials
Recipe: Observe Your First Pipeline
Agents: getting started
Python
PySpark
Scala Spark
Databricks Notebook
Agent Listing
Docs powered by archbee 
9min

Configure the Python agent

Here we show how to modify a Python program to add Kensu.

💻 Include Kensu in your program

🕵️‍♀️Explore the program

Here is the program script.py. This shows the program before we add Kensu.

The content is very simple. Using Pandas, it merges three DataFrames.

In the end, the output is written to a data file.

Python
|

👨‍💻Modify the program to use Kensu

To include Kensu in your program, follow these steps:

  1. Create a conf.ini file.
  2. Init Kensu.
  3. Modify the libraries' imports to import Kensu modules instead.



1️⃣ Create a conf.ini file

The conf.ini file is where you put your credentials and define where the output should go. The output destination is called a Reporter.

The default reporter is the APIReporter. That writes the data to the Kensu cloud. You access the Kensu cloud with the Kensu dashboard.

To send entities to Kensu, you need to add the kensu_ingestion_url and your kensu_ingestion_token.

conf.ini
|



2️⃣ Init Kensu in your code

In your code, create a Kensu client. To do that, add the following lines to the script.

This client will use the properties defined in the conf.ini file.

Python
|



3️⃣ Modify the libraries imports to import Kensu modules

The last step that you need to use Kensu is to modify the import libraries in order to use the Kensu Pandas instead of the base Pandas.

Python
|



Here is the fully modified version to use Kensu.

Python
|



Updated 11 Oct 2022
Did this page help you?
Yes
No
UP NEXT
Running your first Kensu Pandas program
Docs powered by archbee 
TABLE OF CONTENTS
💻 Include Kensu in your program
🕵️‍♀️Explore the program
👨‍💻Modify the program to use Kensu