Skip to Content
监控运维实践:原则与策略
book

监控运维实践:原则与策略

by Mike Julian
November 2020
Intermediate to advanced
142 pages
3h 12m
Chinese
Posts & Telecom Press
Content preview from 监控运维实践:原则与策略
前端监控
61
如果你更喜欢使用现有的工具,比如
StatsD
Graphite
,那么你会遇到一些困难。将数据
JavaScript
发送到
UDP/TCP
套接字并不简单,但是
StatsD
的后端可以接受
HTTP
POST
更可行的是(我建议这样做),如果你正在做前端监控,那么你将选择一个专门的
SaaS
品。它们带有专用的测量库,使用起来非常简单。在底层,它们利用了我们讨论过的
API
只是以一种非常易用的方式,再加上优秀的仪表板。如果你不走这条路,
Google Analytics
可能是你最好的选择,特别是当你运行一个只有少量基础设施的小型网站的时候。
6.4
 日志
如果你接触过
JavaScript
,那么可能已经熟悉
console
语句了。
console
主要用于调试和开
发目的。例如:
console.log("
此语句记录一个条目
");
。这类调试语句当然很有用,但不
幸的是,当你希望知道生产中的错误时,这些语句就不那么有用了。毕竟,你不希望用户
的浏览器控制台充斥着为你准备的消息。为了在生产环境中进行日志记录,你需要更健壮
的工具。
不幸的是,这方面的选择有限。没有太多像
syslog
这样的通用日志基础组件,这导致出现
了几十个质量参差不齐的库,它们基本上试图实现相同的目标——将日志条目发送到某个
地方。
但是,如果你可以使用
SaaS
产品,那么你的选择就会大大增加:有好几种产品可以用来
处理所有困难的部分,从在
JavaScript
中收集异常和日志语句,到将其发送到托管服务。
搜索一下“异常跟踪
SaaS
”,你会发现很多不错的选择。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java数据科学实战

Java数据科学实战

Michael R. Brzustowicz, PhD
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua
Python面向对象编程指南

Python面向对象编程指南

Posts & Telecom Press, Steven F. Lott

Publisher Resources

ISBN: 9787115550750