parser

package
v0.0.0-...-e70f483 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package parser parses service metadata

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChooseServiceNameFromEnvs

func ChooseServiceNameFromEnvs(envs []string) (string, bool)

ChooseServiceNameFromEnvs extracts the service name from usual tracer env variables (DD_SERVICE, DD_TAGS). returns the service name, true if found, otherwise "", false

Types

type DockerProxy

type DockerProxy struct {
	// contains filtered or unexported fields
}

DockerProxy keeps track of every docker-proxy instance and filters network traffic going through them

func NewDockerProxy

func NewDockerProxy() *DockerProxy

NewDockerProxy instantiates a new filter loaded with docker-proxy instance information

func (*DockerProxy) Extract

func (d *DockerProxy) Extract(processes map[int32]*procutil.Process)

Extract the process metadata from the processes

func (*DockerProxy) Filter

func (d *DockerProxy) Filter(payload *model.Connections)

Filter all connections that have a docker-proxy at one end

type ProcessNameExtractor

type ProcessNameExtractor struct {
	// contains filtered or unexported fields
}

ProcessNameExtractor extracts process names from processes for use in network connection enrichment.

func NewProcessNameExtractor

func NewProcessNameExtractor() *ProcessNameExtractor

NewProcessNameExtractor creates a new ProcessNameExtractor.

func (*ProcessNameExtractor) Extract

func (e *ProcessNameExtractor) Extract(processes map[int32]*procutil.Process)

Extract populates the internal map with the executable name for each process.

func (*ProcessNameExtractor) ExtractSingle

func (e *ProcessNameExtractor) ExtractSingle(proc *procutil.Process)

ExtractSingle extracts process name from a single process

func (*ProcessNameExtractor) GetProcessName

func (e *ProcessNameExtractor) GetProcessName(pid int32) string

GetProcessName returns the process name for the given pid, or an empty string if the process is not known.

func (*ProcessNameExtractor) Remove

func (e *ProcessNameExtractor) Remove(pid int32)

Remove deletes process name for the provided PID

type ServiceExtractor

type ServiceExtractor struct {
	// contains filtered or unexported fields
}

ServiceExtractor infers a service tag by extracting it from a process

func NewServiceExtractor

func NewServiceExtractor(enabled, useWindowsServiceName, useImprovedAlgorithm bool) *ServiceExtractor

NewServiceExtractor instantiates a new service discovery extractor

func (*ServiceExtractor) Extract

func (d *ServiceExtractor) Extract(processes map[int32]*procutil.Process)

Extract the process metadata from the processes

func (*ServiceExtractor) ExtractSingle

func (d *ServiceExtractor) ExtractSingle(proc *procutil.Process)

ExtractSingle extracts process metadata from a single process

func (*ServiceExtractor) GetServiceContext

func (d *ServiceExtractor) GetServiceContext(pid int32) []string

GetServiceContext returns the service context for the PID

func (*ServiceExtractor) Remove

func (d *ServiceExtractor) Remove(pid int32)

Remove deletes process metadata for the provided PID

type WindowsServiceInfo

type WindowsServiceInfo struct {
	ServiceName []string
	DisplayName []string
}

WindowsServiceInfo represents service data that is parsed from the SCM. On non-Windows platforms these fields should always be empty. On Windows, multiple services can be binpacked into a single `svchost.exe`, which is why `ServiceName` and `DisplayName` are slices.

Directories

Path Synopsis
Package javaparser contains functions to autodetect service name for java applications
Package javaparser contains functions to autodetect service name for java applications
Package nodejsparser wraps functions to guess service name for node applications
Package nodejsparser wraps functions to guess service name for node applications

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL