Skip to content

Pymysql semconv optin tests#4835

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

Pymysql semconv optin tests#4835
henry3260 wants to merge 2 commits into
open-telemetry:mainfrom
henry3260:pymysql-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:

  • 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 PyMySQL'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-pymysql — 17 passed (15 existing + 2 new)
  • tox -e lint-instrumentation-pymysql — 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.
@henry3260
henry3260 requested a review from a team as a code owner July 18, 2026 15:18
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