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

SqlClient db metrics #2026

Closed

Conversation

matt-hensley
Copy link
Contributor

Changes

Opening draft PR for feedback.

Some TODOs, including flaky tests, likely due to state.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@github-actions github-actions bot added the comp:instrumentation.sqlclient Things related to OpenTelemetry.Instrumentation.SqlClient label Aug 27, 2024
@matt-hensley
Copy link
Contributor Author

FYI @alanwest @gregkalapos

Copy link
Contributor

github-actions bot commented Sep 4, 2024

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 4, 2024
@alanwest alanwest removed the Stale label Sep 5, 2024
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

Copy link
Contributor

github-actions bot commented Oct 1, 2024

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 1, 2024
@github-actions github-actions bot removed the Stale label Oct 3, 2024
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 11, 2024
{
if (this.exceptionFetcher.TryFetch(payload, out Exception? exception) && exception != null)
{
tags.Add(SemanticConventions.AttributeErrorType, exception.Message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the message has high cardinality, this should be the full name of the exception type.
We also added db.response.status_code recently - ptal at some details on how to capture it
https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/sql.md

{
if (hasError)
{
var exceptionType = activity.Tags.SingleOrDefault(t => t.Key == SemanticConventions.AttributeExceptionType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception.type attribute is currently never set on the activity because it is a new attribute and the trace instrumentation has not yet been adapted to the new conventions.

Was your plan to update the trace instrumentation to follow the new conventions in this PR? Or were you looking to split the work up some how?


if (!string.IsNullOrEmpty(connectionDetails.Port))
{
// TODO: Should we continue to emit this if the default port (1433) is being used?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it should not be set if it is the default. See the following footnote from the conventions

[11]: If using a port other than the default port for this DBMS and if server.address is set.

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 22, 2024
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.sqlclient Things related to OpenTelemetry.Instrumentation.SqlClient Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants