You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2023. It is now read-only.
The following standard tags would not be added to the span because they are not set in the code-snippet above:
peer.address
peer.ipv4
peer.ipv6
Enum values can be enforced via setter methods specific to each value. For instance, the .kind property value would have .isClient() and .isServer() methods for RPC scenarios.
The approaches described above are scenario based and make use of a specific subset of the standard span tags and log fields. The same approach can be used to provide general typed support for the standard tags and fields:
One benefit of the scenario approach is that certain expectations can be enforced, as determined by the spec: Modeling special circumstances. For instance, the following omits the span.kind tag and therefore can result in a warning or error:
// this would warn or errortags.makeRPC().peer.service('service-a').peer.hostname('le-hostname').peer.port(8080).setOnSpan(span);
This style is simpler and perhaps more approachable, but is more verbose and it would be more difficult to enforce required keys at compile time (to my understanding).
Lastly
The initial thinking is that the main semantic conventions can live in the core API and extensions can live in contrib.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Background
Currently, the semantic conventions for span tags and log fields are supported by way of constants (Go, Java, JavaScript).
Problem
setTag('error', 99)
Proposal / goals
Provide a typed API which supports:
Existing interfaces should not need to be changed.
Third party developers should be able to follow the same approach to promote consistency within library or application code.
Thoughts on design
One approach is to define the key-value pairs on a separate object which is then used to either log the fields or to set the span tags:
This would set the following span tags:
span.kind: "client"
peer.service: "service-a"
peer.hostname: "le-hostname"
peer.port: 8080
The following standard tags would not be added to the span because they are not set in the code-snippet above:
peer.address
peer.ipv4
peer.ipv6
Enum values can be enforced via setter methods specific to each value. For instance, the
.kind
property value would have.isClient()
and.isServer()
methods for RPC scenarios.Similarly, to add a log record to a span:
This would add a log record with the following fields:
event: "error"
error.kind: "..."
– determined by the constructor oferror
message: "..."
– determined byerror.message
stack: "..."
– determined byerror.stack
An alternate API to add a log record:
The approaches described above are scenario based and make use of a specific subset of the standard span tags and log fields. The same approach can be used to provide general typed support for the standard tags and fields:
This would set the following span tags:
component: "omg-layer"
span.kind: "client"
error: true
http.status_code: 404
One benefit of the scenario approach is that certain expectations can be enforced, as determined by the spec: Modeling special circumstances. For instance, the following omits the
span.kind
tag and therefore can result in a warning or error:An alternative style for the API:
This style is simpler and perhaps more approachable, but is more verbose and it would be more difficult to enforce required keys at compile time (to my understanding).
Lastly
The initial thinking is that the main semantic conventions can live in the core API and extensions can live in contrib.
The text was updated successfully, but these errors were encountered: