-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
remote.go
31 lines (26 loc) · 1.17 KB
/
remote.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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.
//go:build !serverless
package config
import (
corecompcfg "github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/pkg/api/security"
coreconfig "github.com/DataDog/datadog-agent/pkg/config"
rc "github.com/DataDog/datadog-agent/pkg/config/remote/client"
"github.com/DataDog/datadog-agent/pkg/remoteconfig/state"
"github.com/DataDog/datadog-agent/pkg/trace/config"
"github.com/DataDog/datadog-agent/pkg/version"
)
func remote(c corecompcfg.Component, ipcAddress string) (config.RemoteClient, error) {
return rc.NewGRPCClient(
ipcAddress,
coreconfig.GetIPCPort(),
func() (string, error) { return security.FetchAuthToken(c) },
rc.WithAgent(rcClientName, version.AgentVersion),
rc.WithProducts(state.ProductAPMSampling, state.ProductAgentConfig),
rc.WithPollInterval(rcClientPollInterval),
rc.WithDirectorRootOverride(c.GetString("site"), c.GetString("remote_configuration.director_root")),
)
}