open-telemetry / open-telemetry/opentelemetry-python

Auto instrumentation is not working

Open
#3,482 19 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-instrumentation bug
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Following the steps here https://opentelemetry.io/docs/instrumentation/python/automatic/example/#execute-the-automatically-instrumented-server

Run server first

opentelemetry-instrument --traces_exporter console --metrics_exporter none python server_automatic.py

Then run client

python client.py testing
{
    "name": "client-server",
    "context": {
        "trace_id": "0x8212674bb3c491c6ca3995ba997d90bc",
        "span_id": "0xe8254224de6581ba",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": "0x71f65d5cce1f1f63",
    "start_time": "2023-10-25T17:24:31.980542Z",
    "end_time": "2023-10-25T17:24:31.992175Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {},
    "events": [],
    "links": [],
    "resource": {
        "attributes": {
            "telemetry.sdk.language": "python",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.20.0",
            "service.name": "unknown_service"
        },
        "schema_url": ""
    }
}
{
    "name": "client",
    "context": {
        "trace_id": "0x8212674bb3c491c6ca3995ba997d90bc",
        "span_id": "0x71f65d5cce1f1f63",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": null,
    "start_time": "2023-10-25T17:24:31.980484Z",
    "end_time": "2023-10-25T17:24:31.992201Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {},
    "events": [],
    "links": [],
    "resource": {
        "attributes": {
            "telemetry.sdk.language": "python",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.20.0",
            "service.name": "unknown_service"
        },
        "schema_url": ""
    }
}

Client do have output, but server automatic do not have any output, based on the doc here https://opentelemetry.io/docs/instrumentation/python/automatic/example/#execute-the-automatically-instrumented-server

The console running server_automatic.py will display the spans generated by instrumentation as JSON. The spans should appear similar to the following example:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the automatic instrumentation example linked in the issue and reproduce the documented server and client commands using server_automatic.py and client.py. Compare the server console with the expected JSON spans in the documentation; done means the automatically instrumented server emits spans as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.