Skip to content

Sqlite3 semconv optin tests#4836

Open
henry3260 wants to merge 2 commits into
open-telemetry:mainfrom
henry3260:sqlite3-semconv-optin-tests
Open

Sqlite3 semconv optin tests#4836
henry3260 wants to merge 2 commits into
open-telemetry:mainfrom
henry3260:sqlite3-semconv-optin-tests

Conversation

@henry3260

@henry3260 henry3260 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Description

This adds two tests mirroring the merged mysql (#4810) / mysqlclient (#4834)
pattern, exercised against a real in-memory SQLite connection:

  • test_semconv_stable (database,http): asserts only stable attributes are
    emitted (db.system.name, db.query.text) and legacy ones (db.system,
    db.statement) are absent
  • test_semconv_dup (database/dup,http/dup): asserts both legacy and stable
    attributes are emitted with correct values

Unlike the other dbapi-based instrumentations, sqlite3 captures no connection
attributes (_CONNECTION_ATTRIBUTES is empty), so the tests also verify that
db.name/db.namespace, db.user, net.peer.* and server.* are absent in
both modes.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • tox -e py312-test-instrumentation-sqlite3 — 10 passed (8 existing + 2 new)
  • tox -e lint-instrumentation-sqlite3 — pylint 10.00/10
  • pre-commit run ruff / ruff-format — clean

Does This PR Require a Core Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated (not required: test-only change)

…est coverage

Cover database,http and database/dup,http/dup opt-in modes, verifying
stable-only and dual-emission span attributes, mirroring the pattern
from open-telemetry#4810. sqlite3 captures no connection attributes, so only
db.system.name/db.query.text (and their legacy counterparts in dup
mode) are asserted.
@henry3260
henry3260 marked this pull request as ready for review July 18, 2026 15:33
@henry3260
henry3260 requested a review from a team as a code owner July 18, 2026 15:33
@xrmx

xrmx commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@henry3260 Hey Henry, we appreciate PRs but please slow down a bit, you have already 8 PRs open :)

@henry3260

Copy link
Copy Markdown
Contributor Author

@henry3260 Hey Henry, we appreciate PRs but please slow down a bit, you have already 8 PRs open :)

Got it! Thanks for the heads-up. I'll hold off on opening new PRs for now until the current ones are reviewed. Take your time! :) I know reviewing takes a lot of time and effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants