构建可观察服务的5种设计模式

How can you make your services observable and embrace service ownership? This article presents a variety of universally applicable design patterns for the developer to consider.

如何使你的服务可被观察并接受服务所有权?本文介绍了各种普遍适用的设计模式,供开发者考虑。

Design patterns in software development are repeatable solutions and best practices for solving commonly occurring problems. Even in the case of service monitoring, design patterns, when used appropriately, can help teams embrace service ownership and troubleshoot their services in production. You can think of service monitoring design patterns in three categories:

软件开发中的设计模式是解决经常发生的问题的可重复的解决方案和最佳实践。即使是在服务监控方面,如果使用得当,设计模式也可以帮助团队接受服务所有权,并在生产中对服务进行故障排除。你可以把服务监控的设计模式分为三类。

  1. **Health Checks
    **How do you know that your service is running — and, if it is — also doing what it’s supposed to be doing? Is it responding in a timely manner? Are there potential service issues that you can address before they affect customers?
  2. **健康检查
    **你如何知道你的服务正在运行--而且,如果它正在运行--也在做它应该做的事情?它是否及时作出反应?是否有潜在的服务问题,你可以在它们影响客户之前解决?
  3. **Real time Alerting
    **When something does go wrong — such as your service becoming unresponsive, slowing to a crawl, or using too many resources — do you have alerts that you configured to notify you of that issue?
  4. **实时警报
    **当某些事情出错时--比如你的服务变得没有反应,速度变慢,或者使用了太多的资源--你是否有配置的警报来通知你这个问题?
  5. **Troubleshooting
    **Has something gone wrong with your service? If it has, you probably need to know three things: when it happened, where it happened, and what caused it to happen. Use logs and traces to diagnose issues after they occur, and update your service so that those issues do not have lasting customer impacts.
  6. **故障排除
    **你的服务出了问题吗?如果发生了,你可能需要知道三件事:什么时候发生的,在哪里发生的,以及是什么导致的。在问题发生后,使用日志和痕迹来诊断问题,并更新你的服务,使这些问题不会对客户产生持久的影响。

Let’s look at the patterns (and a few anti-patterns!) for each of these categories in turn.

让我们依次看一下这些类别的模式(和一些反模式!)。

Health Checks

健康检查

The two patterns for health checks are the outside-in health check, which verifies that your service is running and determines response time / latency from your service, and ...

开通本站会员,查看完整译文。

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.124.0. UTC+08:00, 2024-05-02 02:02
浙ICP备14020137号-1 $访客地图$