1
0
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:
Hussein Al Abry 2021-02-23 01:42:52 +04:00 committed by GitHub
parent 78c06cef35
commit b94cd4b249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -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

View File

@ -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")
)