Skip to main content

Helios opentelemetry SDK

Project description

Helios OpenTelemetry SDK

This page describes the Helios OpenTelemetry SDK implementation.

Requirements

Unless otherwise noted, all published artifacts support Python 3.6 or higher.

Getting started

Setting the environment

  1. Make sure all the required packages are installed in the environment
  2. Set the HS_ACCESS_TOKEN env variable with your Helios access token (another option is to provide it within the code when calling to the initialize function)
  3. If you wish to disable the instrumentation set the HS_DISABLED env var to true

Manually instrument your code

To fully instrument your code, just import the initialize function from the SDK and run it in the beginning of your code

Here is an example of instrumenting a flask server:

import flask
from helios import initialize

hs = initialize(service_name='my_service_name')

app = flask.Flask('my_app')

@app.route('/', methods=['GET'])
def home():
    return "OK"


app.run()

The Helios SDK will automatically check all the supported packages, and instrument every package that is installed on the environment

In our example, assuming the flask module is installed in the env, it will be instrumented, together with every other supported module that is installed in the env

Running instrumented test

Once the helios-opentelemetry-sdk package is installed, the hstest plugin for pytest is installed by default. This plugin is responsible of automatically instrumenting your tests. In order to enable it, you should first set HS_ACCESS_TOKEN env var with your access token, and the HS_TEST_ENABLED env var to true.

HS_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN>
HS_TEST_ENABLED=true

# then run pytest as usual
pytest ./tests

This command will run all the tests in ./tests directory using pytest, instrumenting all the supported packages that are installed in the environment

Installing

The SDK package is available on the Python Package Index (PyPI). You can install it via pip with the following commands:

pip install helios-opentelemetry-sdk

Testing

  • install nox:

pip install nox

  • run all tests using the command nox from the main directory
  • you can list all available tests by running: nox --list
  • you can run a single test by runnong: nox --sessions <TEST_NAME>

Releasing

Follow the releasing instructions

Project details


Release history Release notifications | RSS feed

This version

0.1.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

helios-opentelemetry-sdk-0.1.4.tar.gz (20.4 kB view hashes)

Uploaded Source

Built Distribution

helios_opentelemetry_sdk-0.1.4-py3-none-any.whl (30.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page