Skip to content

[bug] EFCore instrumentation, Query span is open until first data received, is closing before result completely received #2215

Open
@inklesspen1rus

Description

@inklesspen1rus

Component

OpenTelemetry.Instrumentation.EntityFrameworkCore

Package Version

Package Name Version
OpenTelemetry.Exporter.OpenTelemetryProtocol 1.9.0
OpenTelemetry.Instrumentation.EntityFrameworkCore 1.0.0-beta.12
Npgsql.EntityFrameworkCore.PostgreSQL 8.0.8

Runtime Version

net8.0

Description

Spans created by OTel instrumentation library are open until first part of response received.
That's affects only long queries but really confused because that's seems like application code is slow but actually there is active query.

Steps to Reproduce

  1. Set up local PostgreSQL instance with postgres password - postgres
    Or set up any PostgreSQL instance and edit connection string in Program.cs
  2. Insert medium/big demo database by PostgreSQL: https://postgrespro.com/community/demodb
  3. Launch sample project
  4. Check collected span

изображение

Expected Result

Span was closed when all result was received

Actual Result

Span was closed when any piece of data received

Additional Context

This screenshot shows that efcore span was closed when first piece of data received, while Npsql span was still open.

изображение

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