-
Notifications
You must be signed in to change notification settings - Fork 612
feat(instrumentation-memcached): support net.* and db.* semconv migra… #3169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JamieDanielson
wants to merge
5
commits into
open-telemetry:main
Choose a base branch
from
JamieDanielson:jamie.semconv-db-memcached
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+228
−42
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
68d8857
feat(instrumentation-memcached): support net.* and db.* semconv migra…
JamieDanielson f9ce510
oops need to commit utils
JamieDanielson 9743a7a
rename misleading var in test
JamieDanielson e12e8da
Merge branch 'main' into jamie.semconv-db-memcached
maryliag f3badc9
Merge branch 'main' into jamie.semconv-db-memcached
maryliag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,23 +44,32 @@ registerInstrumentations({ | |
|
||
### Configuration Options | ||
|
||
| Option | Type | Example | Description | | ||
| ------- | ---- | ------- | ----------- | | ||
| Option | Type | Example | Description | | ||
| --------------------------- | --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- | | ||
| `enhancedDatabaseReporting` | `boolean` | `false` | Include full command statement in the span - **leaks potentially sensitive information to your spans**. Defaults to `false`. | | ||
|
||
## Semantic Conventions | ||
|
||
This package uses `@opentelemetry/semantic-conventions` version `1.22+`, which implements Semantic Convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md) | ||
This instrumentation implements Semantic Conventions (semconv) v1.7.0. Since then, networking (in semconv v1.23.1) and database (in semconv v1.33.0) semantic conventions were stabilized. As of `@opentelemetry/[email protected]` support has been added for migrating to the stable semantic conventions using the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable as follows: | ||
|
||
1. Upgrade to the latest version of this instrumentation package. | ||
2. Set `OTEL_SEMCONV_STABILITY_OPT_IN=http/dup,database/dup` to emit both old and stable semantic conventions. (The `http` token is used to control the `net.*` attributes, the `database` token to control to `db.*` attributes.) | ||
3. Modify alerts, dashboards, metrics, and other processes in your Observability system to use the stable semantic conventions. | ||
4. Set `OTEL_SEMCONV_STABILITY_OPT_IN=http,database` to emit only the stable semantic conventions. | ||
|
||
By default, if `OTEL_SEMCONV_STABILITY_OPT_IN` includes neither of the above tokens, the old v1.7.0 semconv is used. | ||
The intent is to provide an approximate 6 month time window for users of this instrumentation to migrate to the new database and networking semconv, after which a new minor version will use the new semconv by default and drop support for the old semconv. | ||
See [the HTTP migration guide](https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/) and the [database migration guide](https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/) for details. | ||
|
||
Attributes collected: | ||
|
||
| Attribute | Short Description | | ||
|-----------------|-----------------------------------------------------------------------------| | ||
| `db.operation` | The name of the operation being executed. | | ||
| `db.statement` | The database statement being executed. | | ||
| `db.system` | An identifier for the database management system (DBMS) product being used. | | ||
| `net.peer.name` | Remote hostname or similar. | | ||
| `net.peer.port` | Remote port number. | | ||
| Old semconv | Stable semconv | Description | | ||
| --------------- | ------------------- | --------------------------------------------------------------------------------------- | | ||
| `db.system` | `db.system.name` | 'memcached' | | ||
| `db.operation` | `db.operation.name` | The name of the operation being executed. | | ||
| `db.statement` | `db.query.text` | The database statement being executed (only if `enhancedDatabaseReporting` is enabled). | | ||
| `net.peer.name` | `server.address` | Remote hostname or similar. | | ||
| `net.peer.port` | `server.port` | Remote port number. | | ||
|
||
## Useful links | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use
DB_SYSTEM_NAME_VALUE_MEMCACHED
for this oneThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started to do that but realized
DB_SYSTEM_NAME_VALUE_MEMCACHED
is still experimental 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it would mean adding a src/semconv.ts wiht a local copy of that var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see what you mean. Meh, I think it still counts as the right thing to do for the "stable" semconv.
DB_SYSTEM_VALUE_MEMCACHED
is also "Stability: Development" and arguably is deprecated because it is an enum fordb.system
which is deprecated: https://github.com/open-telemetry/semantic-conventions/blob/41df6e41371948bb924cec6fe4468f0a68431852/model/database/deprecated/registry-deprecated.yaml#L370-L523