Skip to content

Commit efe39c8

Browse files
committed
fix toml config schema
1 parent e0b81f0 commit efe39c8

File tree

1 file changed

+91
-81
lines changed
  • translator/tocwconfig/totomlconfig/tomlConfigTemplate

1 file changed

+91
-81
lines changed

translator/tocwconfig/totomlconfig/tomlConfigTemplate/tomlConfig.go

Lines changed: 91 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -97,33 +97,49 @@ type (
9797
ethtoolConfig struct {
9898
FieldPass []string
9999
InterfaceInclude []string `toml:"interface_include"`
100-
Interval string
100+
Tags map[string]string
101101
}
102102

103-
k8sAPIServerConfig struct {
104-
Interval string
105-
Tags map[string]string
103+
eventConfig struct {
104+
BatchReadSize int `toml:"batch_read_size"`
105+
EventLevels []string `toml:"event_levels"`
106+
EventName string `toml:"event_name"`
107+
LogGroupName string `toml:"log_group_name"`
108+
LogStreamName string `toml:"log_stream_name"`
109+
RetentionInDays int `toml:"retention_in_days"`
106110
}
107111

108112
logFileConfig struct {
109-
FileConfig []fileConfig `toml:"file_config"`
110-
ForceFlushInterv string `toml:"force_flush_interval"`
113+
Destination string
114+
FileStateFolder string `toml:"file_state_folder"`
115+
FileConfig []fileConfig `toml:"file_config"`
116+
MaxPersistState int `toml:"max_persist_state"`
111117
}
112118

113119
fileConfig struct {
114-
FileDirectory string `toml:"file_directory"`
115-
FileNameFilter string `toml:"file_name_filter"`
116-
FileStateFolder string `toml:"file_state_folder"`
120+
AutoRemoval bool `toml:"auto_removal"`
121+
BackpressureMode string `toml:"backpressure_mode"`
122+
FilePath string `toml:"file_path"`
117123
FromBeginning bool `toml:"from_beginning"`
118124
LogGroupName string `toml:"log_group_name"`
119125
LogStreamName string `toml:"log_stream_name"`
120-
MultiLinePattern string `toml:"multi_line_pattern"`
121-
Timezone string
122-
Filters []fileConfigFilter
126+
Pipe bool
123127
RetentionInDays int `toml:"retention_in_days"`
124-
AutoRemoval bool
125-
TagsKey string `toml:"tags_key"`
126-
Tags map[string]string
128+
Timezone string
129+
//Customer specifies if the timestamp from the log message should be trimmed
130+
TrimTimestamp bool `toml:"trim_timestamp"`
131+
//Customer specified service.name
132+
ServiceName string `toml:"service_name"`
133+
//Customer specified deployment.environment
134+
DeploymentEnvironment string `toml:"deployment_environment"`
135+
Tags map[string]string
136+
Filters []fileConfigFilter
137+
}
138+
139+
k8sAPIServerConfig struct {
140+
Interval string
141+
NodeName string `toml:"node_name"`
142+
Tags map[string]string
127143
}
128144

129145
memConfig struct {
@@ -133,9 +149,9 @@ type (
133149
}
134150

135151
netConfig struct {
136-
FieldPass []string
137-
Interval string
138-
Tags map[string]string
152+
FieldPass []string
153+
Interfaces []string
154+
Tags map[string]string
139155
}
140156

141157
netStatConfig struct {
@@ -145,97 +161,91 @@ type (
145161
}
146162

147163
nvidiaSmi struct {
148-
Timeout int
149-
Interval string
150-
Tags map[string]string
164+
FieldPass []string
165+
Interval string
166+
TagExclude []string
167+
Tags map[string]string
151168
}
152169

153170
processesConfig struct {
154171
FieldPass []string
155-
Interval string
156172
Tags map[string]string
157173
}
158174

159175
prometheusConfig struct {
160-
ClusterName string `toml:"cluster_name"`
161-
EndpointURLs []string `toml:"endpoint_urls"`
162-
GlobalMetricsDeclarations []metricsDeclaration
163-
GlobalDimensionsBlacklist []string `toml:"global_dimensions_blacklist"`
164-
GlobalTagsInclude []string `toml:"global_tags_include"`
165-
Interval string
166-
MetricsDeclarations []metricsDeclaration `toml:"metrics_declaration"`
167-
OutputDestination string `toml:"output_destination"`
168-
ServiceAddressURLLabelName string `toml:"service_address_url_label_name"`
169-
SourceLabelsBlacklist []string `toml:"source_labels_blacklist"`
170-
TagsKey string `toml:"tags_key"`
171-
Tags map[string]string
172-
}
173-
174-
metricsDeclaration struct {
175-
DimensionNameRequirement []string `toml:"dimension_name_requirement"`
176-
LabelMatchers []string `toml:"label_matchers"`
177-
MetricNameSelectors []string `toml:"metric_name_selectors"`
178-
MetricRegistryName string `toml:"metric_registry_name"`
179-
SourceLabels []string `toml:"source_labels"`
180-
TargetMetricNames []string `toml:"target_metric_names"`
176+
ClusterName string `toml:"cluster_name"`
177+
PrometheusConfigPath string `toml:"prometheus_config_path"`
178+
EcsServiceDiscovery prometheusEcsServiceDiscoveryConfig `toml:"ecs_service_discovery"`
179+
Tags map[string]string
180+
}
181+
182+
prometheusEcsServiceDiscoveryConfig struct {
183+
SdClusterRegion string `toml:"sd_cluster_region"`
184+
SdFrequency string `toml:"sd_frequency"`
185+
SdResultFile string `toml:"sd_result_file"`
186+
SdTargetCluster string `toml:"sd_target_cluster"`
187+
DockerLabel map[string]string `toml:"docker_label"`
188+
ServiceNameListForTasks []serviceNameListForTasks `toml:"service_name_list_for_tasks"`
189+
TaskDefinitionList []taskDefinitionList `toml:"task_definition_list"`
190+
}
191+
192+
serviceNameListForTasks struct {
193+
SdContainerNamePattern string `toml:"sd_container_name_pattern"`
194+
SdJobName string `toml:"sd_job_name"`
195+
SdMetricsPath string `toml:"sd_metrics_path"`
196+
SdMetricsPorts string `toml:"sd_metrics_ports"`
197+
SdServiceNamePattern string `toml:"sd_service_name_pattern"`
198+
}
199+
200+
taskDefinitionList struct {
201+
SdJobName string `toml:"sd_job_name"`
202+
SdMetricsPath string `toml:"sd_metrics_path"`
203+
SdMetricsPorts string `toml:"sd_metrics_ports"`
204+
SdTaskDefinitionArnPattern string `toml:"sd_task_definition_arn_pattern"`
181205
}
182206

183207
procStatConfig struct {
184-
FieldPass []string
185-
Interval string
186-
Pattern string
187-
PidFile string `toml:"pid_file"`
188-
PidFinder string `toml:"pid_finder"`
189-
PidTag bool `toml:"pid_tag"`
190-
Tags map[string]string
208+
FieldPass []string
209+
PidFile string `toml:"pid_file"`
210+
PidFinder string `toml:"pid_finder"`
211+
TagExclude []string
212+
Tags map[string]string
191213
}
192214

193215
socketListenerConfig struct {
194-
ServiceAddress string `toml:"service_address"`
195-
DataFormat string `toml:"data_format"`
196-
ContentEncoding string `toml:"content_encoding"`
197-
KeepAlivePeriod string `toml:"keep_alive_period"`
198-
MaxConnections int `toml:"max_connections"`
199-
ReadBufferSize int `toml:"read_buffer_size"`
200-
ReadTimeout string `toml:"read_timeout"`
201-
MetricSeparator string `toml:"metric_separator"`
202-
TagsKey string `toml:"tags_key"`
203-
Tags map[string]string
216+
CollectdAuthFile string `toml:"collectd_auth_file"`
217+
CollectdSecurityLevel string `toml:"collectd_security_level"`
218+
CollectdTypesDb []string `toml:"collectd_typesdb"`
219+
DataFormat string `toml:"data_format"`
220+
NamePrefix string `toml:"name_prefix"`
221+
NameOverride string `toml:"name_override"`
222+
ServiceAddress string `toml:"service_address"`
223+
Tags map[string]string
204224
}
205225

206226
statsdConfig struct {
207-
AllowedPendingMessages int `toml:"allowed_pending_messages"`
208-
ConvertNames bool `toml:"convert_names"`
209-
DeleteCounters bool `toml:"delete_counters"`
210-
DeleteGauges bool `toml:"delete_gauges"`
211-
DeleteSets bool `toml:"delete_sets"`
212-
DeleteTimings bool `toml:"delete_timings"`
213-
MetricSeparator string `toml:"metric_separator"`
214-
ParseDataDogTags bool `toml:"parse_data_dog_tags"`
215-
ServiceAddress string `toml:"service_address"`
216-
PercentileLimit int `toml:"percentile_limit"`
217-
Percentiles []int `toml:"percentiles"`
218-
Templates []string `toml:"templates"`
219-
TagsKey string `toml:"tags_key"`
227+
AllowedPendingMessages int `toml:"allowed_pending_messages"`
228+
Interval string
229+
MetricSeparator string `toml:"metric_separator"`
230+
ParseDataDogTags bool `toml:"parse_data_dog_tags"`
231+
ServiceAddress string `toml:"service_address"`
220232
Tags map[string]string
221233
}
222234

223235
swapConfig struct {
224236
FieldPass []string
225-
Interval string
226237
Tags map[string]string
227238
}
228239

229240
windowsEventLogConfig struct {
230-
EventName string `toml:"event_name"`
231-
EventLevels []string
232-
BatchReadSize int `toml:"batch_read_size"`
233-
StartAt string `toml:"start_at"`
234-
Destination string
235-
Tags map[string]string
241+
Destination string
242+
FileStateFolder string `toml:"file_state_folder"`
243+
MaxPersistState int `toml:"max_persist_state"`
244+
EventConfig []eventConfig `toml:"event_config"`
245+
Tags map[string]string
236246
}
237247

238-
// Output Plugins
248+
// Output plugins
239249

240250
cloudWatchOutputConfig struct {
241251
EndpointOverride string `toml:"endpoint_override"`

0 commit comments

Comments
 (0)