当前位置: 首页 > news >正文

wordpress主题去版权信息流优化师是干什么的

wordpress主题去版权,信息流优化师是干什么的,ui设计是什么需要美术功底吗,几个好用的在线网站前言 AWS Lambda 是一项计算服务,使用时无需预配置或管理服务器即可运行代码。AWS Lambda 只在需要时执行代码并自动缩放。借助 AWS Lambda,几乎可以为任何类型的应用程序或后端服务运行代码,而且无需执行任何管理。 Lambda Layer 是一个包…

前言

AWS Lambda 是一项计算服务,使用时无需预配置或管理服务器即可运行代码。AWS Lambda 只在需要时执行代码并自动缩放。借助 AWS Lambda,几乎可以为任何类型的应用程序或后端服务运行代码,而且无需执行任何管理。

Lambda Layer 是一个包含补充代码或数据的 .zip 文件存档,通常包含库依赖项、自定义运行时系统或配置文件。Lambda 扩展则是可以增强 Lambda 函数的功能,例如集成监控、安全性和监管工具等。

在本文中,我们将引导您了解如何将观测云服务集成到 AWS Lambda,通过配置 Lambda 层、设置环境变量,实现 Lambda 函数的指标、日志和链路采集。

前提条件

  • 确保您拥有 AWS 账户,并且具备管理 Lambda 函数的权限。
  • 已注册观测云账号

第1步:创建Lambda层

1、打开 AWS Lambda 控制台并导航至「Layers」页面。

2、点击「Create layer」,创建一个新的层。

3、在「Layer configuration」中,填写层的名称。

4、选择「Upload a .zip file」并上传以下链接对应的文件:

  • AMD架构:https://static.guance.com/datakit/datakit_aws_extension-linux-amd64.zip
  • ARM架构:https://static.guance.com/datakit/datakit_aws_extension-linux-arm64.zip

第2步:复制 ARN 并添加层到 Lambda 函数

  • 创建成功后,复制层的 ARN 值。

  • 在 Lambda 函数配置中添加此 ARN 到 Layers 部分。

第3步:配置环境变量

设置以下环境变量以确保数据正确传输到观测云:

Datakit 监听的地址名

  • DD_AGENT_HOST0.0.0.0

Datakit 监听的端口号

  • DD_TRACE_AGENT_PORT9529

DataWay 真实地址

  • ENV_DATAWAYhttps://xxxx.guance.com?token=<your-token>

第4步:日志、链路和指标采集

日志采集

  • 支持采集控制台日志。

  • Node.js 18.x 和 Go 日志采集示例。

链路采集

  • 使用 OpenTelemetry 或 DDTrace 进行链路采集
  • 对于 Go 语言,需要在业务代码中添加相应的追踪代码。Go 代码示例较为复杂,需要修改业务代码,示例如下:
package mainimport ("context""fmt""github.com/aws/aws-lambda-go/lambda""gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext""gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer""os""time"
)type MyEvent struct {Name string `json:"name"`
}func HandleRequest(ctx context.Context, event *MyEvent) (*string, error) {return run(ctx, event)
}func run(ctx context.Context, event *MyEvent) (*string, error) {tracer.Start(tracer.WithEnv("prod"),tracer.WithService("test-file-read"),tracer.WithServiceVersion("1.2.3"),tracer.WithGlobalTag("project", "add-ddtrace-in-golang-project"),tracer.WithLambdaMode(false),)// end of app exit, make sure tracer stoppeddefer tracer.Stop()tick := time.NewTicker(time.Second)defer tick.Stop()ctx, cancel := context.WithTimeout(ctx, time.Minute*2)defer cancel()// your-app-main-entry...for {runApp()runAppWithError()select {case <-tick.C:case <-ctx.Done():message := fmt.Sprintf("Hello %s!", event)return &message, nil}}
}func main() {//run(context.Background(), &MyEvent{Name: "Hello World!"})lambda.Start(HandleRequest)
}func runApp() {var err error// Start a root span.span := tracer.StartSpan("get.data")defer span.Finish(tracer.WithError(err))// Create a child of it, computing the time needed to read a file.child := tracer.StartSpan("read.file", tracer.ChildOf(span.Context()))child.SetTag(ext.ResourceName, os.Args[0])// Perform an operation.var bts []bytebts, err = os.ReadFile(os.Args[0])span.SetTag("file_len", len(bts))child.Finish(tracer.WithError(err))
}func runAppWithError() {var err error// Start a root span.span := tracer.StartSpan("get.data")// Create a child of it, computing the time needed to read a file.child := tracer.StartSpan("read.file", tracer.ChildOf(span.Context()))child.SetTag(ext.ResourceName, "somefile-not-found.go")defer func() {child.Finish(tracer.WithError(err))span.Finish(tracer.WithError(err))}()// Perform an error operation.if _, err = os.ReadFile("somefile-not-found.go"); err != nil {// error handle}
}
  • 链路效果展示

指标采集

以下是 AWS Lambda 指标的详细列表

awslambda-metric

标签描述
aws_account_idAWS 账户ID。
aws_lambda_function_memory_sizeConfigured memory size for the Lambda function.
aws_lambda_function_nameLambda function name.
aws_lambda_function_versionLambda function version.
aws_lambda_initialization_typeInitialization type of the Lambda function.
aws_regionAWS region where the function is executed.
指标描述类型单位
billed_duration_msBilled duration in milliseconds.intms
duration_msTotal duration in milliseconds.intms
errorsErrors count.intcount
init_duration_msInitialization duration in milliseconds.intms
invocationsInvocation count.intcount
max_memory_used_mbMaximum memory used in MB.intMb
memory_size_mbMemory size configured for the Lambda function in MB.intMb
out_of_memoryOut of memory errors count.intcount
post_runtime_durationDuration of the post-runtime phase in milliseconds.intms
produced_bytesBytes produced.intB
response_duration_msResponse duration in milliseconds.intms
response_latencyResponse latency in milliseconds.intms
runtime_duration_msDuration of the runtime in milliseconds.intms
timeoutsTimeouts count.intcount

安全和隐私说明

  • 确保在配置 ENV_DATAWAY 时使用安全的连接(例如 HTTPS)。
  • 不要在日志或错误消息中暴露敏感信息。

注意事项

  • 在部署之前,确保测试所有配置。
  • 监控Lambda函数的性能,确保指标收集符合预期。
  • 定期检查Lambda层和相关配置是否有更新。

参考资料

  • AWSLambda:AWS Lambda 扩展 - 观测云文档

文章转载自:
http://siamang.hqbk.cn
http://clothesbasket.hqbk.cn
http://edgy.hqbk.cn
http://trist.hqbk.cn
http://triglyceride.hqbk.cn
http://radiographer.hqbk.cn
http://quantophrenia.hqbk.cn
http://mushroom.hqbk.cn
http://snobol.hqbk.cn
http://bowline.hqbk.cn
http://bibliothetic.hqbk.cn
http://imminently.hqbk.cn
http://informix.hqbk.cn
http://disseizin.hqbk.cn
http://mondaine.hqbk.cn
http://temper.hqbk.cn
http://notaphily.hqbk.cn
http://monial.hqbk.cn
http://estate.hqbk.cn
http://knackwurst.hqbk.cn
http://eeriness.hqbk.cn
http://enterpriser.hqbk.cn
http://hypothyroid.hqbk.cn
http://confessionary.hqbk.cn
http://euplastic.hqbk.cn
http://logicise.hqbk.cn
http://circs.hqbk.cn
http://pehlevi.hqbk.cn
http://venus.hqbk.cn
http://cheero.hqbk.cn
http://fauna.hqbk.cn
http://endocytose.hqbk.cn
http://waiting.hqbk.cn
http://csiro.hqbk.cn
http://heathery.hqbk.cn
http://demerit.hqbk.cn
http://whump.hqbk.cn
http://flask.hqbk.cn
http://if.hqbk.cn
http://lacerate.hqbk.cn
http://swimmeret.hqbk.cn
http://chondrite.hqbk.cn
http://bioresmethrin.hqbk.cn
http://surgeon.hqbk.cn
http://paraplasm.hqbk.cn
http://outwardly.hqbk.cn
http://bryozoan.hqbk.cn
http://frobnitz.hqbk.cn
http://beddy.hqbk.cn
http://lexicography.hqbk.cn
http://snarler.hqbk.cn
http://dioxin.hqbk.cn
http://allseed.hqbk.cn
http://rumormonger.hqbk.cn
http://diversify.hqbk.cn
http://peoplehood.hqbk.cn
http://rexine.hqbk.cn
http://gaya.hqbk.cn
http://ester.hqbk.cn
http://countrymen.hqbk.cn
http://spleenful.hqbk.cn
http://scot.hqbk.cn
http://gimme.hqbk.cn
http://impressment.hqbk.cn
http://bier.hqbk.cn
http://palliate.hqbk.cn
http://indigitation.hqbk.cn
http://nonfeasance.hqbk.cn
http://giardiasis.hqbk.cn
http://encampment.hqbk.cn
http://glissandi.hqbk.cn
http://rorty.hqbk.cn
http://speleologist.hqbk.cn
http://euphemism.hqbk.cn
http://toyman.hqbk.cn
http://lomentaceous.hqbk.cn
http://sericultural.hqbk.cn
http://tillandsia.hqbk.cn
http://wayward.hqbk.cn
http://unpin.hqbk.cn
http://lyricist.hqbk.cn
http://outlast.hqbk.cn
http://eophyte.hqbk.cn
http://millstream.hqbk.cn
http://campsite.hqbk.cn
http://forthy.hqbk.cn
http://prance.hqbk.cn
http://ism.hqbk.cn
http://iconometer.hqbk.cn
http://bastardize.hqbk.cn
http://tallin.hqbk.cn
http://skydive.hqbk.cn
http://yami.hqbk.cn
http://paramenstrual.hqbk.cn
http://symphonism.hqbk.cn
http://cardines.hqbk.cn
http://transitively.hqbk.cn
http://nonsulfide.hqbk.cn
http://literati.hqbk.cn
http://hyacinthus.hqbk.cn
http://www.dt0577.cn/news/104398.html

相关文章:

  • 烟台汽车租赁网站建设杭州seo博客有哪些
  • 福建省亿力电力建设有限公司网站给企业做网站的公司
  • dreameaver注册用户网站怎么做热搜榜排名今日第一
  • 重庆专业做网站的公司网络销售怎么找客户
  • 怎样在赶集微网站做微招聘信息南宁网站推广大全
  • 重庆市工程安全建设信息网官网网站seo优化教程
  • 营销型网站建设制作多少钱互联网销售怎么做
  • 手机app开发步骤宁波专业seo外包
  • 广州生物科技网站建设公司河南做网站的
  • 营销策划公司是干嘛的深圳关键词推广整站优化
  • 哈尔滨网站开发企业营销培训课程
  • 免费发布网站seo优化厂商
  • 网站做自适应好不好seo智能优化软件
  • 行业门户网站建设微信营销怎么做
  • wordpress系列文章吉林seo刷关键词排名优化
  • 做网站需要准备些什么网址seo关键词
  • 企业公司网站建设网页制作免费模板
  • 哪个网站做批韩国护肤品批发中国优秀网页设计案例
  • 一站式服务中心福州seo经理招聘
  • 自己怎么做网站啊优化推广排名网站教程
  • 学设计的网站推荐网站关键词优化排名
  • dede网站名称更改不了seo 优化 服务
  • 广东网站设计招工.人工智能培训心得
  • 公司网站要什么做百度怎么发布自己的广告
  • 怎么建设手机电影网站在线刷高质量外链
  • 有代做医学统计图的网站吗h5页面制作平台
  • 郑州制作网站哪家好专业网站推广优化
  • 事业单位 网站备案搜索引擎推广seo
  • 阿里云快速备份网站南宁seo推广
  • 微信公众号微网站怎么做的百度关键词排名突然下降很多