-
Notifications
You must be signed in to change notification settings - Fork 118
/
defaults.go
143 lines (136 loc) · 7.05 KB
/
defaults.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// Copyright 2020 New Relic Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package config
import (
"os/user"
)
const (
// Plain text log format.
LogFormatText = "text"
// JSON log format.
LogFormatJSON = "json"
// Non configurable stuff
defaultIdentityURLEu = "https://identity-api.eu.newrelic.com"
defaultIdentityStagingURLEu = "https://staging-identity-api.eu.newrelic.com"
defaultCmdChannelURLEu = "https://infrastructure-command-api.eu.newrelic.com"
defaultCmdChannelStagingURLEu = "https://staging-infrastructure-command-api.eu.newrelic.com"
defaultCmdChannelURL = "https://infrastructure-command-api.newrelic.com"
defaultCmdChannelStagingURL = "https://staging-infrastructure-command-api.newrelic.com"
defaultIdentityURL = "https://identity-api.newrelic.com"
defaultIdentityStagingURL = "https://staging-identity-api.newrelic.com"
baseCollectorURL = "https://%sinfra-api.%snewrelic.com"
baseDimensionalMetricURL = "https://%smetric-api.%snewrelic.com"
defaultSecureFederalURL = "https://gov-infra-api.newrelic.com"
defaultSecureFederalMetricURL = "https://gov-metric-api.newrelic.com"
defaultSecureFedralIdentityURL = "https://gov-identity-api.newrelic.com"
defaultSecureFedralCmdChannelURL = "https://gov-infrastructure-command-api.newrelic.com"
defaultAPMCollectorHost = "collector.newrelic.com"
defaultAPMCollectorHostEu = "collector.eu.newrelic.com"
defaultSecureFederalAPMCollectorHost = "gov-collector.newrelic.com"
defaultAPMCollectorHostStaging = "staging-collector.newrelic.com"
)
// Default configurable values
//
//nolint:gochecknoglobals,gomnd
var (
// public
DefaultContainerCacheMetadataLimit = 60
DefaultDockerApiVersion = "1.24" // minimum supported API by Docker 18.09.0
DefaultDockerContainerdNamespace = "moby"
DefaultHeartBeatFrequencySecs = 60
DefaultDMPeriodSecs = 5 // default telemetry SDK value
DefaultMaxMetricsBatchSizeBytes = 1000 * 1000 // Size limit from Vortex collector service (1MB)
DefaultMaxMetricBatchEntitiesCount = 300 // Amount limit from Vortex collector service header (8k ~ 300 entities)
DefaultMaxMetricBatchEntitiesQueue = 1000 // Limit the amount of queued entities to be processed by Vortex collector service
DefaultMetricsNFSSampleRate = 20
DefaultOfflineTimeToReset = "24h"
DefaultStorageSamplerRateSecs = 20
DefaultStripCommandLine = true
DefaultSmartVerboseModeEntryLimit = 1000
DefaultIntegrationsDir = "newrelic-integrations"
DefaultInventoryQueue = 0
// private
defaultAppDataDir = ""
defaultCmdChannelEndpoint = "/agent_commands/v1/commands"
defaultCmdChannelIntervalSec = 60
defaultInventoryArchiveEnabled = true
defaultCompactEnabled = true
defaultCompactThreshold = 20 * 1024 * 1024 // (in bytes) compact repo when it hits 20MB
defaultIgnoreReclaimable = false
defaultDebugLogSec = 600
defaultDisableInventorySplit = false
defaultDisableWinSharedWMI = false
defaultDisableZeroRSSFilter = false
defaultDnsHostnameResolution = true
defaultFilesConfigOn = false
defaultMaxProcs = 1
defaultHTTPServerHost = "localhost"
defaultHTTPServerPort = 8001
defaultTCPServerPort = 8002
defaultStatusServerPort = 8003
defaultIpData = true
defaultTruncTextValues = true
defaultLogToStdout = true
defaultLogFormat = LogFormatText
defaultLogLevel = LogLevelInfo
defaultLogForward = false
defaultLoggingRetryLimit = "5" // nolint:gochecknoglobals
defaultMaxInventorySize = 1000 * 1000 // Size limit from Vortex collector service (1MB)
defaultPayloadCompressionLevel = 6 // default compression level used in go, higher than this does not show tangible benefits
defaultPidFile = "/var/run/newrelic-infra/newrelic-infra.pid"
defaultPluginActiveConfigsDir = "integrations.d"
defaultSelinuxEnableSemodule = true
defaultStartupConnectionTimeout = "10s"
defaultPartitionsTTL = "60s" // TTL for the partitions cache, to avoid polling continuously for them
defaultStartupConnectionRetries = 6 // -1 will try forever with an exponential backoff algorithm
defaultSupervisorRpcSock = "/var/run/supervisor.sock"
defaultWinUpdatePlugin = false
defaultDMIngestEndpoint = "/metric/v1/infra"
defaultMetricsIngestEndpoint = "/metrics" // default: V1 endpoint root (/events/bulk), combine this with defaultCollectorURL
defaultInventoryIngestEndpoint = "/inventory" // default: V1 endpoint root (/deltas, /deltas/bulk)
defaultIdentityIngestEndpoint = "/identity/v1" // default: V1 endpoint root (/connect, /register/batch)
defaultMetricsIngestV2Endpoint = "/infra/v2/metrics" // default: V2 endpoint root (/events/bulk), combine this with defaultCollectorURL
defaultFingerprintUpdateFreqSec = 60 // Default update freq of the fingerprint in seconds.
defaultCloudProvider = ""
defaultCloudMaxRetryCount = 10
defaultCloudRetryBackOffSec = 60 // In seconds.
defaultCloudMetadataExpiryInSec = 300 // In seconds.
defaultCloudMetadataDisableKeepAlive = true
defaultRegisterConcurrency = 4
defaultRegisterBatchSize = 100
defaultRegisterFrequencySecs = 15
defaultProxyValidateCerts = false
defaultProxyConfigPlugin = true
defaultWinRemovableDrives = true
defaultMetricsMatcherConfig = IncludeMetricsMap{}
defaultRegisterMaxRetryBoSecs = 60
defaultNtpPool = []string{} // i.e: []string{"time.cloudflare.com"}
defaultNtpEnabled = false
defaultNtpInterval = uint(15) // minutes
defaultNtpTimeout = uint(5) // seconds
)
// Default internal values
// nolint:gochecknoglobals
var (
defaultAgentDir string
defaultConfigFiles []string
defaultLogFile string
defaultNetworkInterfaceFilters map[string][]string
defaultPassthroughEnvironment []string
defaultPluginConfigFiles []string
defaultPluginInstanceDir string
defaultConfigDir string
defaultLoggingConfigsDir string
defaultLoggingHomeDir string
defaultFluentBitParsers string
defaultFluentBitNRLib string
defaultIntegrationsTempDir string
defaultAgentTempDir string
)
func getDefaultFacterHomeDir() (string, error) {
usr, err := user.Current()
if err != nil {
return "", err
}
return usr.HomeDir, nil
}