Skip to content

opentelemetry-instrumentation-pymemcache: add semconv stability migration support#4739

Open
SurbhiD404 wants to merge 7 commits into
open-telemetry:mainfrom
SurbhiD404:semconv-migration-pymemcache
Open

opentelemetry-instrumentation-pymemcache: add semconv stability migration support#4739
SurbhiD404 wants to merge 7 commits into
open-telemetry:mainfrom
SurbhiD404:semconv-migration-pymemcache

Conversation

@SurbhiD404

@SurbhiD404 SurbhiD404 commented Jun 25, 2026

Copy link
Copy Markdown

Description

Implements semantic convention stability migration support for the pymemcache instrumentation, as tracked in #2453.

Previously, PymemcacheInstrumentor emitted legacy (incubating) database semantic convention attributes unconditionally. This change adds opt-in support for the new stable database semantic convention attributes, controlled by the OTEL_SEMCONV_STABILITY_OPT_IN environment variable.

Attribute mapping

Old (default) New (database mode)
db.system db.system.name
db.statement db.query.text
net.peer.name server.address
net.peer.port server.port
net.transport (no stable equivalent, omitted in new mode)

Fixes #4715

Part of #2453

Type of change

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

How Has This Been Tested?

Three unit tests were added covering all three semconv modes:

  • Default (no opt-in): verifies legacy attributes are present and stable attributes are absent.
  • OTEL_SEMCONV_STABILITY_OPT_IN=database: verifies stable attributes are present and legacy attributes are absent.
  • OTEL_SEMCONV_STABILITY_OPT_IN=database/dup: verifies both legacy and stable attributes are emitted simultaneously.

To reproduce:

cd instrumentation/opentelemetry-instrumentation-pymemcache
python -m pytest tests/test_pymemcache.py -v

Result:

  • 38 tests passed

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 June 25, 2026 09:07

@xrmx xrmx left a comment

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.

Same comment of the cassandra PR about leveraging _semconv _set_db_* helpers plus _set_net_* and _set_http_* ones as well.

Please does not open more than one PR at a time, wait to get approval from one so you can apply what you learned in the process.

@github-project-automation github-project-automation Bot moved this to Reviewed PRs that need fixes in Python PR digest Jun 26, 2026
@SurbhiD404 SurbhiD404 force-pushed the semconv-migration-pymemcache branch 3 times, most recently from f095c62 to 4c7f584 Compare July 1, 2026 05:13
Comment thread .changelog/4739.added Outdated
@SurbhiD404 SurbhiD404 force-pushed the semconv-migration-pymemcache branch from 0d40de7 to 6bb1073 Compare July 2, 2026 07:18
@github-project-automation github-project-automation Bot moved this from Reviewed PRs that need fixes to Approved PRs in Python PR digest Jul 3, 2026
SurbhiD404 and others added 7 commits July 3, 2026 15:49
…tion support

Signed-off-by: Surbhi Dharvan <dharvansurbhi@gmail.com>
Signed-off-by: Surbhi Dharvan <dharvansurbhi@gmail.com>
Signed-off-by: Surbhi Dharvan <dharvansurbhi@gmail.com>
Signed-off-by: Surbhi Dharvan <dharvansurbhi@gmail.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
…comment

Signed-off-by: Surbhi Dharvan <dharvansurbhi@gmail.com>
Signed-off-by: Surbhi Dharvan <dharvansurbhi@gmail.com>
@SurbhiD404 SurbhiD404 force-pushed the semconv-migration-pymemcache branch from 18e704f to c915484 Compare July 3, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

opentelemetry-instrumentation-pymemcache: semantic convention stability migration

3 participants