登录
首页 >  Golang >  Go问答

OpenTelemetry Lambda Layer Logging | Goran

来源:stackoverflow

时间:2024-02-26 16:21:23 299浏览 收藏

小伙伴们有没有觉得学习Golang很有意思?有意思就对了!今天就给大家带来《OpenTelemetry Lambda Layer Logging | Goran》,以下内容将会涉及到,若是在学习中对其中部分知识点有疑问,或许看了本文就能帮到你!

问题内容

有没有办法删除信息日志?由于 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
}

正确答案


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

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

您必须覆盖属于该层的收集器的默认配置。可能会构建一个自定义收集器。阅读文档中的这一部分,您将了解为什么打开调试:https://github.com/open-telemetry/opentelemetry-lambda/blob/main/collector/README.md#configuration

这也是该层的主要存储库:https://github.com/open-telemetry/opentelemetry-lambda

今天带大家了解了的相关知识,希望对你有所帮助;关于Golang的技术知识我们会一点点深入介绍,欢迎大家关注golang学习网公众号,一起学习编程~

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>