Documentation
¶
Overview ¶
Package tracermetadata parses the tracer-generated metadata
Index ¶
- func IsTracerMemfdPath(linkTarget string) bool
- func ShouldSkipServiceTag(tag string, ustService, ustEnv, ustVersion string) bool
- func ShouldSkipServiceTagKV(tagKey, tagValue, ustService, ustEnv, ustVersion string) bool
- type TracerMetadata
- func (z *TracerMetadata) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *TracerMetadata) EncodeMsg(en *msgp.Writer) (err error)
- func (t TracerMetadata) GetTags() []string
- func (z *TracerMetadata) MarshalMsg(b []byte) (o []byte, err error)
- func (z *TracerMetadata) Msgsize() (s int)
- func (t TracerMetadata) Tags() iter.Seq2[string, string]
- func (z *TracerMetadata) UnmarshalMsg(bts []byte) (o []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTracerMemfdPath ¶
IsTracerMemfdPath checks if the given readlink path is a tracer memfd file. The linkTarget should be the result of reading a symlink from /proc/PID/fd/.
func ShouldSkipServiceTag ¶
ShouldSkipServiceTag checks if a tracer service tag should be skipped if it matches the UST tags.
func ShouldSkipServiceTagKV ¶
ShouldSkipServiceTagKV checks if a tracer service tag key-value pair should be skipped if it matches the UST tags.
Types ¶
type TracerMetadata ¶
type TracerMetadata struct {
SchemaVersion uint8 `json:"schema_version"`
RuntimeID string `json:"runtime_id,omitempty"`
TracerLanguage string `json:"tracer_language"`
TracerVersion string `json:"tracer_version"`
Hostname string `json:"hostname"`
ServiceName string `json:"service_name,omitempty"`
ServiceEnv string `json:"service_env,omitempty"`
ServiceVersion string `json:"service_version,omitempty"`
ProcessTags string `json:"process_tags,omitempty"`
ContainerID string `json:"container_id,omitempty"`
LogsCollected bool `json:"logs_collected,omitempty"`
}
TracerMetadata as defined in https://github.com/DataDog/libdatadog/blob/0b59f64c4fc08105e5b73c5a0752ced3cf8f653e/datadog-library-config/src/tracer_metadata.rs#L7-L34
func GetTracerMetadata ¶
func GetTracerMetadata(pid int, procRoot string) (TracerMetadata, error)
GetTracerMetadata parses the tracer-generated metadata according to https://docs.google.com/document/d/1kcW6BLdYxXeTSUz31cBqoqfW1Jjs0IDljfKeUfIRQp4/
func GetTracerMetadataFromPath ¶
func GetTracerMetadataFromPath(fdPath string) (TracerMetadata, error)
GetTracerMetadataFromPath reads and parses tracer metadata from a known fd path. The fdPath should be the full path to the fd (e.g., /proc/1234/fd/5).
func (*TracerMetadata) DecodeMsg ¶
func (z *TracerMetadata) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*TracerMetadata) EncodeMsg ¶
func (z *TracerMetadata) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (TracerMetadata) GetTags ¶
func (t TracerMetadata) GetTags() []string
GetTags returns a list of tags from the tracer metadata
func (*TracerMetadata) MarshalMsg ¶
func (z *TracerMetadata) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*TracerMetadata) Msgsize ¶
func (z *TracerMetadata) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (TracerMetadata) Tags ¶
func (t TracerMetadata) Tags() iter.Seq2[string, string]
Tags returns a sequence of tags from the tracer metadata
func (*TracerMetadata) UnmarshalMsg ¶
func (z *TracerMetadata) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler