Skip to content

opentelemetry-instrumentation-sqlite3: add semconv stability opt-in test coverage#4848

Closed
SurbhiD404 wants to merge 4 commits into
open-telemetry:mainfrom
SurbhiD404:semconv-migration-sqlite3
Closed

opentelemetry-instrumentation-sqlite3: add semconv stability opt-in test coverage#4848
SurbhiD404 wants to merge 4 commits into
open-telemetry:mainfrom
SurbhiD404:semconv-migration-sqlite3

Conversation

@SurbhiD404

Copy link
Copy Markdown
Contributor

Description

Fixes #4847

This PR adds instrumentation-level semconv stability opt-in test coverage for opentelemetry-instrumentation-sqlite3.

The sqlite3 instrumentation already declares semantic convention migration support (_semconv_status = "migration") and routes through the shared DBAPI wrapper's stability-mode logic, but its instrumentation-specific test suite did not verify the supported OTEL_SEMCONV_STABILITY_OPT_IN modes.

This change adds a TestSQLite3SemconvStability test class covering the three supported semantic convention modes:

  • default
  • database
  • database/dup

The tests verify the expected span attributes (DB_SYSTEM/DB_STATEMENT vs. DB_SYSTEM_NAME/DB_QUERY_TEXT) and the emitted schema_url for each mode, following the testing pattern already used by other migration-enabled instrumentations, including Cassandra (#4747), pymemcache (#4739), pymongo (#4772), and MySQL (#4810).

No production code changes are included.

Type of change

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

How Has This Been Tested?

Verified locally against the current main branch:

  • Full opentelemetry-instrumentation-sqlite3 test suite passes (11/11 tests)
  • New semconv stability tests pass
  • pre-commit (ruff, ruff-format) passes

Reproduce with:

pytest instrumentation/opentelemetry-instrumentation-sqlite3/tests/test_sqlite3.py -v

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

@SurbhiD404
SurbhiD404 requested a review from a team as a code owner July 22, 2026 00:50
)

def test_new_semconv(self):
with mock.patch.dict(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: use decorator

@henry3260

Copy link
Copy Markdown
Contributor

FYI this overlaps with #4836, which covers the same semconv stability opt-in tests for sqlite3.

@SurbhiD404

Copy link
Copy Markdown
Contributor Author

@herin049 @henry3260

Just wanted to flag that this overlaps with #4836, which also adds sqlite3 semconv stability test coverage and was opened a few days earlier. I wanted to make sure the overlap was visible before this goes further.

I'm happy to adjust this PR, incorporate any additional feedback, or otherwise follow whichever direction you think is best for consolidating the work.

@xrmx

xrmx commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Closed as dup and also for the bot answer.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

opentelemetry-instrumentation-sqlite3: add semconv stability opt-in test coverage

4 participants