All Products
Search
Document Center

Managed Service for OpenTelemetry:Report Python application data with SkyWalking

Last Updated:Jun 21, 2026

After you instrument your application with SkyWalking and report distributed tracing data to Managed Service for OpenTelemetry, Managed Service for OpenTelemetry starts to monitor your application. You can then view a range of monitoring data, such as application topology, traces, failed transactions, slow transactions, and SQL analysis. This topic describes how to use the SkyWalking Python Agent to enable auto-instrumentation and report application data.

Prerequisites

  • You have downloaded the Python agent for Apache SkyWalking. We recommend that you use the latest version.

  • You have added the SkyWalking Python agent to your Python project.

  • Obtain an endpoint

    New console

    1. Log on to the Managed Service for OpenTelemetry console. In the left-side navigation pane, click Integration Center.

    2. On the Integration Center page, click the SkyWalking card in the Open Source Frameworks section.

    3. In the SkyWalking panel, click the Start Integration tab, and then select a region in which you want to report data.

      Note

      When you access a region for the first time, resources are automatically initialized there.

    4. Configure the Connection Type parameter and copy an endpoint.

      If your service is deployed on Alibaba Cloud and resides in the region that you selected, we recommend that you set this parameter to Alibaba Cloud VPC Network. Otherwise, set this parameter to Public Network.

      image.png

    Old console

    1. Log on to the Managed Service for OpenTelemetry console.

    2. In the left-side navigation pane, click Cluster Configurations. On the page that appears, click the Access point information tab.

    3. In the top navigation bar, select a region in which you want to report data. In the Cluster Information section, turn on Show Token.

    4. Set the Client parameter to SkyWalking.

      In the Related Information column of the table, copy an endpoint.

      SkyWalking接入点信息

      Note

      If your application is deployed in an Alibaba Cloud production environment, use a VPC endpoint. Otherwise, use a public endpoint.

Background information

SkyWalking is a popular open source application performance monitoring (APM) tool for microservices, cloud-native, and container-based architectures, including Docker, Kubernetes, and Mesos. At its core, SkyWalking is a distributed tracing system.

skywalking-python is the official Python agent library for SkyWalking. You can integrate skywalking-python to monitor Python applications. It supports auto-instrumentation for many third-party libraries, such as Kafka, HTTP, AIOHTTP, Redis, and WebSockets.

Supported third-party libraries

Library

Python version - library version

Plugin name

aiohttp

Python ≥ 3.7 - 3.7.*

sw_aiohttp

aioredis

Python ≥ 3.7 - 2.0.*

sw_aioredis

aiormq

Python ≥ 3.7 - 6.3, 6.4

sw_aiormq

amqp

Python ≥ 3.7 - 2.6.1

sw_amqp

asyncpg

Python ≥ 3.7 - 0.25.0

sw_asyncpg

bottle

Python ≥ 3.7 - 0.12.23

sw_bottle

celery

Python ≥ 3.7 - 5.1

sw_celery

confluent_kafka

Python ≥ 3.7 - 1.5.0, 1.7.0, 1.8.2

sw_confluent_kafka

django

Python ≥ 3.7 - 3.2

sw_django

elasticsearch

Python ≥ 3.7 - 7.13, 7.14, 7.15

sw_elasticsearch

hug

Python ≥ 3.11 - Not supported

Python ≥ 3.10 - 2.5, 2.6

Python ≥ 3.7 - 2.4.1, 2.5, 2.6

sw_falcon

fastapi

Python ≥ 3.7 - 0.89.*, 0.88.*

sw_fastapi

flask

Python ≥ 3.7 - 2.0

sw_flask

happybase

Python ≥ 3.7 - 1.2.0

sw_happybase

http_server

Python ≥ 3.7 - *

sw_http_server

werkzeug

Python ≥ 3.7 - 1.0.1, 2.0

sw_http_server

httpx

Python ≥ 3.7 - 0.23.*, 0.22.*

sw_httpx

kafka-python

Python ≥ 3.7 - 2.0

sw_kafka

loguru

Python ≥ 3.7 - 0.6.0, 0.7.0

sw_loguru

mysqlclient

Python ≥ 3.7 - 2.1.*

sw_mysqlclient

neo4j

Python ≥ 3.7 - 5.*

sw_neo4j

psycopg[binary]

Python ≥ 3.11 - 3.1.*

Python ≥ 3.7 - 3.0.18, 3.1.*

sw_psycopg

psycopg2-binary

Python ≥ 3.10 - Not supported

Python ≥ 3.7 - 2.9

sw_psycopg2

pymongo

Python ≥ 3.7 - 3.11.*

sw_pymongo

pymysql

Python ≥ 3.7 - 1.0

sw_pymysql

pyramid

Python ≥ 3.7 - 1.10, 2.0

sw_pyramid

pika

Python ≥ 3.7 - 1.2

sw_rabbitmq

redis

Python ≥ 3.7 - 3.5.*, 4.5.1

sw_redis

requests

Python ≥ 3.7 - 2.26, 2.25

sw_requests

sanic

Python ≥ 3.10 - Not supported

Python ≥ 3.7 - 20.12

sw_sanic

tornado

Python ≥ 3.7 - 6.0, 6.1

sw_tornado

urllib3

Python ≥ 3.7 - 1.26, 1.25

sw_urllib3

urllib_request

Python ≥ 3.7 - *

sw_urllib_request

websockets

Python ≥ 3.7 - 10.3, 10.4

sw_websockets

Sample application

Sample application repository: SkyWalking Demo

This demo is a simple, Flask-based example that forwards requests and interacts with a MySQL database. The SkyWalking agent monitors the application and reports data.

Enable auto-instrumentation for a Python application

You can configure SkyWalking Python Agent parameters in your Python project files or as environment variables.

Configure parameters in code

Modify theconfig.init parameters in your Python project file. In the sample application, the corresponding files are proxy/TestProxy.py and controller/TestController.py.

from skywalking import config
config.init(ConfigurationName = ConfigurationValue)

Configure parameters as environment variables

Add the following content to your environment variable file and then restart your application for the changes to take effect.

export SW_AGENT_ConfigurationName=ConfigurationValue
Note

For Docker container environments, you can configure environment variables under the environment option in the docker-compose.yaml file.

  1. Configure the endpoint and token.

    1. Import SkyWalking in your Python file.

      from skywalking import agent, config
    2. Configure the endpoint and authentication token.

      Replace <endpoint> and <auth-token> with the endpoint and authentication token you obtained in the Prerequisites section.

      config.init(agent_collector_backend_services='<endpoint>',
                  agent_authentication='<auth-token>')
  2. Configure a service name as the application identifier.

    config.init(agent_name='<service name>')
  3. Configure the data reporting protocol. The only supported protocol is gRPC.

    ### The only available reporting protocol is 'grpc'.
    config.init(agent_protocol='<protocol>')
  4. Configure other optional parameters as needed. For more information, see the Apache SkyWalking official documentation.

  5. Restart the application.

FAQ

  • What do I do if the Method not found: skywalking.v3.LogReportService/collect error occurs when reporting data over gRPC?

    grpc._channel._InactiveRpcError: &lt;_InactiveRpcError of RPC that terminated with:
        status = StatusCode.UNIMPLEMENTED
        details = &quot;Method not found: skywalking.v3.LogReportService/collect&quot;
        debug_error_string = &quot;UNKNOWN:Error received from peer  {grpc_message:&quot;Method not found: skywalking.v3.LogReportService/collect&quot;, grpc_status:12, created_time:&quot;2023-07-05T15:58:00&quot;}&quot;
    &gt;

    Set agent_log_reporter_active to False in the config.init call.

    config.init(agent_log_reporter_active=False)
  • What do I do if the Method not found: skywalking.v3.MeterReportService/collect error occurs when reporting data over gRPC?

    grpc._channel._InactiveRpcError: &lt;_InactiveRpcError of RPC that terminated with:
            status = StatusCode.UNIMPLEMENTED
            details = &quot;Method not found: skywalking.v3.MeterReportService/collect&quot;
            debug_error_string = &quot;UNKNOWN:Error received from peer  {grpc_message:&quot;Method not found: skywalking.v3.MeterReportService/collect&quot;, grpc_status:12, created_time:&quot;2023-07-05T16:00:00+08:00&quot;}&quot;
    &gt;

    The console does not support metric data reporting. In the config.init call, set agent_meter_reporter_active to False.

    config.init(agent_meter_reporter_active=False)

References

Apache SkyWalking official website