Skip to content

Reporting TagWith / TagWithCallsite to OpenTelemetry? #33149

Open
@christophwille

Description

@christophwille

Is it possible to not only add the tag as a comment to the query but actually enrich the OpenTelemetry span of the query?

        var blog = await sqlServerDb.Blogs
            .OrderBy(b => b.BlogId)
            .TagWith("Getting published blog posts")
            .FirstAsync();

https://github.com/christophwille/OTel-de-Wille/blob/087e2dbd2972b25297da008a079c27950cb324d3/aspnet-aspiredashboard/Program.cs#L171

Screenshot of the as-is situation in Aspire Dashboard (note that due to having EF / SQL wired up I do see the execution):

image

Maybe is there something for the wire-up?

                    .AddHttpClientInstrumentation()
                    // .AddSqlClientInstrumentation()
                    .AddEntityFrameworkCoreInstrumentation(options =>
                    {
                        //options.EnrichWithIDbCommand = (activity, command) =>
                        //{
                        //    var stateDisplayName = $"{command.CommandType} main";
                        //    activity.DisplayName = stateDisplayName;
                        //    activity.SetTag("db.name", stateDisplayName);
                        //};
                    })

https://github.com/christophwille/OTel-de-Wille/blob/087e2dbd2972b25297da008a079c27950cb324d3/aspnet-aspiredashboard/WebApplicationBuilderExtensions.cs#L62

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions