opentelemetry-dotnet-contrib icon indicating copy to clipboard operation
opentelemetry-dotnet-contrib copied to clipboard

[bug] db statements are not being saved when enabled

Open lucasoares opened this issue 1 year ago • 3 comments

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

lucasoares avatar Oct 03 '24 20:10 lucasoares

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.

TimothyMothra avatar Oct 03 '24 20:10 TimothyMothra

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

Kielek avatar Oct 04 '24 07:10 Kielek

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

lucasoares avatar Oct 04 '24 12:10 lucasoares

Same case,I hava CommandText from eventsource,but no value , so no db.statement tag, .net48 (old project...

Robert-Chan avatar Nov 03 '24 09:11 Robert-Chan

@Robert-Chan, I will repeat. it will be great to have Minimal, Reproducible Example. Including your exact Sql Client version to debug/determine what is the root cause.

Kielek avatar Nov 04 '24 06:11 Kielek

I am closing this. Feel free to reopen/comment/create new issue when you provide exact steps to reproduce.

Kielek avatar Jan 03 '25 06:01 Kielek