-
Notifications
You must be signed in to change notification settings - Fork 296
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
fix(EntityFrameworkCore): server.address field to follow otel conventions #2439
base: main
Are you sure you want to change the base?
Conversation
…ions Fixes open-telemetry#2438 Update the `server.address` field in EntityFrameworkCore spans to populate with the server domain name without the `tcp` prefix. * Modify `src/OpenTelemetry.Instrumentation.EntityFrameworkCore/Implementation/EntityFrameworkDiagnosticListener.cs` to fetch the `host` and `port` properties from the `connection` object and set them to the `server.address` field, with a fallback to use the `dataSource` property if the `host` property is not available. * Update `src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md` to reflect the changes made to the `server.address` field. * Add tests in `src/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkInstrumentationTests.cs` to verify the `server.address` field is populated correctly without the `tcp` prefix. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/open-telemetry/opentelemetry-dotnet-contrib/issues/2438?shareId=XXXX-XXXX-XXXX-XXXX).
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
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.
Please clean-up all errors/warning in build-pipeline
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
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.
It is mandatory.
{ | ||
activity.AddTag(AttributeServerAddress, dataSource); | ||
activity.AddTag(AttributeServerAddress, port); |
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.
Are you sure about attribute name here?
Fixes #2438
Update the
server.address
field in EntityFrameworkCore spans to populate with the server domain name without thetcp
prefix.Changes
src/OpenTelemetry.Instrumentation.EntityFrameworkCore/Implementation/EntityFrameworkDiagnosticListener.cs
to fetch thehost
andport
properties from theconnection
object and set them to theserver.address
field, with a fallback to use thedataSource
property if thehost
property is not available.src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md
to reflect the changes made to theserver.address
field.src/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkInstrumentationTests.cs
to verify theserver.address
field is populated correctly without thetcp
prefix.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes