Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryTextMode only populates db.query.text for stream API queries #4851

Closed
jcocchi opened this issue Oct 25, 2024 · 0 comments · Fixed by #4860
Closed

QueryTextMode only populates db.query.text for stream API queries #4851

jcocchi opened this issue Oct 25, 2024 · 0 comments · Fixed by #4860
Assignees

Comments

@jcocchi
Copy link
Contributor

jcocchi commented Oct 25, 2024

Describe the bug
Setting the QueryTextMode = QueryTextMode.All client configuration doesn't populate OpenTelemetry db.query.text attribute for queries unless you use the steam API for queries.

To Reproduce
Client options QueryTextMode= QueryTextMode.All
Used the console OTel exporter
Sample query code

    QueryDefinition query = new QueryDefinition("SELECT TOP 5 * FROM c");
    FeedIterator<dynamic> resultSetIterator = container.GetItemQueryIterator<dynamic>(query, null);
    while (resultSetIterator.HasMoreResults)
    {
        FeedResponse<dynamic> response = await resultSetIterator.ReadNextAsync();
        Console.WriteLine($"Items returned: {response.Count}, Trip request charge: {response.RequestCharge}, Trip execution time: {response.Diagnostics.GetClientElapsedTime()}");
    }

Expected behavior
Expect db.query.text= SELECT TOP 5 * FROM c to appear in OTel console output.

Actual behavior
db.query.text attribute doesn't appear.

Environment summary
SDK Version: 3.44.1
Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants