{"componentChunkName":"component---src-templates-blog-detail-tsx","path":"/blog/2019-12-27-serverless-scf-monitor","result":{"data":{"currentBlog":{"id":"c257edca-5de8-5371-8181-9fb38d9cc74d","frontmatter":{"thumbnail":"https://serverlessimg-1253970226.cos.ap-chengdu.myqcloud.com/qianyi/images/0%20%283%29.jpg","authors":["腾讯云监控"],"categories":["news"],"date":"2019-12-27T00:00:00.000Z","title":"云函数 SCF 支持自定义监控 监控指标任你 DIY","description":"现在，云函数 SCF 全新升级监控可自定义化功能！用户可以非常简单方便地 DIY 函数运行时想要关注的监控指标，用以监控数据展示和告警！","authorslink":["https://github.com/jiangliu5267"],"translators":null,"translatorslink":null,"tags":["serverless","监控"],"keywords":"Serverless,Serverless云监控,Serverless云函数,","outdated":null},"wordCount":{"words":82,"sentences":26,"paragraphs":26},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-12-27-serverless-scf-monitor.md","fields":{"slug":"/blog/2019-12-27-serverless-scf-monitor/","keywords":["serverless","云函数","serverless","监控","函数","serverlesscloud","自定义"]},"html":"<h1 id=\"scf-基础监控指标\"><a href=\"#scf-%E5%9F%BA%E7%A1%80%E7%9B%91%E6%8E%A7%E6%8C%87%E6%A0%87\" aria-label=\"scf 基础监控指标 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>SCF 基础监控指标</strong></h1>\n<p>在使用云函数时，相信大家都会留意到在控制台展示的函数运行时的监控数据。通过这些监控数据可以了解到云函数相关信息，如：</p>\n<ol>\n<li>函数调用次数 —— 可以关注到业务请求量，又或是操作其他云产品的执行次数；</li>\n<li>函数运行内存和运行时间 —— 可以用以评估函数执行性能；</li>\n<li>函数错误次数 —— 可以用以发现函数执行的异常问题。</li>\n</ol>\n<p>针对这些监控数据，还可以通过配置告警，帮助业务及时发现异常问题。</p>\n<p><img src=\"https://img.serverlesscloud.cn/qianyi/images/YHl6UWa9s63pOMMx0c5M1iaGZic692hVUefEZnDTxaXSAvEiccpCfyNUOia627cG0iaHQ0F78F3Bia1ib6d10OdAic7hLA.png\" alt=\"serverless\"></p>\n<p>但这些平台级提供的通用监控，不能完全满足用户的个性化需求。我们经常会遇到这样的咨询：</p>\n<blockquote>\n<p><em>NodeJs开发者：最近我们的Node程序运行太慢，你们有Runtime级别的监控吗？</em></p>\n<p><em>业务运维：我们更关心调用成功率来评估服务可用性，可以把正确调用次数/调用次数给我们计算个成功率显示更直观吗？</em></p>\n<p><em>电商产品经理：这个调用次数能再细化到具体业务场景吗？希望关注加入购物车的人数、下单购买的人数、最终付款的人数..……</em></p>\n</blockquote>\n<p>现在，云函数 SCF 全新升级监控可自定义化功能！用户可以非常简单方便地 DIY 函数运行时想要关注的监控指标，用以监控数据展示和告警！</p>\n<h1 id=\"如何在-scf-中上报自定义监控指标\"><a href=\"#%E5%A6%82%E4%BD%95%E5%9C%A8-scf-%E4%B8%AD%E4%B8%8A%E6%8A%A5%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9B%91%E6%8E%A7%E6%8C%87%E6%A0%87\" aria-label=\"如何在 scf 中上报自定义监控指标 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>如何在 SCF 中上报自定义监控指标</strong></h1>\n<p>步骤1：无需预注册，直接在函数代码里埋点上报自定义监控指标</p>\n<p><img src=\"https://img.serverlesscloud.cn/qianyi/images/YHl6UWa9s63pOMMx0c5M1iaGZic692hVUeIeJmFl74zHTPV7S2sex2ME4fuedgUeaDfPVmrUia4WefBDOIV0sR2RA.png\" alt=\"serverless\"></p>\n<p>步骤2：上报完成后，查看指标视图，按需配置告警策略</p>\n<p><img src=\"https://img.serverlesscloud.cn/qianyi/images/YHl6UWa9s63pOMMx0c5M1iaGZic692hVUeobd8xDIKlo1U9U2C8SCk5gSFkbKOiaNBcdepDSSrEc2ddQQWrkNKSLQ.png\" alt=\"serverless\"></p>\n<p>更详细的操作指南，可查看云+社区文章（最佳实践：在SCF中上报自定义监控数据：<a href=\"https://cloud.tencent.com/developer/article/1557566%EF%BC%89\">https://cloud.tencent.com/developer/article/1557566）</a></p>\n<p><strong>产品正在免费内测中，感兴趣的读者，也可点击阅读原文使用腾讯云主账号登陆申请试用。</strong></p>\n<p>附录：SCF上报自定义监控数据多方案对比</p>\n<p><img src=\"https://img.serverlesscloud.cn/qianyi/images/YHl6UWa9s63pOMMx0c5M1iaGZic692hVUe5aKxHal8FHibSlQyyaujKMru3icUV9XxlF0EicOhnChzITEdrwxhnhhwg.png\" alt=\"serverless\"></p>\n<h1 id=\"\"><a href=\"#\" aria-label=\" permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a></h1>\n<hr>\n<blockquote>\n<p><strong>传送门：</strong></p>\n<ul>\n<li>GitHub: <a href=\"https://github.com/serverless/serverless/blob/master/README_CN.md\">github.com/serverless</a> </li>\n<li>官网：<a href=\"https://serverless.com/\">serverless.com</a></li>\n</ul>\n</blockquote>\n<p>欢迎访问：<a href=\"https://serverlesscloud.cn/\">Serverless 中文网</a>，您可以在 <a href=\"https://serverlesscloud.cn/best-practice\">最佳实践</a> 里体验更多关于 Serverless 应用的开发！</p>","tableOfContents":"<ul>\n<li><a href=\"/blog/2019-12-27-serverless-scf-monitor/#scf-%E5%9F%BA%E7%A1%80%E7%9B%91%E6%8E%A7%E6%8C%87%E6%A0%87\">SCF 基础监控指标</a></li>\n<li><a href=\"/blog/2019-12-27-serverless-scf-monitor/#%E5%A6%82%E4%BD%95%E5%9C%A8-scf-%E4%B8%AD%E4%B8%8A%E6%8A%A5%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9B%91%E6%8E%A7%E6%8C%87%E6%A0%87\">如何在 SCF 中上报自定义监控指标</a></li>\n</ul>"},"previousBlog":{"id":"5334c37e-5036-5cdb-9610-2316a542eac3","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020326/1585185314084-9.jpg","authors":["serverless 社区"],"categories":["meetup"],"date":"2019-12-28T00:00:00.000Z","title":"Serverless 技术行沙龙","description":"来自深圳清华大学研究院 、Serverless 社区专家们围绕 Serverless + 5G，Serverless SSR 技术探索等话题展开深入分享","authorslink":["https://serverlesscloud.cn"],"translators":null,"translatorslink":null,"tags":["serverless","Meetup"],"keywords":"Serverless 全局变量组件,Serverless 单独部署组件,Serverless Component","outdated":null},"wordCount":{"words":184,"sentences":38,"paragraphs":37},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-12-28-serverless-shanghai.md","fields":{"slug":"/blog/2019-12-28-serverless-shanghai/","keywords":["serverless","Serverless","serverless","Framework","应用"]}},"nextBlog":{"id":"ddfeb84b-7b61-5d10-beea-74eae6fcd9aa","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020327/1585306882643-9.jpg","authors":["serverless 社区"],"categories":["meetup"],"date":"2019-12-20T00:00:00.000Z","title":"Serverless 前端工程化落地与实践 - GMTC 大会","description":"腾讯 Serverless 技术专家王俊杰在 GMTC 全球大前端技术大会分享了 Serverless 前端工程化落地与实践","authorslink":["https://serverlesscloud.cn"],"translators":null,"translatorslink":null,"tags":["serverless","Meetup"],"keywords":"Serverless 全局变量组件,Serverless 单独部署组件,Serverless Component","outdated":null},"wordCount":{"words":78,"sentences":27,"paragraphs":27},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-12-20-gmtc.md","fields":{"slug":"/blog/2019-12-20-gmtc/","keywords":["serverless","云函数","Serverless","前端","serverless","落地","开发"]}},"recommendBlogs":{"edges":[{"node":{"id":"73576d26-e0ce-5f26-9330-64b4f3889157","frontmatter":{"thumbnail":"https://main.qcloudimg.com/raw/3cb7b20955d78ced738e0279bb3f6f41.jpg","authors":["AndreaPasswater"],"categories":["news","engineering-culture"],"date":"2018-03-09T00:00:00.000Z","title":"Serverless 数据解读：2018 报告","description":"Serverless Framework 使用统计数据：事件源、服务结构、运行时长等等。","authorslink":["https://serverless.com/author/andreapasswater/"],"translators":["Aceyclee"],"translatorslink":["https://www.zhihu.com/people/Aceyclee"],"tags":["事件源","服务结构"],"keywords":"Serverless 统计数据,Serverless 事件源,Serverless 服务结构","outdated":null},"wordCount":{"words":212,"sentences":45,"paragraphs":45},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-03-09-serverless-by-the-numbers-2018-data-report.md","fields":{"slug":"/blog/2018-03-09-serverless-by-the-numbers-2018-data-report/","keywords":["go","serverless","无服务器","云函数","服务","使用率","Go","部署"]}}},{"node":{"id":"84876745-cbfb-5c1d-9f6c-7c74338d5d28","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.site.serverless.com/images/champions/champions_banner.jpg","authors":["RupakGanguly"],"categories":["news","engineering-culture"],"date":"2018-04-10T00:00:00.000Z","title":"2018 年首批无服务器社区冠军介绍","description":"无服务器社区冠军是无服务器社区的领导者。快来认识一下我们 2018 年度的社区英雄吧！","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":194,"sentences":32,"paragraphs":32},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-04-10-announcing-new-2018-serverless-champions.md","fields":{"slug":"/blog/2018-04-10-announcing-new-2018-serverless-champions/","keywords":["serverless","webpack","无服务器","无服务器架构","服务器","serverless","champions","架构","blog","github","框架"]}}},{"node":{"id":"1e1a90fc-3b65-540c-b726-755999e7912a","frontmatter":{"thumbnail":"https://main.qcloudimg.com/raw/8a0db1c9fd8b51c15d0b006291d52bf5.jpg","authors":["AndreaPasswater"],"categories":["news","engineering-culture"],"date":"2018-07-19T00:00:00.000Z","title":"2018 年社区调查：Serverless 使用率大幅增长","description":"我们曾在开发社区进行问卷调查，询问 Serverless 的使用情况。它的使用率增长连我们自己都惊讶不已，下面来看看数据。","authorslink":["https://serverless.com/author/andreapasswater/"],"translators":["Aceyclee"],"translatorslink":["https://www.zhihu.com/people/Aceyclee"],"tags":["Component","Serverless"],"keywords":"Serverless 社区调查,Serverless 使用情况,Serverless 数据","outdated":null},"wordCount":{"words":267,"sentences":50,"paragraphs":49},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-07-19-2018-serverless-community-survey-huge-growth-usage.md","fields":{"slug":"/blog/2018-07-19-2018-serverless-community-survey-huge-growth-usage/","keywords":["go","serverless","无服务器","Serverless","serverless"]}}},{"node":{"id":"8311b008-2b15-5225-8adc-9b75e484177b","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020414/1586880819419-%E5%B0%81%E9%9D%A2%E5%9B%BE%20%286%29.png","authors":["serverless 社区"],"categories":["news"],"date":"2019-04-08T00:00:00.000Z","title":"邀您参加 | K8S&云原生技术开放日-北京站","description":"K8S&云原生技术开放日，将围绕K8S、Serverless等云原生相关技术，从最佳落地实践、不同场景技术改造、应用优化，到开源领域深度技术研究，和技术爱好者们一起探讨。","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["云原生","Serverless"],"keywords":"serverless 入门,serverless 框架,腾讯云 serverless","outdated":null},"wordCount":{"words":36,"sentences":9,"paragraphs":9},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-04-08-k8s.md","fields":{"slug":"/blog/2019-04-08-k8s/","keywords":["serverless","云原生","serverless","Serverless","技术","原生","serverlesscloud","github"]}}},{"node":{"id":"25f709db-cde0-59d7-81f4-944c46a6dd8a","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020414/1586880571672-%E5%B0%81%E9%9D%A2%E5%9B%BE%20%285%29.png","authors":["serverless 社区"],"categories":["news"],"date":"2019-04-04T00:00:00.000Z","title":"Serverless 技术风暴来袭，开发者该如何应对？","description":"Hello Serverless技术沙龙北京站，将围绕Serverless的应用场景，客户案例，FaaS+BaaS架构的实现方案等，针对未来的无服务形态进行交流和讨论，释放技术想象！","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["应用场景","Serverless"],"keywords":"serverless 入门,serverless 框架,腾讯云 serverless","outdated":null},"wordCount":{"words":37,"sentences":8,"paragraphs":8},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-04-04-technology-storm.md","fields":{"slug":"/blog/2019-04-04-technology-storm/","keywords":["serverless","Serverless","serverless","serverlesscloud","github","技术","架构","围绕"]}}},{"node":{"id":"4bc4d946-6187-5c3d-91c6-d98c4c4c1314","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020414/1586880172144-%E5%B0%81%E9%9D%A2%E5%9B%BE%20%284%29.png","authors":["serverless 社区"],"categories":["news"],"date":"2019-06-11T00:00:00.000Z","title":"一图读懂无服务器云函数","description":"本图将重要信息进行梳理和提炼，帮助读者更好的理解无服务器云函数的理念和作用","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["云函数","Serverless"],"keywords":"serverless 入门,serverless 框架,腾讯云 serverless","outdated":null},"wordCount":{"words":31,"sentences":6,"paragraphs":6},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-06-11-one-picture-serverless-cloud-function.md","fields":{"slug":"/blog/2019-06-11-one-picture-serverless-cloud-function/","keywords":["serverless","无服务器","无服务器云函数","云函数","serverless","serverlesscloud","Serverless","github","开发者","函数"]}}},{"node":{"id":"1cd76f95-14a9-5fd5-926b-456af189b7ed","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020326/1585217744291-%E6%91%84%E5%9B%BE%E7%BD%91_400730082_wx.jpg","authors":["朱峰 Ben"],"categories":["news"],"date":"2019-10-14T00:00:00.000Z","title":"由浅入深说 Serverless 之云函数的生命周期","description":"希望通过文章分享帮助大家更深入的了解 Serverless 背后的机制并掌握相关的最佳实践。","authorslink":["https://github.com/jiangliu5267"],"translators":null,"translatorslink":null,"tags":["云函数"],"keywords":"Serverless, Serverless前端开发, Serverless云函数","outdated":null},"wordCount":{"words":74,"sentences":29,"paragraphs":29},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-10-14-serverless-cloud-function.md","fields":{"slug":"/blog/2019-10-14-serverless-cloud-function/","keywords":["faas","java","云函数","函数","触发","实例","事件","数据库","启动","连接","sql","代码"]}}},{"node":{"id":"4f16f8bc-1a35-5394-9029-f7abc2ad6137","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/qianyi/images/YHl6UWa9s629ucl0iaVcic8rL06uEBM5go4LSXiaHnibDJSBjLGAhGlWz3QZ1RZzd3NeCibjJxOyUApDO7TaPYcwxsw.jpg","authors":["Serverless 中文网"],"categories":["news"],"date":"2019-10-26T00:00:00.000Z","title":"Hello Serverless 实战沙龙回顾","description":"2019 年 10 月 26 日，Hello Serverless 沙龙活动在广州市海珠区腾讯众创空间成功举办，一起看看我们都为大家准备了哪些精彩的演讲吧！","authorslink":["https://github.com/jiangliu5267"],"translators":null,"translatorslink":null,"tags":["Meetup"],"keywords":"Serverless, Serverless技术沙龙,Hello Serverless","outdated":null},"wordCount":{"words":64,"sentences":13,"paragraphs":13},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-10-26-hello-serverless-meetup.md","fields":{"slug":"/blog/2019-10-26-hello-serverless-meetup/","keywords":["go","serverless","云函数","云原生","Serverless","存储","腾讯","serverlesscloud"]}}}],"totalCount":46}},"pageContext":{"isCreatedByStatefulCreatePages":false,"blogId":"c257edca-5de8-5371-8181-9fb38d9cc74d","previousBlogId":"5334c37e-5036-5cdb-9610-2316a542eac3","nextBlogId":"ddfeb84b-7b61-5d10-beea-74eae6fcd9aa","categories":["news"]}}}