Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@
/comp/trace-telemetry @DataDog/agent-runtimes
/comp/updater/daemonchecker @DataDog/fleet
/comp/updater/ssistatus @DataDog/fleet
/comp/anomalydetection/hfrunner @DataDog/q-branch
/comp/anomalydetection/logssource @DataDog/q-branch
/comp/anomalydetection/observer @DataDog/q-branch
/comp/anomalydetection/recorder @DataDog/q-branch
Expand Down
3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ exports_files(glob(
# gazelle:exclude comp/anomalydetection/observer/def
# gazelle:exclude comp/anomalydetection/observer/fx
# gazelle:exclude comp/anomalydetection/observer/impl
# gazelle:exclude comp/anomalydetection/hfrunner/def
# gazelle:exclude comp/anomalydetection/hfrunner/fx
# gazelle:exclude comp/anomalydetection/hfrunner/impl
# gazelle:exclude comp/anomalydetection/logssource/fx
# gazelle:exclude comp/anomalydetection/logssource/impl
# gazelle:exclude comp/anomalydetection/recorder/def
Expand Down
2 changes: 2 additions & 0 deletions cmd/agent/subcommands/run/command_observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package run
import (
"go.uber.org/fx"

hfrunnerfx "github.com/DataDog/datadog-agent/comp/anomalydetection/hfrunner/fx"
logssourcefx "github.com/DataDog/datadog-agent/comp/anomalydetection/logssource/fx"
observerfx "github.com/DataDog/datadog-agent/comp/anomalydetection/observer/fx"
recorderfx "github.com/DataDog/datadog-agent/comp/anomalydetection/recorder/fx-noop"
Expand All @@ -23,6 +24,7 @@ import (
func getObserverOptions() fx.Option {
return fx.Options(
observerfx.Module(),
hfrunnerfx.Module(),
logssourcefx.Module(),
recorderfx.Module(),
)
Expand Down
7 changes: 7 additions & 0 deletions comp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,13 @@ Package telemetry provides the installer telemetry component.

Package updater is the updater component.

### [comp/anomalydetection/hfrunner](https://pkg.go.dev/github.com/DataDog/datadog-agent/comp/anomalydetection/hfrunner)

*Datadog Team*: q-branch

Package hfrunner provides a component that runs system and container checks at
1-second intervals and routes their output directly into the observer pipeline.

### [comp/anomalydetection/logssource](https://pkg.go.dev/github.com/DataDog/datadog-agent/comp/anomalydetection/logssource)

*Datadog Team*: q-branch
Expand Down
40 changes: 40 additions & 0 deletions comp/anomalydetection/hfrunner/def/component.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

// Package hfrunner provides a component that runs system and container checks at
// 1-second intervals and routes their output directly into the observer pipeline.
package hfrunner

// team: q-branch

import (
observerdef "github.com/DataDog/datadog-agent/comp/anomalydetection/observer/def"
"github.com/DataDog/datadog-agent/pkg/metrics"
)

const (
// HFSource is the observer handle source name for HF system check metrics.
// Using a distinct name from "all-metrics" lets the observer suppress the
// lower-frequency 15s versions of these metrics when HF mode is active.
HFSource = "system-checks-hf"

// HFContainerSource is the observer handle source name for HF container metrics.
HFContainerSource = "container-checks-hf"
)

// Component is the high-frequency check runner component.
type Component interface {
// StartSystem starts the HF system check runner using the given handle.
// systemHandle must be obtained from observer.GetHandle(HFSource).
// Returns the MetricSource values to suppress from "all-metrics", or nil if
// the runner was not started (disabled or unavailable on this platform).
StartSystem(systemHandle observerdef.Handle) map[metrics.MetricSource]struct{}

// StartContainer starts the HF container check runner using the given handle.
// containerHandle must be obtained from observer.GetHandle(HFContainerSource).
// Returns the MetricSource values to suppress from "all-metrics", or nil if
// not enabled or container deps are unavailable.
StartContainer(containerHandle observerdef.Handle) map[metrics.MetricSource]struct{}
}
29 changes: 29 additions & 0 deletions comp/anomalydetection/hfrunner/fx/fx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

// Package fx defines the fx options for the hfrunner component.
package fx

import (
hfrunnerdef "github.com/DataDog/datadog-agent/comp/anomalydetection/hfrunner/def"
hfrunnerimpl "github.com/DataDog/datadog-agent/comp/anomalydetection/hfrunner/impl"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"github.com/DataDog/datadog-agent/pkg/util/option"
"go.uber.org/fx"
)

// Module defines the fx options for this component.
func Module() fxutil.Module {
opts := []fx.Option{
fxutil.ProvideComponentConstructor(hfrunnerimpl.NewComponent),
fx.Provide(func(c hfrunnerdef.Component) option.Option[hfrunnerdef.Component] {
return option.New(c)
}),
}
return fxutil.Module{
Option: fx.Module("comp/anomalydetection/hfrunner", opts...),
Options: opts,
}
}
Loading
Loading