Documentation ¶
Overview ¶
Package usm provides functionality to detect the most appropriate service name for a process.
Index ¶
Constants ¶
const ( // The path to the Node service's package.json NodePackageJSONPath = iota // The SubdirFS instance package.json path is valid in. ServiceSubFS = iota )
DetectorContextMap keys enum
Variables ¶
This section is empty.
Functions ¶
func ReadlinkFS ¶
ReadlinkFS reads the symlink on the provided FS. There is no standard SymlinkFS interface yet https://github.com/golang/go/issues/49580.
Types ¶
type DetectionContext ¶
type DetectionContext struct {
// contains filtered or unexported fields
}
DetectionContext allows to detect ServiceMetadata.
func NewDetectionContext ¶
NewDetectionContext initializes DetectionContext.
type DetectorContextMap ¶
type DetectorContextMap map[int]interface{}
DetectorContextMap is a map for passing data between the different detectors of the service discovery (i.e between the service name detector and the instrumentation detector)
type ServiceMetadata ¶
type ServiceMetadata struct { Name string AdditionalNames []string DDService string DDServiceInjected bool }
ServiceMetadata holds information about a service.
func ExtractServiceMetadata ¶
func ExtractServiceMetadata(args []string, envs map[string]string, fs fs.SubFS, lang language.Language, contextMap DetectorContextMap) (metadata ServiceMetadata, success bool)
ExtractServiceMetadata attempts to detect ServiceMetadata from the given process.
func NewServiceMetadata ¶
func NewServiceMetadata(name string, additional ...string) ServiceMetadata
NewServiceMetadata initializes ServiceMetadata.
func (ServiceMetadata) GetServiceKey ¶
func (s ServiceMetadata) GetServiceKey() string
GetServiceKey returns the key for the service.
func (*ServiceMetadata) SetAdditionalNames ¶
func (s *ServiceMetadata) SetAdditionalNames(additional ...string)
SetAdditionalNames set additional names for the service
func (*ServiceMetadata) SetNames ¶
func (s *ServiceMetadata) SetNames(name string, additional ...string)
SetNames sets generated names for the service.
type SubDirFS ¶
SubDirFS is like the fs.FS implemented by os.DirFS, except that it allows absolute paths to be passed in the Open/Stat/etc, and attaches them to the root dir. It also implements SubFS, unlink the one implemented by os.DirFS.
func NewSubDirFS ¶
NewSubDirFS creates a new SubDirFS rooted at the specified path.