@@ -39,12 +39,28 @@ import (
3939const OtelNamePrefix = "_agent-component/"
4040
4141// BeatMonitoringConfigGetter is a function that returns the monitoring configuration for a beat receiver.
42- type BeatMonitoringConfigGetter func (unitID , binary string ) map [string ]any
43- type exporterConfigTranslationFunc func (* config.C , * logp.Logger ) (map [string ]any , error )
42+ type (
43+ BeatMonitoringConfigGetter func (unitID , binary string ) map [string ]any
44+ exporterConfigTranslationFunc func (* config.C , * logp.Logger ) (map [string ]any , error )
45+ )
4446
4547var (
46- OtelSupportedOutputTypes = []string {"elasticsearch" }
47- OtelSupportedInputTypes = []string {"filestream" , "http/metrics" , "beat/metrics" , "system/metrics" , "prometheus/metrics" }
48+ OtelSupportedOutputTypes = []string {"elasticsearch" }
49+ OtelSupportedFilebeatInputTypes = []string {
50+ "filestream" ,
51+ "journald" ,
52+ "log" ,
53+ "winlog" ,
54+ }
55+ OtelSupportedMetricbeatInputTypes = []string {
56+ "beat/metrics" ,
57+ "http/metrics" ,
58+ "kubernetes/metrics" ,
59+ "linux/metrics" ,
60+ "prometheus/metrics" ,
61+ "system/metrics" ,
62+ }
63+ OtelSupportedInputTypes = slices .Concat (OtelSupportedFilebeatInputTypes , OtelSupportedMetricbeatInputTypes )
4864 configTranslationFuncForExporter = map [otelcomponent.Type ]exporterConfigTranslationFunc {
4965 otelcomponent .MustNewType ("elasticsearch" ): translateEsOutputToExporter ,
5066 }
@@ -179,13 +195,11 @@ func getCollectorConfigForComponent(
179195 beatMonitoringConfigGetter BeatMonitoringConfigGetter ,
180196 logger * logp.Logger ,
181197) (* confmap.Conf , error ) {
182-
183198 exportersConfig , outputQueueConfig , extensionConfig , err := getExportersConfigForComponent (comp , logger )
184199 if err != nil {
185200 return nil , err
186201 }
187202 receiversConfig , err := getReceiversConfigForComponent (comp , info , outputQueueConfig , beatMonitoringConfigGetter )
188-
189203 if err != nil {
190204 return nil , err
191205 }
@@ -201,7 +215,7 @@ func getCollectorConfigForComponent(
201215 }
202216
203217 // we need to convert []string to []interface for this to work
204- extensionKey := make ([]interface {} , len (maps .Keys (extensionConfig )))
218+ extensionKey := make ([]any , len (maps .Keys (extensionConfig )))
205219 for i , v := range maps .Keys (extensionConfig ) {
206220 extensionKey [i ] = v
207221 }
@@ -269,13 +283,13 @@ func getReceiversConfigForComponent(
269283 // adds additional context on logs emitted by beatreceivers to uniquely identify per component logs
270284 "logging" : map [string ]any {
271285 "with_fields" : map [string ]any {
272- "component" : map [string ]interface {} {
286+ "component" : map [string ]any {
273287 "id" : comp .ID ,
274288 "binary" : binaryName ,
275289 "dataset" : dataset ,
276290 "type" : comp .InputType ,
277291 },
278- "log" : map [string ]interface {} {
292+ "log" : map [string ]any {
279293 "source" : comp .ID ,
280294 },
281295 },
0 commit comments