https://www.hyperdx.io/docs/install/python

Python - HyperDX Docs

HyperDX uses the OpenTelemetry standard for collecting telemetry data (logs and traces). Traces are auto-generated with automatic instrumentation, so manual instrumentation isn't required to get value out of tracing.

This Guide Integrates:  Logs  ·  Metrics  ·  Traces

Getting Started Permalink for this section

Install HyperDX OpenTelemetry Instrumentation Package Permalink for this section

Use the following command to install the HyperDX OpenTelemetry package (opens in a new tab).

Install OpenTelemetry’s automatic instrumentation libraries for the packages used by your Python application. We recommend that you use the opentelemetry-bootstrap tool that comes with the OpenTelemetry Python SDK to scan your application packages and generate the list of available libraries.

Configure Environment Variables Permalink for this section

Afterwards you'll need to configure the following environment variables in your shell to ship telemetry to HyperDX:

The OTEL_SERVICE_NAME environment variable is used to identify your service in the HyperDX app, it can be any name you want.

Run the Application with OpenTelemetry Python Agent Permalink for this section

Now you can run the application with the OpenTelemetry Python agent ( opentelemetry-instrument).

If you are using Gunicorn, uWSGI or uvicorn Permalink for this section

In this case, the OpenTelemetry Python agent will require additional changes to work. To configure OpenTelemetry for application servers using the pre-fork web server mode, make sure to call the configure_opentelemetry method within the post-fork hook.

Advanced Configuration Permalink for this section

Network Capture Permalink for this section

By enabling network capture features, developers gain the capability to debug HTTP request headers and body payloads effectively. This can be accomplished simply by setting HYPERDX_ENABLE_ADVANCED_NETWORK_CAPTURE flag to 1.

Troubleshooting Permalink for this section

Logs not appearing due to log level Permalink for this section

By default, OpenTelemetry logging handler uses logging.NOTSET level which defaults to WARNING level. You can specify the logging level when you create a logger:

Exporting to the Console Permalink for this section

The OpenTelemetry Python SDK usually displays errors in the console when they occur. However, if you don't encounter any errors but notice that your data is not appearing in HyperDX as expected, you have the option to enable debug mode. When debug mode is activated, all telemetries will be printed to the console, allowing you to verify if your application is properly instrumented with the expected data.

Read more about Python OpenTelemetry instrumentation here: https://opentelemetry.io/docs/instrumentation/python/manual/ (opens in a new tab)

Deno React Native