OpenTelemetry Lambda层日志 | Golang

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

OpenTelemetry Lambda Layer Logs | Golang

问题

有没有办法删除信息日志?由于Lambda Layer Collector日志,CloudWatch被淹没了。

  1. info Exporter is starting...
  2. {
  3. "kind": "exporter",
  4. "data_type": "traces",
  5. "name": "otlp"
  6. }
  7. .....
  8. info Processor started.
  9. {
  10. "kind": "processor",
  11. "name": "groupbytrace",
  12. "pipeline": "traces"
  13. }
  14. .....
  15. info shutting down the event manager
  16. {
  17. "kind": "processor",
  18. "name": "groupbytrace",
  19. "pipeline": "traces",
  20. "pending-events": 0
  21. }
英文:

Is there a way for the info logs to be removed? CloudWatch is swamped due to the Lambda Layer Collector logs.

  1. info Exporter is starting...
  2. {
  3. "kind": "exporter",
  4. "data_type": "traces",
  5. "name": "otlp"
  6. }
  7. .....
  8. info Processor started.
  9. {
  10. "kind": "processor",
  11. "name": "groupbytrace",
  12. "pipeline": "traces"
  13. }
  14. .....
  15. info shutting down the event manager
  16. {
  17. "kind": "processor",
  18. "name": "groupbytrace",
  19. "pipeline": "traces",
  20. "pending-events": 0
  21. }

答案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

这可能对那些试图关闭信息日志的人有所帮助。

  1. nopCore := zap.WrapCore(func(zapcore.Core) zapcore.Core {
  2. return zapcore.NewNopCore()
  3. })

然后将其添加到CollectorSettings中:

  1. params := service.CollectorSettings{
  2. BuildInfo: component.BuildInfo{
  3. Command: "otelcol",
  4. Description: "Lambda Collector",
  5. Version: Version,
  6. },
  7. ConfigProvider: c.configProvider,
  8. Factories: c.factories,
  9. LoggingOptions: []zap.Option{nopCore},
  10. }
英文:

This might help those who are trying to turn off the info logs.

  1. nopCore := zap.WrapCore(func(zapcore.Core) zapcore.Core {
  2. return zapcore.NewNopCore()
  3. })

And add that to the CollectorSettings:

  1. params := service.CollectorSettings{
  2. BuildInfo: component.BuildInfo{
  3. Command: "otelcol",
  4. Description: "Lambda Collector",
  5. Version: Version,
  6. },
  7. ConfigProvider: c.configProvider,
  8. Factories: c.factories,
  9. LoggingOptions: []zap.Option{nopCore},
  10. }

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:

确定