-
Notifications
You must be signed in to change notification settings - Fork 580
feat(instrumentation-knex): Use newer semantic conventions #2671
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
Merged
trentm
merged 13 commits into
open-telemetry:main
from
deejay1:knex-semantic-conventions
May 21, 2025
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f6f9e4c
feat(instrumentation-knex): Use newer semantic conventions
deejay1 aef24d6
feat(instrumentation-knex): Use getStringListFromEnv from core
deejay1 53585cb
Merge branch 'main' into knex-semantic-conventions
deejay1 ff6e0bf
Apply suggestions from code review
deejay1 b40ba4d
feat(instrumentation-knex): Implement fixes after review
deejay1 88fb85c
Merge branch 'main' into knex-semantic-conventions-
deejay1 8a78e1f
Merge branch 'main' into knex-semantic-conventions-
deejay1 f48f01e
feat(instrumentation-knex): Use semconvStabilityFromStr
deejay1 2a85075
feat(instrumentation-knex): Drop core from dependencies
deejay1 a8d4c05
feat(instrumentation-knex): Update instrumentation version
deejay1 4810f90
feat(instrumentation-knex): Fix semconv versions
deejay1 5499bd9
Merge branch 'main' into knex-semantic-conventions-
deejay1 4e43e12
feat(instrumentation-knex): Fix import
deejay1 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
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
23 changes: 23 additions & 0 deletions
23
plugins/node/opentelemetry-instrumentation-knex/src/internal-types.ts
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export const enum SemconvStability { | ||
/** Emit only stable semantic conventions */ | ||
STABLE = 0x1, | ||
/** Emit only old semantic conventions*/ | ||
OLD = 0x2, | ||
/** Emit both stable and old semantic conventions*/ | ||
DUPLICATE = 0x1 | 0x2, | ||
} |
30 changes: 30 additions & 0 deletions
30
plugins/node/opentelemetry-instrumentation-knex/src/semconv.ts
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
export const ATTR_DB_NAMESPACE = 'db.namespace'; | ||
export const ATTR_DB_OPERATION_NAME = 'db.operation.name'; | ||
export const ATTR_DB_SYSTEM_NAME = 'db.system.name'; | ||
export const ATTR_DB_COLLECTION_NAME = 'db.collection.name'; | ||
export const ATTR_DB_USER = 'db.user'; | ||
export const ATTR_DB_QUERY_TEXT = 'db.query.text'; | ||
/** | ||
* Enum value "sqlite" for attribute {@link ATTR_DB_SYSTEM_NAME}. | ||
*/ | ||
export const DB_SYSTEM_NAME_VALUE_SQLITE = 'sqlite' as const; | ||
/** | ||
* Enum value "postgresql" for attribute {@link ATTR_DB_SYSTEM_NAME}. | ||
*/ | ||
export const DB_SYSTEM_NAME_VALUE_POSTGRESQL = 'postgresql' as const; |
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
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.
General note on semconv docs in instrumentation READMEs. Jamie and I have been recently working through some
OTEL_SEMCONV_STABILITY_OPT_IN
support for http-related instrumentation. If you like there is some boilerplate here that you could copy:https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-http/README.md?plain=1#L73
For example, it merges the attributes for "old" and "stable" into a single table.
However, what you have here is fine, so no need to adjust.
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.
I'll take another look at it tomorrow, as I'm somehow not satisfied with the current fixed version, yet I can't tell what bothers me there.