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

fix(EntityFrameworkCore): server.address field to follow otel conventions #2439

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

overbit
Copy link

@overbit overbit commented Dec 20, 2024

Fixes #2438

Update the server.address field in EntityFrameworkCore spans to populate with the server domain name without the tcp prefix.

Changes

  • 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.

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)

…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).
@overbit overbit requested a review from a team as a code owner December 20, 2024 12:12
@github-actions github-actions bot added the comp:instrumentation.entityframeworkcore Things related to OpenTelemetry.Instrumentation.EntityFrameworkCore label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.entityframeworkcore Things related to OpenTelemetry.Instrumentation.EntityFrameworkCore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] EntityFrameworkCore spans are not populating server.address following the otel conventions
1 participant