open-telemetry / opentelemetry-dotnet-contrib

This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
https://opentelemetry.io
Apache License 2.0
462 stars 276 forks source link

[bug] db statements are not being saved when enabled #2157

Open lucasoares opened 2 weeks ago

lucasoares commented 2 weeks ago

Package

OpenTelemetry

Package Version

Package Name Version
OpenTelemetry.Instrumentation.SqlClient 1.9.0-beta.1
OpenTelemetry.Exporter.OpenTelemetryProtocol 1.4.0-beta.3

Runtime Version

net8.0

Description

I'm activating the SqlClient instrumentation with the following code:

                builder.AddSqlClientInstrumentation(options =>
                {
                    options.EnableConnectionLevelAttributes = true;
                    options.RecordException = true;
                    options.SetDbStatementForText = true;
                });

But only the db.name, db.system and peer.service tags are being exported.

Steps to Reproduce

as above

Expected Result

should add missing tags

Actual Result

image

Additional Context

No response

TimothyMothra commented 2 weeks ago

What tags specifically are you looking for? The Database specification isn't stable yet. https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md

The OpenTelemetry.Instrumentation.SqlClient library will need a large update after this spec is stabilized.

Kielek commented 2 weeks ago

@lucasoares, it will be great to have Minimal, Reproducible Example. Including your exact Sql Client version.

lucasoares commented 2 weeks ago

What tags specifically are you looking for? The Database specification isn't stable yet. https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md

The OpenTelemetry.Instrumentation.SqlClient library will need a large update after this spec is stabilized.

The db statements tags