英文:
OpenTelemetry Lambda Layer Logs | Golang
问题
有没有办法删除信息日志?由于Lambda Layer Collector日志,CloudWatch被淹没了。
info	Exporter is starting...	
{
    "kind": "exporter",
    "data_type": "traces",
    "name": "otlp"
}
.....
info	Processor started.	
{
    "kind": "processor",
    "name": "groupbytrace",
    "pipeline": "traces"
}
.....
info	shutting down the event manager	
{
    "kind": "processor",
    "name": "groupbytrace",
    "pipeline": "traces",
    "pending-events": 0
}
英文:
Is there a way for the info logs to be removed? CloudWatch is swamped due to the Lambda Layer Collector logs.
info	Exporter is starting...	
{
    "kind": "exporter",
    "data_type": "traces",
    "name": "otlp"
}
.....
info	Processor started.	
{
    "kind": "processor",
    "name": "groupbytrace",
    "pipeline": "traces"
}
.....
info	shutting down the event manager	
{
    "kind": "processor",
    "name": "groupbytrace",
    "pipeline": "traces",
    "pending-events": 0
}
答案1
得分: 0
你需要覆盖该层中的默认配置,以便为其中的收集器构建一个自定义收集器。阅读文档中的这一部分,你就会明白为什么要打开 debug 模式:https://github.com/open-telemetry/opentelemetry-lambda/blob/main/collector/README.md#configuration
这是该层的主要存储库:https://github.com/open-telemetry/opentelemetry-lambda
英文:
You'll have to override the default config for the collector that is part of that layer. Probably build a custom collector. Read this section in the docs and you'll see why debug is on: https://github.com/open-telemetry/opentelemetry-lambda/blob/main/collector/README.md#configuration
Here is the main repo for the layer too: https://github.com/open-telemetry/opentelemetry-lambda
答案2
得分: 0
这可能对那些试图关闭信息日志的人有所帮助。
nopCore := zap.WrapCore(func(zapcore.Core) zapcore.Core {
	return zapcore.NewNopCore()
})
然后将其添加到CollectorSettings中:
params := service.CollectorSettings{
	BuildInfo: component.BuildInfo{
		Command:     "otelcol",
		Description: "Lambda Collector",
		Version:     Version,
	},
	ConfigProvider: c.configProvider,
	Factories:      c.factories,
	LoggingOptions: []zap.Option{nopCore},
}
英文:
This might help those who are trying to turn off the info logs.
nopCore := zap.WrapCore(func(zapcore.Core) zapcore.Core {
	return zapcore.NewNopCore()
})
And add that to the CollectorSettings:
params := service.CollectorSettings{
	BuildInfo: component.BuildInfo{
		Command:     "otelcol",
		Description: "Lambda Collector",
		Version:     Version,
	},
	ConfigProvider: c.configProvider,
	Factories:      c.factories,
	LoggingOptions: []zap.Option{nopCore},
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论