Skip to content

[bug] EntityFramework instrumentation not automatically close the activity (or close is not working at all) #2792

Open
@cuichenli

Description

@cuichenli

Component

OpenTelemetry.Instrumentation.EntityFrameworkCore

Package Version

Package Name Version
OpenTelemetry.AutoInstrumentation 1.11.0
OpenTelemetry.Instrumentation.EntityFrameworkCore 1.12.0-beta.1
Npgsql.EntityFrameworkCore.PostgreSQL 9.0.4

Runtime Version

net8.0

Description

(I am not sure if that is a but or expected behaviour, please kindly forgive me if I made anything wrong.)

Noticed that if there is no parent activity set, the activity generated will recursive forever.

Steps to Reproduce

A (not very simply) reproduciable can be found at https://github.com/cuichenli/opentelemetry-demo/tree/e3ace5288cf71202738cb102fb90f8aab8e0a074

  • clone the repo and checkout to this particular commit
  • docker build . -t ghcr.io/open-telemetry/demo:latest-accounting
  • docker-compose up -d
  • get the jaeger port via docker inspect jaeger
    then you will see the traces like this:

Image

Expected Result

expect the trace to automatically close

Actual Result

but it is not closed and will generate nested traces

Additional Context

to workaround, i started an activity from the out side and now i can see they are closed correctly. cuichenli/opentelemetry-demo@e191c3e

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomp:instrumentation.entityframeworkcoreThings related to OpenTelemetry.Instrumentation.EntityFrameworkCore

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions