mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-01-01 22:09:57 +02:00
add code attributes to semconv package (#1558)
* add code attributes to semconv package * update changelog * update comment for code semconv attributes Adds a full-stop at the end of the comment. Co-authored-by: Anthony Mirabella <a9@aneurysm9.com> Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
parent
78c06cef35
commit
b94cd4b249
@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||
|
||||
- Added `resource.Default()` for use with meter and tracer providers. (#1507)
|
||||
- Added `Keys()` method to `propagation.TextMapCarrier` and `propagation.HeaderCarrier` to adapt `http.Header` to this interface. (#1544)
|
||||
- Added `code` attributes to `go.opentelemetry.io/otel/semconv` package. (#1558)
|
||||
|
||||
### Removed
|
||||
|
||||
|
@ -353,3 +353,24 @@ var (
|
||||
FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
|
||||
FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
|
||||
)
|
||||
|
||||
// Semantic conventions for source code attributes.
|
||||
const (
|
||||
// The method or function name, or equivalent (usually rightmost part of
|
||||
// the code unit's name).
|
||||
CodeFunctionKey = attribute.Key("code.function")
|
||||
|
||||
// The "namespace" within which `code.function` is defined. Usually the
|
||||
// qualified class or module name, such that
|
||||
// `code.namespace` + some separator + `code.function` form a unique
|
||||
// identifier for the code unit.
|
||||
CodeNamespaceKey = attribute.Key("code.namespace")
|
||||
|
||||
// The source code file name that identifies the code unit as uniquely as
|
||||
// possible (preferably an absolute file path).
|
||||
CodeFilepathKey = attribute.Key("code.filepath")
|
||||
|
||||
// The line number in `code.filepath` best representing the operation.
|
||||
// It SHOULD point within the code unit named in `code.function`.
|
||||
CodeLineNumberKey = attribute.Key("code.lineno")
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user