-
Notifications
You must be signed in to change notification settings - Fork 491
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
Open Telemetry : Adds query text in attribute #4664
base: master
Are you sure you want to change the base?
Conversation
2f7c8e7
to
e663af5
Compare
816b162
to
8e29f00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to have an opt in to also capture parameter values attributes? This is described in the otel conventions, but we can always go back and add it if there's demand later.
Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs
Show resolved
Hide resolved
showQueryMode = queryRequestOptions.ShowQueryMode.Value; | ||
|
||
} | ||
else if (requestOptions is ChangeFeedRequestOptions changeFeedRequestOptions && changeFeedRequestOptions.ShowQueryMode.HasValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to show query text for change feed operations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an option to pass query in change feed iterator. We can discuss and understand, if we really need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What scenario would change feed expose a query in traces and when would it not? Do you have examples?
9b3858e
to
35201c3
Compare
/// <summary> | ||
/// Defines whether to print query in tracing attributes | ||
/// </summary> | ||
public enum ShowQueryMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the values be in pascal case instead? It seems this is the convention in this repo like:
Gateway = 0, |
ReuseUnicastPort = 0, |
Description
db.query.text
attribute to record queries in Traces.ShowQueryMode
, which will have valid values asa)
NONE
:Do not show query.b)
PARAMETERIZED_ONLY
: Print parameterized query only.b)
ALL
CosmosClientTelemetryOptions
andRequestOptions
(i.e.QueryRequestOptions
andChangeFeedRequestOptions
)Type of change