最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

aws lambda - Add autoinstrumentation with OpenTelemetry when not using SpringBoot - Stack Overflow

programmeradmin2浏览0评论

I have an AWS Lambda function that I am developing in Java. I am using the pacakge io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk to set up telemetry and I use it like this:

public static OpenTelemetrySdk autoconfiguredSdk() {
                OpenTelemetrySdk openTelemetrySdk = AutoConfiguredOpenTelemetrySdk.initialize().getOpenTelemetrySdk();
                return openTelemetrySdk;
        }

With this I can create my own spans and the SDK will be configured using the standard env vars for OpenTelemetry. When using the SpringBoot starter there is a bunch of autoinstrumentation (for http, aws, dbs, etc.) that works out of the box and I don't have to create spans for those actions, it's the SDK that takes care of it.

How can I achieve that same thing when not using the OpenTelemetry SpringBoot Starter?

发布评论

评论列表(0)

  1. 暂无评论