Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SVLS-3102] Send logs and metrics from the Lambda Extension to Vector/OPW #20640

Merged
merged 4 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 2 additions & 3 deletions comp/forwarder/defaultforwarder/sync_forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/DataDog/datadog-agent/comp/core/log"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder/endpoints"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder/transaction"
"github.com/DataDog/datadog-agent/pkg/config/resolver"
utilhttp "github.com/DataDog/datadog-agent/pkg/util/http"
)

Expand All @@ -28,11 +27,11 @@ type SyncForwarder struct {
}

// NewSyncForwarder returns a new synchronous forwarder.
func NewSyncForwarder(config config.Component, log log.Component, domainResolvers map[string]resolver.DomainResolver, timeout time.Duration) *SyncForwarder {
func NewSyncForwarder(config config.Component, log log.Component, keysPerDomain map[string][]string, timeout time.Duration) *SyncForwarder {
return &SyncForwarder{
config: config,
log: log,
defaultForwarder: NewDefaultForwarder(config, log, NewOptionsWithResolvers(config, log, domainResolvers)),
defaultForwarder: NewDefaultForwarder(config, log, NewOptions(config, log, keysPerDomain)),
client: &http.Client{
Timeout: timeout,
Transport: utilhttp.CreateHTTPTransport(),
Expand Down
2 changes: 1 addition & 1 deletion comp/logs/agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func BuildEndpointsWithConfig(coreConfig pkgConfig.Reader, logsConfig *LogsConfi

// BuildServerlessEndpoints returns the endpoints to send logs for the Serverless agent.
func BuildServerlessEndpoints(coreConfig pkgConfig.Reader, intakeTrackType IntakeTrackType, intakeProtocol IntakeProtocol) (*Endpoints, error) {
return BuildHTTPEndpointsWithConfig(coreConfig, defaultLogsConfigKeys(coreConfig), serverlessHTTPEndpointPrefix, intakeTrackType, intakeProtocol, ServerlessIntakeOrigin)
return BuildHTTPEndpointsWithConfig(coreConfig, defaultLogsConfigKeysWithVectorOverride(coreConfig), serverlessHTTPEndpointPrefix, intakeTrackType, intakeProtocol, ServerlessIntakeOrigin)
}

// ExpectedTagsDuration returns a duration of the time expected tags will be submitted for.
Expand Down
5 changes: 2 additions & 3 deletions pkg/aggregator/demultiplexer_serverless.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
forwarder "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
"github.com/DataDog/datadog-agent/pkg/aggregator/internal/tags"
"github.com/DataDog/datadog-agent/pkg/config"
"github.com/DataDog/datadog-agent/pkg/config/resolver"
"github.com/DataDog/datadog-agent/pkg/metrics"
"github.com/DataDog/datadog-agent/pkg/serializer"
)
Expand All @@ -37,10 +36,10 @@ type ServerlessDemultiplexer struct {
}

// InitAndStartServerlessDemultiplexer creates and starts new Demultiplexer for the serverless agent.
func InitAndStartServerlessDemultiplexer(domainResolvers map[string]resolver.DomainResolver, forwarderTimeout time.Duration) *ServerlessDemultiplexer {
func InitAndStartServerlessDemultiplexer(keysPerDomain map[string][]string, forwarderTimeout time.Duration) *ServerlessDemultiplexer {
bufferSize := config.Datadog.GetInt("aggregator_buffer_size")
log := log.NewTemporaryLoggerWithoutInit()
forwarder := forwarder.NewSyncForwarder(config.Datadog, log, domainResolvers, forwarderTimeout)
forwarder := forwarder.NewSyncForwarder(config.Datadog, log, keysPerDomain, forwarderTimeout)
serializer := serializer.NewSerializer(forwarder, nil)
metricSamplePool := metrics.NewMetricSamplePool(MetricSamplePoolBatchSize)
tagsStore := tags.NewStore(config.Datadog.GetBool("aggregator_use_tags_store"), "timesampler")
Expand Down
3 changes: 1 addition & 2 deletions pkg/serverless/metrics/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
dogstatsdServer "github.com/DataDog/datadog-agent/comp/dogstatsd/server"
"github.com/DataDog/datadog-agent/pkg/aggregator"
"github.com/DataDog/datadog-agent/pkg/config"
"github.com/DataDog/datadog-agent/pkg/config/resolver"
"github.com/DataDog/datadog-agent/pkg/config/utils"
"github.com/DataDog/datadog-agent/pkg/util/log"
)
Expand Down Expand Up @@ -129,7 +128,7 @@ func buildDemultiplexer(multipleEndpointConfig MultipleEndpointConfig, forwarder
log.Errorf("Misconfiguration of agent endpoints: %s", err)
return nil
}
return aggregator.InitAndStartServerlessDemultiplexer(resolver.NewSingleDomainResolvers(keysPerDomain), forwarderTimeout)
return aggregator.InitAndStartServerlessDemultiplexer(keysPerDomain, forwarderTimeout)
}

func buildMetricBlocklist(userProvidedList []string) []string {
Expand Down
Loading