Add diagnostics-semconv to standardize some attributes and headers #579
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.
What is the purpose of this pull request?
This pull request introduces a major refactor to centralize HTTP header constants into a new
HeaderKeys
object within thesrc/constants.ts
file. This change improves maintainability and reduces redundancy by replacing individual header constants with a single structured object. Additionally, it introduces a newAttributeKeys
object for semantic attributes and updates the logger to use these attributes.Dependency Additions
@vtex/diagnostics-semconv
, to support semantic conventions for diagnostics and tracing attributes.Logger Enhancements
Logger
class to use the newAttributeKeys
object for semantic attributes, such asVTEX_OPERATION_ID
andVTEX_ACCOUNT_NAME
, instead of plain object properties. This ensures better alignment with the diagnostics library.Cleanup and Refactoring
HeaderKeys
object, further simplifying the codebase.What problem is this solving?
Introduces
@vtex/diagnostics-semconv
library to support VTEX semantic conventions, in a reduced scope with respect to telemetry signals and emphasizing the context of logs. Future updates will include updates to the instrumentation using the diagnostics library, as well as the use of the semantic conventions of these signals.How should this be manually tested?
The changes do not include new features or major behavior changes, so to test the changes simply build from this branch.
Screenshots or example usage
Types of changes