OpenTelemetry Lambda层日志 | Golang

huangapple go评论88阅读模式
英文:

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},
}

huangapple
  • 本文由 发表于 2022年9月30日 14:27:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/73904770.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定