Skip to content

opentelemetry-instrumentation-mysqlclient: add semconv stability opt-in test coverage#4834

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

opentelemetry-instrumentation-mysqlclient: add semconv stability opt-in test coverage#4834
henry3260 wants to merge 2 commits into
open-telemetry:mainfrom
henry3260:mysqlclient-semconv-optin-tests

Conversation

@henry3260

Copy link
Copy Markdown
Contributor

Description

This adds two tests mirroring the merged mysql (#4810) / pymssql (#4592) pattern:

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

The connection mock exposes MySQLdb's connection attributes (db, host,
port, user) as mapped by _CONNECTION_ATTRIBUTES in the instrumentation.

Type of change

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

How Has This Been Tested?

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

Does This PR Require a Core Repo Change?

  • No.

Checklist:

…in test 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.
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.

1 participant