Documentation
¶
Index ¶
- func AreTagsSubsetOfOtherTags(tags, otherTags []string) bool
- func FilterByTags[P PayloadItem](payloads []P, tags []string) []P
- type Aggregator
- func (agg *Aggregator[P]) ContainsPayloadName(name string) bool
- func (agg *Aggregator[P]) ContainsPayloadNameAndTags(name string, tags []string) bool
- func (agg *Aggregator[P]) GetNames() []string
- func (agg *Aggregator[P]) GetPayloadsByName(name string) []P
- func (agg *Aggregator[P]) Reset()
- func (agg *Aggregator[P]) UnmarshallPayloads(payloads []api.Payload) error
- type CheckRun
- type CheckRunAggregator
- type Connections
- type ConnectionsAggregator
- type ContainerAggregator
- type ContainerImageAggregator
- type ContainerImagePayload
- type ContainerLifecycleAggregator
- type ContainerLifecyclePayload
- type ContainerPayload
- type DatadogMetricOriginMetadata
- type DatadogMetricType
- type DatadogSeriesMetricMetadata
- type Log
- type LogAggregator
- type MetricAggregator
- type MetricAggregatorV1
- type MetricSeries
- type MetricSeriesV1
- type MetricSeriesV1Header
- type PayloadItem
- type ProcessAggregator
- type ProcessDiscoveryAggregator
- type ProcessDiscoveryPayload
- type ProcessPayload
- type SBOMAggregator
- type SBOMPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreTagsSubsetOfOtherTags ¶
AreTagsSubsetOfOtherTags return true is all tags are in otherTags
func FilterByTags ¶
func FilterByTags[P PayloadItem](payloads []P, tags []string) []P
FilterByTags return the payloads that match all the tags
Types ¶
type Aggregator ¶
type Aggregator[P PayloadItem] struct { // contains filtered or unexported fields }
func (*Aggregator[P]) ContainsPayloadName ¶
func (agg *Aggregator[P]) ContainsPayloadName(name string) bool
ContainsPayloadName return true if name match one of the payloads
func (*Aggregator[P]) ContainsPayloadNameAndTags ¶
func (agg *Aggregator[P]) ContainsPayloadNameAndTags(name string, tags []string) bool
ContainsPayloadNameAndTags return true if the payload name exist and on of the payloads contains all the tags
func (*Aggregator[P]) GetNames ¶
func (agg *Aggregator[P]) GetNames() []string
GetNames return the names of the payloads
func (*Aggregator[P]) GetPayloadsByName ¶
func (agg *Aggregator[P]) GetPayloadsByName(name string) []P
GetPayloadsByName return the payloads for the resource name
func (*Aggregator[P]) UnmarshallPayloads ¶
func (agg *Aggregator[P]) UnmarshallPayloads(payloads []api.Payload) error
UnmarshallPayloads aggregate the payloads
type CheckRun ¶
type CheckRun struct { Check string `json:"check"` HostName string `json:"host_name"` Timestamp int `json:"timestamp"` Status int `json:"status"` Message string `json:"message"` Tags []string `json:"tags"` // contains filtered or unexported fields }
func ParseCheckRunPayload ¶
ParseCheckRunPayload return the parsed checkRun from payload
func (*CheckRun) GetCollectedTime ¶ added in v0.49.0
GetCollectedTime return the time when the payload has been collected by the fakeintake server
type CheckRunAggregator ¶
type CheckRunAggregator struct { Aggregator[*CheckRun] }
func NewCheckRunAggregator ¶
func NewCheckRunAggregator() CheckRunAggregator
type Connections ¶ added in v0.49.0
type Connections struct { agentmodel.CollectorConnections // contains filtered or unexported fields }
Connections type contain all payload from /api/v1/connections
func ParseConnections ¶ added in v0.49.0
func ParseConnections(payload api.Payload) (conns []*Connections, err error)
ParseConnections return the Connections from payload
func (*Connections) GetCollectedTime ¶ added in v0.49.0
func (c *Connections) GetCollectedTime() time.Time
GetCollectedTime return the time when the payload has been collected by the fakeintake server
func (*Connections) GetTags ¶ added in v0.49.0
func (c *Connections) GetTags() []string
GetTags return tags connection
type ConnectionsAggregator ¶ added in v0.49.0
type ConnectionsAggregator struct { Aggregator[*Connections] }
ConnectionsAggregator aggregate connections
func NewConnectionsAggregator ¶ added in v0.49.0
func NewConnectionsAggregator() ConnectionsAggregator
NewConnectionsAggregator create a new aggregator
func (*ConnectionsAggregator) ForeachConnection ¶ added in v0.50.0
func (ca *ConnectionsAggregator) ForeachConnection(callback func(c *agentmodel.Connection, cc *agentmodel.CollectorConnections, hostname string))
ForeachConnection will call the callback for each connection per hostname/netID and CollectorConnections payloads
type ContainerAggregator ¶ added in v0.50.0
type ContainerAggregator struct { Aggregator[*ContainerPayload] }
ContainerAggregator is an Aggregator for ContainerPayload
func NewContainerAggregator ¶ added in v0.50.0
func NewContainerAggregator() ContainerAggregator
NewContainerAggregator returns a new ContainerAggregator
type ContainerImageAggregator ¶ added in v0.51.0
type ContainerImageAggregator struct { Aggregator[*ContainerImagePayload] }
ContainerImageAggregator is an Aggregator for ContainerImagePayload
func NewContainerImageAggregator ¶ added in v0.51.0
func NewContainerImageAggregator() ContainerImageAggregator
NewContainerImageAggregator returns a new ContainerImageAggregator
type ContainerImagePayload ¶ added in v0.51.0
type ContainerImagePayload struct { *agentmodel.ContainerImage // contains filtered or unexported fields }
ContainerImagePayload is a payload type for the container image check
func ParseContainerImagePayload ¶ added in v0.51.0
func ParseContainerImagePayload(payload api.Payload) ([]*ContainerImagePayload, error)
ParseContainerImagePayload parses an api.Payload into a list of ContainerImagePayload
func (*ContainerImagePayload) GetCollectedTime ¶ added in v0.51.0
func (p *ContainerImagePayload) GetCollectedTime() time.Time
GetCollectedTime returns the time that the payload was received by the fake intake
func (*ContainerImagePayload) GetTags ¶ added in v0.51.0
func (p *ContainerImagePayload) GetTags() []string
GetTags return the tags from a payload
type ContainerLifecycleAggregator ¶ added in v0.51.0
type ContainerLifecycleAggregator struct { Aggregator[*ContainerLifecyclePayload] }
ContainerLifecycleAggregator is an Aggregator for ContainerLifecyclePayload
func NewContainerLifecycleAggregator ¶ added in v0.51.0
func NewContainerLifecycleAggregator() ContainerLifecycleAggregator
NewContainerLifecycleAggregator returns a new ContainerLifecycleAggregator
type ContainerLifecyclePayload ¶ added in v0.51.0
type ContainerLifecyclePayload struct { *agentmodel.Event // contains filtered or unexported fields }
ContainerLifecyclePayload is a payload type for the container lifecycle check
func ParseContainerLifecyclePayload ¶ added in v0.51.0
func ParseContainerLifecyclePayload(payload api.Payload) ([]*ContainerLifecyclePayload, error)
ParseContainerLifecyclePayload parses an api.Payload into a list of ContainerLifecyclePayload
func (*ContainerLifecyclePayload) GetCollectedTime ¶ added in v0.51.0
func (p *ContainerLifecyclePayload) GetCollectedTime() time.Time
GetCollectedTime returns the time that the payload was received by the fake intake
func (*ContainerLifecyclePayload) GetTags ¶ added in v0.51.0
func (p *ContainerLifecyclePayload) GetTags() []string
GetTags is not implemented for container lifecycle payloads
type ContainerPayload ¶ added in v0.50.0
type ContainerPayload struct { agentmodel.CollectorContainer // contains filtered or unexported fields }
ContainerPayload is a payload type for the container check
func ParseContainerPayload ¶ added in v0.50.0
func ParseContainerPayload(payload api.Payload) ([]*ContainerPayload, error)
ParseContainerPayload parses an api.Payload into a list of ContainerPayload
func (ContainerPayload) GetCollectedTime ¶ added in v0.50.0
func (p ContainerPayload) GetCollectedTime() time.Time
GetCollectedTime returns the time that the payload was received by the fake intake
func (ContainerPayload) GetTags ¶ added in v0.50.0
func (p ContainerPayload) GetTags() []string
GetTags is not implemented for container payloads
type DatadogMetricOriginMetadata ¶ added in v0.50.0
type DatadogMetricOriginMetadata struct { // OriginProduct Product uint32 `json:"product,omitempty"` // OriginCategory Category uint32 `json:"category,omitempty"` // OriginService Service uint32 `json:"service,omitempty"` }
DatadogMetricOriginMetadata informations
type DatadogMetricType ¶ added in v0.50.0
type DatadogMetricType string
DatadogMetricType represent different metrics types
const ( // Gauge DatadogMetricType Gauge DatadogMetricType = "gauge" // Count DatadogMetricType Count DatadogMetricType = "count" // Rate DatadogMetricType Rate DatadogMetricType = "rate" )
type DatadogSeriesMetricMetadata ¶ added in v0.50.0
type DatadogSeriesMetricMetadata struct {
Origin DatadogMetricOriginMetadata `json:"origin,omitempty"`
}
DatadogSeriesMetricMetadata contains DatadogMetricMetadata
type Log ¶
type Log struct { Message string `json:"message"` Status string `json:"status"` Timestamp int `json:"timestamp"` HostName string `json:"hostname"` Service string `json:"service"` Source string `json:"ddsource"` Tags tags `json:"ddtags"` // contains filtered or unexported fields }
func ParseLogPayload ¶
ParseLogPayload return the parsed logs from payload
func (*Log) GetCollectedTime ¶ added in v0.49.0
GetCollectedTime return the time when the payload has been collected by the fakeintake server
type LogAggregator ¶
type LogAggregator struct { Aggregator[*Log] }
func NewLogAggregator ¶
func NewLogAggregator() LogAggregator
type MetricAggregator ¶
type MetricAggregator struct { Aggregator[*MetricSeries] }
func NewMetricAggregator ¶
func NewMetricAggregator() MetricAggregator
type MetricAggregatorV1 ¶ added in v0.50.0
type MetricAggregatorV1 struct { Aggregator[*MetricSeriesV1] }
MetricAggregatorV1 Aggregator
type MetricSeries ¶
type MetricSeries struct { // embed proto Metric Series struct metricspb.MetricPayload_MetricSeries // contains filtered or unexported fields }
func ParseMetricSeries ¶
func ParseMetricSeries(payload api.Payload) (metrics []*MetricSeries, err error)
ParseMetricSeries return the parsed metrics from payload
func (*MetricSeries) GetCollectedTime ¶ added in v0.49.0
func (mp *MetricSeries) GetCollectedTime() time.Time
GetCollectedTime return the time when the payload has been collected by the fakeintake server
func (*MetricSeries) GetTags ¶
func (mp *MetricSeries) GetTags() []string
GetTags return the tags from a payload
type MetricSeriesV1 ¶ added in v0.50.0
type MetricSeriesV1 struct { Metric string `json:"metric"` Type DatadogMetricType `json:"type"` Interval uint32 `json:"interval,omitempty"` Points [][2]interface{} `json:"points"` Tags []string `json:"tags,omitempty"` Host string `json:"host,omitempty"` SourceTypeName string `json:"source_type_name,omitempty"` Device string `json:"device,omitempty"` Metadata DatadogSeriesMetricMetadata `json:"metadata,omitempty"` // contains filtered or unexported fields }
MetricSeriesV1 contains all information of a metric in V1 Following API specifications V1 https://docs.datadoghq.com/api/latest/metrics/#submit-metrics Agent submit implementation is https://github.com/DataDog/datadog-agent/blob/af712ce616266987e35e621f0c8f78cbc81716f9/pkg/metrics/series.go#L49-L63
func ParseV1MetricSeries ¶ added in v0.50.0
func ParseV1MetricSeries(payload api.Payload) (metrics []*MetricSeriesV1, err error)
ParseV1MetricSeries return the parsed metrics from payload
func (*MetricSeriesV1) GetCollectedTime ¶ added in v0.50.0
func (mp *MetricSeriesV1) GetCollectedTime() time.Time
GetCollectedTime return the time when the payload has been collected by the fakeintake server
func (*MetricSeriesV1) GetTags ¶ added in v0.50.0
func (mp *MetricSeriesV1) GetTags() []string
GetTags return the tags from a payload
type MetricSeriesV1Header ¶ added in v0.50.0
type MetricSeriesV1Header struct {
Series []*MetricSeriesV1 `json:"series"`
}
MetricSeriesV1Header contains a MetricSeriesV1
type PayloadItem ¶
type ProcessAggregator ¶ added in v0.50.0
type ProcessAggregator struct { Aggregator[*ProcessPayload] }
ProcessAggregator is an Aggregator for ProcessPayload
func NewProcessAggregator ¶ added in v0.50.0
func NewProcessAggregator() ProcessAggregator
NewProcessAggregator returns a new ProcessAggregator
type ProcessDiscoveryAggregator ¶ added in v0.50.0
type ProcessDiscoveryAggregator struct { Aggregator[*ProcessDiscoveryPayload] }
ProcessDiscoveryAggregator is an Aggregator for ProcessDiscoveryPayload
func NewProcessDiscoveryAggregator ¶ added in v0.50.0
func NewProcessDiscoveryAggregator() ProcessDiscoveryAggregator
NewProcessDiscoveryAggregator returns a new ProcessDiscoveryAggregator
type ProcessDiscoveryPayload ¶ added in v0.50.0
type ProcessDiscoveryPayload struct { agentmodel.CollectorProcDiscovery // contains filtered or unexported fields }
ProcessDiscoveryPayload is a payload type for the process_discovery check
func ParseProcessDiscoveryPayload ¶ added in v0.50.0
func ParseProcessDiscoveryPayload(payload api.Payload) ([]*ProcessDiscoveryPayload, error)
ParseProcessDiscoveryPayload parses an api.Payload into a list of ProcessDiscoveryPayload
func (ProcessDiscoveryPayload) GetCollectedTime ¶ added in v0.50.0
func (p ProcessDiscoveryPayload) GetCollectedTime() time.Time
GetCollectedTime returns the time that the payload was received by the fake intake
func (ProcessDiscoveryPayload) GetTags ¶ added in v0.50.0
func (p ProcessDiscoveryPayload) GetTags() []string
GetTags is not implemented for process_discovery payloads
type ProcessPayload ¶ added in v0.50.0
type ProcessPayload struct { agentmodel.CollectorProc // contains filtered or unexported fields }
ProcessPayload is a payload type for the process check
func ParseProcessPayload ¶ added in v0.50.0
func ParseProcessPayload(payload api.Payload) ([]*ProcessPayload, error)
ParseProcessPayload parses an api.Payload into a list of ProcessPayload
func (ProcessPayload) GetCollectedTime ¶ added in v0.50.0
func (p ProcessPayload) GetCollectedTime() time.Time
GetCollectedTime returns the time that the payload was received by the fake intake
func (ProcessPayload) GetTags ¶ added in v0.50.0
func (p ProcessPayload) GetTags() []string
GetTags is not implemented for process payloads
type SBOMAggregator ¶ added in v0.51.0
type SBOMAggregator struct { Aggregator[*SBOMPayload] }
SBOMAggregator is an Aggregator for SbomPayload
func NewSBOMAggregator ¶ added in v0.51.0
func NewSBOMAggregator() SBOMAggregator
NewSBOMAggregator returns a new SbomAggregator
type SBOMPayload ¶ added in v0.51.0
type SBOMPayload struct { *agentmodel.SBOMEntity // contains filtered or unexported fields }
SBOMPayload is a payload type for the sbom check
func ParseSbomPayload ¶ added in v0.51.0
func ParseSbomPayload(payload api.Payload) ([]*SBOMPayload, error)
ParseSbomPayload parses an api.Payload into a list of SbomPayload
func (*SBOMPayload) GetCollectedTime ¶ added in v0.51.0
func (p *SBOMPayload) GetCollectedTime() time.Time
GetCollectedTime returns the time that the payload was received by the fake intake
func (*SBOMPayload) GetTags ¶ added in v0.51.0
func (p *SBOMPayload) GetTags() []string
GetTags return the tags from a payload