Documentation
¶
Overview ¶
Package normalize contains functions for normalizing trace data.
Index ¶
- Constants
- Variables
- func NormalizeName(name string) (string, error)
- func NormalizePeerService(svc string) (string, error)
- func NormalizeService(svc string, lang string) (string, error)
- func NormalizeTag(v string) string
- func NormalizeTagValue(v string) string
- func TruncateUTF8(s string, limit int) string
Constants ¶
const ( // DefaultSpanName is the default name we assign a span if it's missing and we have no reasonable fallback DefaultSpanName = "unnamed_operation" // DefaultServiceName is the default name we assign a service if it's missing and we have no reasonable fallback DefaultServiceName = "unnamed-service" )
const ( // MaxNameLen the maximum length a name can have MaxNameLen = 100 // MaxServiceLen the maximum length a service can have MaxServiceLen = 100 // MaxResourceLen the maximum length a resource can have MaxResourceLen = 5000 )
Variables ¶
Functions ¶
func NormalizeName ¶
NormalizeName normalizes a span name and returns an error describing the reason (if any) why the name was modified.
func NormalizePeerService ¶
NormalizePeerService normalizes a span's peer.service and returns an error describing the reason (if any) why the name was modified.
func NormalizeService ¶
NormalizeService normalizes a span service and returns an error describing the reason (if any) why the name was modified.
func NormalizeTag ¶
NormalizeTag applies some normalization to ensure the full tag_key:tag_value string matches the backend requirements.
func NormalizeTagValue ¶
NormalizeTagValue applies some normalization to ensure the tag value matches the backend requirements. It should be used for cases where we have just the tag_value as the input (instead of tag_key:tag_value).
func TruncateUTF8 ¶
TruncateUTF8 truncates the given string to make sure it uses less than limit bytes. If the last character is an utf8 character that would be splitten, it removes it entirely to make sure the resulting string is not broken.
Types ¶
This section is empty.