{"id":71,"date":"2026-09-01T01:23:02","date_gmt":"2026-08-31T17:23:02","guid":{"rendered":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/01\/observability-opentelemetry-practice\/"},"modified":"2026-09-02T00:40:39","modified_gmt":"2026-09-01T16:40:39","slug":"observability-opentelemetry-practice","status":"publish","type":"post","link":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/01\/observability-opentelemetry-practice\/","title":{"rendered":"\u53ef\u89c2\u6d4b\u6027\u843d\u5730\u5b9e\u6218\uff1aOpenTelemetry + Prometheus + Grafana \u4e00\u6761\u9f99"},"content":{"rendered":"<div style=\"font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",sans-serif;font-size:16.5px;line-height:1.9;color:#35435c;letter-spacing:.2px\">\n<div style=\"background:linear-gradient(135deg,#f5f9ff,#eef5ff);border:1px solid #dce8f8;border-left:4px solid #2f9ee0;border-radius:12px;padding:16px 20px;margin:0 0 24px;font-size:14.5px;color:#3d5570;line-height:2\"><span style=\"display:inline-block;background:#2f9ee0;color:#fff;font-size:12.5px;font-weight:700;padding:3px 10px;border-radius:6px;margin-right:12px;letter-spacing:1px;vertical-align:1px\">\u5173\u952e\u8bcd<\/span>\u53ef\u89c2\u6d4b\u6027\u3001OpenTelemetry\u3001Prometheus\u3001Grafana\u3001\u94fe\u8def\u8ffd\u8e2a\u3001SLO\u3001MTTR<\/div>\n<div style=\"background:#fafbfd;border:1px solid #e8edf5;border-radius:12px;padding:18px 22px;margin:0 0 30px\">\n<div style=\"font-size:13.5px;font-weight:700;color:#8a99ae;letter-spacing:2px;margin-bottom:12px\">\u76ee\u5f55<\/div>\n<ol style=\"margin:0;padding-left:20px\">\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-1\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e00\u3001\u5148\u5206\u6e05\u4e09\u6839\u652f\u67f1<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-2\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e8c\u3001\u6807\u51c6\u94fe\u8def\u600e\u4e48\u642d<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-3\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e09\u3001\u56db\u4e2a\u6700\u5bb9\u6613\u505a\u9519\u7684\u5730\u65b9<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-4\" style=\"color:#42546e;text-decoration:none;border:none\">\u56db\u3001\u843d\u5730\u8282\u594f\u5efa\u8bae<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-5\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e94\u3001\u4e0e\u4e91\u539f\u751f\u73af\u5883\u7684\u914d\u5408<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-6\" style=\"color:#42546e;text-decoration:none;border:none\">\u516d\u3001\u5c0f\u7ed3<\/a><\/li>\n<\/ol>\n<\/div>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><span style=\"font-size:17px;color:#1e2f47\">&#8220;\u7cfb\u7edf\u53c8\u6162\u4e86&#8221;\u2014\u2014\u5982\u679c\u8fd9\u53e5\u8bdd\u4e4b\u540e\u9700\u8981\u534a\u5c0f\u65f6\u624d\u80fd\u5b9a\u4f4d\u5230\u539f\u56e0\uff0c\u8bf4\u660e\u4f60\u7684\u53ef\u89c2\u6d4b\u6027\u8fd8\u505c\u7559\u5728&#8221;\u6709\u65e5\u5fd7&#8221;\u7684\u9636\u6bb5\u30022026 \u5e74\uff0c\u53ef\u89c2\u6d4b\u6027\u7684\u6807\u51c6\u7b54\u6848\u5df2\u7ecf\u6536\u655b\u4e3a\u4e00\u6761\u6e05\u6670\u7684\u94fe\u8def\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">OpenTelemetry \u91c7\u96c6 \u2192 Prometheus \u5b58\u50a8\u6307\u6807 \u2192 Grafana \u5c55\u793a\u4e0e\u544a\u8b66<\/strong>\uff0c\u914d\u5408\u94fe\u8def\u8ffd\u8e2a\u5b9a\u4f4d\u8de8\u670d\u52a1\u95ee\u9898\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u672c\u6587\u7ed9\u51fa\u4e00\u6761\u53ef\u7167\u6284\u7684\u843d\u5730\u8def\u5f84\uff0c\u4ee5\u53ca\u56db\u4e2a\u6700\u5bb9\u6613\u505a\u9519\u7684\u5730\u65b9\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #2f9ee0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-1\">\u4e00\u3001\u5148\u5206\u6e05\u4e09\u6839\u652f\u67f1<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5f88\u591a\u56e2\u961f\u628a&#8221;\u76d1\u63a7&#8221;\u548c&#8221;\u53ef\u89c2\u6d4b\u6027&#8221;\u6df7\u4e3a\u4e00\u8c08\uff0c\u7ed3\u679c\u5806\u4e86\u4e00\u5806\u56fe\u8868\u5374\u4f9d\u7136\u67e5\u4e0d\u51fa\u95ee\u9898\u3002\u533a\u522b\u5728\u4e8e\u95ee\u7684\u95ee\u9898\u4e0d\u540c\uff1a<\/p>\n<figure style=\"margin:30px 0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"900\" src=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/observability-opentelemetry-practice-fig-1.png\" alt=\"\u4ece\u53d1\u73b0\u5230\u5f52\u56e0\u7684\u6392\u67e5\u95ed\u73af\" class=\"wp-image-136\" style=\"max-width:100%;height:auto;border-radius:12px;border:1px solid #e6ecf4;box-shadow:0 8px 24px rgba(15,30,60,.07)\" srcset=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/observability-opentelemetry-practice-fig-1.png 1200w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/observability-opentelemetry-practice-fig-1-300x225.png 300w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/observability-opentelemetry-practice-fig-1-1024x768.png 1024w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/observability-opentelemetry-practice-fig-1-768x576.png 768w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/observability-opentelemetry-practice-fig-1-800x600.png 800w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><figcaption style=\"margin-top:12px;font-size:13.5px;color:#7b8aa0;text-align:center;line-height:1.75\">\u53ef\u89c2\u6d4b\u6027\u4e09\u652f\u67f1\uff1a\u6307\u6807\u53d1\u73b0\u3001\u94fe\u8def\u5b9a\u4f4d\u3001\u65e5\u5fd7\u5f52\u56e0<\/figcaption><\/figure>\n<figure class=\"wp-block-table\">\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;font-size:15px;border:1px solid #e3eaf3;border-radius:10px;overflow:hidden\">\n<thead>\n<tr>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u652f\u67f1<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u56de\u7b54\u4ec0\u4e48\u95ee\u9898<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u5178\u578b\u6570\u636e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">Metrics \u6307\u6807<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u6709\u6ca1\u6709\u95ee\u9898\uff1f\u6709\u591a\u4e25\u91cd\uff1f<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">QPS\u3001\u5ef6\u8fdf\u5206\u4f4d\u3001\u9519\u8bef\u7387\u3001\u9971\u548c\u5ea6<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">Logs \u65e5\u5fd7<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u5177\u4f53\u53d1\u751f\u4e86\u4ec0\u4e48\uff1f<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u7ed3\u6784\u5316\u4e8b\u4ef6\u3001\u9519\u8bef\u5806\u6808<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">Traces \u94fe\u8def<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u95ee\u9898\u51fa\u5728\u54ea\u4e2a\u73af\u8282\uff1f<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u8de8\u670d\u52a1\u8c03\u7528\u94fe\u3001Span \u8017\u65f6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u6307\u6807\u7528\u4e8e\u53d1\u73b0\uff0c\u94fe\u8def\u7528\u4e8e\u5b9a\u4f4d\uff0c\u65e5\u5fd7\u7528\u4e8e\u5f52\u56e0\u3002<\/strong> \u4e09\u8005\u7f3a\u4e00\u4e2a\uff0c\u6392\u67e5\u94fe\u8def\u5c31\u4f1a\u65ad\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #2f9ee0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-2\">\u4e8c\u3001\u6807\u51c6\u94fe\u8def\u600e\u4e48\u642d<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2f9ee040\">1. \u91c7\u96c6\uff1aOpenTelemetry \u7edf\u4e00 SDK<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">OpenTelemetry\uff08\u7b80\u79f0 OTel\uff09\u5df2\u6210\u4e3a\u4e8b\u5b9e\u6807\u51c6\uff1a\u4e00\u5957 SDK + \u534f\u8bae\uff08OTLP\uff09\u540c\u65f6\u8f93\u51fa\u6307\u6807\u3001\u65e5\u5fd7\u3001\u94fe\u8def\uff0c\u907f\u514d\u88ab\u5355\u4e00\u5382\u5546\u7ed1\u5b9a\u3002<\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\"># OpenTelemetry Collector \u6700\u5c0f\u914d\u7f6e\u793a\u610f\nreceivers:\n  otlp:\n    protocols:\n      grpc:\n        endpoint: 0.0.0.0:4317\n\nprocessors:\n  batch: {}\n  memory_limiter:\n    check_interval: 1s\n    limit_percentage: 80\n\nexporters:\n  prometheus:\n    endpoint: 0.0.0.0:8889\n\nservice:\n  pipelines:\n    metrics:\n      receivers: [otlp]\n      processors: [memory_limiter, batch]\n      exporters: [prometheus]\n<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u7528 Collector \u505a\u4e2d\u95f4\u5c42\u7684\u4ef7\u503c\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u5e94\u7528\u53ea\u5bf9\u63a5 OTLP\uff0c\u540e\u7aef\u5b58\u50a8\u53ef\u968f\u65f6\u66ff\u6362<\/strong>\uff0c\u4e0d\u7528\u6539\u4e00\u884c\u4e1a\u52a1\u4ee3\u7801\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2f9ee040\">2. \u5b58\u50a8\u4e0e\u67e5\u8be2\uff1aPrometheus<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">Prometheus \u7528\u62c9\u53d6\u6a21\u578b + \u65f6\u5e8f\u6570\u636e\u5e93 + PromQL\uff0c\u9002\u5408\u5b58\u6307\u6807\u3002\u6ce8\u610f\u5b83\u7684\u5b9a\u4f4d\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u5b83\u662f\u6307\u6807\u7cfb\u7edf\uff0c\u4e0d\u662f\u65e5\u5fd7\u7cfb\u7edf<\/strong>\uff0c\u522b\u5f80 label \u91cc\u585e\u9ad8\u57fa\u6570\u7ef4\u5ea6\uff08\u5982\u7528\u6237 ID\u3001\u8ba2\u5355\u53f7\uff09\uff0c\u5426\u5219\u4f1a\u628a\u5b58\u50a8\u6253\u7206\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2f9ee040\">3. \u5c55\u793a\u4e0e\u544a\u8b66\uff1aGrafana<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8d1f\u8d23\u4eea\u8868\u76d8\u3001\u544a\u8b66\u89c4\u5219\u4e0e\u901a\u77e5\u8def\u7531\u3002\u544a\u8b66\u8bbe\u8ba1\u7684\u6838\u5fc3\u539f\u5219\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u53ea\u544a\u8b66\u53ef\u884c\u52a8\u7684\u5f02\u5e38<\/strong>\u2014\u2014\u51e1\u662f\u6536\u5230\u544a\u8b66\u5374\u4e0d\u9700\u8981\u505a\u4efb\u4f55\u4e8b\u7684\u89c4\u5219\uff0c\u90fd\u8be5\u5220\u6389\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #2f9ee0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-3\">\u4e09\u3001\u56db\u4e2a\u6700\u5bb9\u6613\u505a\u9519\u7684\u5730\u65b9<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2f9ee040\">\u2460 \u9ad8\u57fa\u6570\u6807\u7b7e\u628a\u5b58\u50a8\u6253\u7206<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u628a <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">user_id<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">trace_id<\/code>\u3001URL \u91cc\u7684\u52a8\u6001\u53c2\u6570\u4f5c\u4e3a label\uff0c\u4f1a\u8ba9\u65f6\u95f4\u5e8f\u5217\u6570\u91cf\u6307\u6570\u7ea7\u81a8\u80c0\u3002<strong style=\"color:#0f1c2e;font-weight:600\">label \u53ea\u653e\u4f4e\u57fa\u6570\u7ef4\u5ea6<\/strong>\uff08\u670d\u52a1\u540d\u3001\u65b9\u6cd5\u3001\u72b6\u6001\u7801\u3001\u673a\u623f\uff09\uff0c\u9ad8\u57fa\u6570\u4fe1\u606f\u653e\u94fe\u8def\u6216\u65e5\u5fd7\u91cc\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2f9ee040\">\u2461 \u53ea\u770b\u5e73\u5747\u5ef6\u8fdf<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5e73\u5747\u5ef6\u8fdf\u4f1a\u63a9\u76d6\u957f\u5c3e\u95ee\u9898\u3002P50 \u6b63\u5e38\u3001P99 \u7206\u70b8\u662f\u6700\u5e38\u89c1\u7684\u6545\u969c\u5f62\u6001\u3002<strong style=\"color:#0f1c2e;font-weight:600\">\u4e00\u5f8b\u7528\u5206\u4f4d\u6570\uff08P95\/P99\uff09\u5b9a\u4e49 SLO<\/strong>\uff0c\u544a\u8b66\u4e5f\u57fa\u4e8e\u5206\u4f4d\u6570\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2f9ee040\">\u2462 \u94fe\u8def\u91c7\u6837\u7387\u62cd\u8111\u888b<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5168\u91cf\u91c7\u6837\u6210\u672c\u9ad8\u3001\u5934\u90e8\u91c7\u6837\u4f1a\u6f0f\u6389\u9519\u8bef\u8bf7\u6c42\u3002\u5b9e\u8df5\u5efa\u8bae\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u4f4e\u6bd4\u4f8b\u5934\u90e8\u91c7\u6837 + \u9519\u8bef\u4e0e\u6162\u8bf7\u6c42\u5168\u91c7<\/strong>\uff08\u5c3e\u90e8\u91c7\u6837\uff09\uff0c\u65e2\u63a7\u6210\u672c\u53c8\u4fdd\u7559\u5173\u952e\u73b0\u573a\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2f9ee040\">\u2463 \u65e5\u5fd7\u6ca1\u6709\u7ed3\u6784\u5316<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u7eaf\u6587\u672c\u65e5\u5fd7\u65e0\u6cd5\u805a\u5408\u5206\u6790\u3002\u7edf\u4e00\u8f93\u51fa JSON \u7ed3\u6784\uff0c\u5e76\u5728\u65e5\u5fd7\u91cc\u5e26\u4e0a <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">trace_id<\/code>\uff0c\u5b9e\u73b0<strong style=\"color:#0f1c2e;font-weight:600\">\u4ece\u6307\u6807\u544a\u8b66 \u2192 \u94fe\u8def \u2192 \u65e5\u5fd7<\/strong>\u7684\u4e00\u952e\u8df3\u8f6c\uff0c\u8fd9\u624d\u662f\u6392\u67e5\u63d0\u901f\u7684\u5173\u952e\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #2f9ee0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-4\">\u56db\u3001\u843d\u5730\u8282\u594f\u5efa\u8bae<\/h2>\n<ol style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u7b2c\u4e00\u5468\uff1a\u6307\u6807\u5148\u884c\u3002<\/strong> \u63a5\u5165 OTel SDK\uff0c\u5148\u8986\u76d6 RED \u4e09\u6307\u6807\uff08Rate \u8bf7\u6c42\u91cf\u3001Errors \u9519\u8bef\u7387\u3001Duration \u8017\u65f6\uff09\uff0c\u8ba9\u6838\u5fc3\u670d\u52a1\u6709\u56fe\u53ef\u770b\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u7b2c\u4e8c\u5468\uff1a\u8865\u94fe\u8def\u3002<\/strong> \u6253\u901a\u8de8\u670d\u52a1\u8c03\u7528\u94fe\uff0c\u786e\u8ba4 trace \u80fd\u8d2f\u7a7f\u7f51\u5173 \u2192 \u4e1a\u52a1 \u2192 \u6570\u636e\u5e93\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u7b2c\u4e09\u5468\uff1a\u65e5\u5fd7\u5173\u8054\u3002<\/strong> \u65e5\u5fd7\u6ce8\u5165 trace_id\uff0c\u5b9e\u73b0\u4e09\u652f\u67f1\u8054\u52a8\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u7b2c\u56db\u5468\uff1a\u5b9a SLO \u4e0e\u544a\u8b66\u3002<\/strong> \u57fa\u4e8e\u771f\u5b9e\u6570\u636e\u8bbe\u5b9a\u9608\u503c\uff0c\u6e05\u7406\u65e0\u6548\u544a\u8b66\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u6301\u7eed\uff1a\u505a\u4e00\u6b21\u6545\u969c\u6f14\u7ec3\u3002<\/strong> \u6545\u610f\u6ce8\u5165\u5ef6\u8fdf\u6216\u9519\u8bef\uff0c\u68c0\u9a8c\u6574\u6761\u94fe\u8def\u80fd\u5426\u5728 5 \u5206\u949f\u5185\u5b9a\u4f4d\u3002<\/li>\n<\/ol>\n<blockquote style=\"margin:24px 0;padding:16px 22px;background:#f7fafd;border-left:4px solid #2f9ee0;border-radius:0 10px 10px 0;color:#4a5b73;font-size:15.6px;line-height:1.88\">\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8861\u91cf\u53ef\u89c2\u6d4b\u6027\u5efa\u8bbe\u662f\u5426\u6210\u529f\u7684\u552f\u4e00\u6807\u51c6\u662f <strong style=\"color:#0f1c2e;font-weight:600\">MTTR\uff08\u5e73\u5747\u4fee\u590d\u65f6\u95f4\uff09<\/strong>\u3002\u56fe\u8868\u518d\u591a\uff0c\u5982\u679c\u4e0d\u80fd\u7f29\u77ed\u5b9a\u4f4d\u65f6\u95f4\uff0c\u5c31\u53ea\u662f\u88c5\u9970\u54c1\u3002<\/p>\n<\/blockquote>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #2f9ee0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-5\">\u4e94\u3001\u4e0e\u4e91\u539f\u751f\u73af\u5883\u7684\u914d\u5408<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5728 Kubernetes \u73af\u5883\uff08\u5f53\u524d\u4e3b\u7ebf\u7248\u672c\u5df2\u5230 1.37\uff09\u4e2d\uff0c\u5efa\u8bae\u628a OTel Collector \u4ee5 <strong style=\"color:#0f1c2e;font-weight:600\">DaemonSet + Gateway<\/strong> \u4e24\u5c42\u90e8\u7f72\uff1a\u8282\u70b9\u7ea7 Agent \u8d1f\u8d23\u91c7\u96c6\uff0c\u4e2d\u5fc3 Gateway \u8d1f\u8d23\u7edf\u4e00\u5904\u7406\u4e0e\u5bfc\u51fa\u3002\u8fd9\u6837\u65e2\u964d\u4f4e\u5e94\u7528\u4fa7\u8d1f\u62c5\uff0c\u53c8\u4fbf\u4e8e\u96c6\u4e2d\u6cbb\u7406\u91c7\u6837\u4e0e\u8131\u654f\u7b56\u7565\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #2f9ee0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-6\">\u516d\u3001\u5c0f\u7ed3<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u53ef\u89c2\u6d4b\u6027\u4e0d\u662f\u4e70\u4e00\u5957\u5e73\u53f0\uff0c\u800c\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u5efa\u7acb&#8221;\u53d1\u73b0\u2014\u5b9a\u4f4d\u2014\u5f52\u56e0&#8221;\u7684\u95ed\u73af\u80fd\u529b<\/strong>\u3002\u6280\u672f\u9009\u578b\u4e0a\uff0cOpenTelemetry + Prometheus + Grafana \u5df2\u662f\u7a33\u59a5\u7684\u9ed8\u8ba4\u7ec4\u5408\uff1b\u5de5\u7a0b\u4e0a\uff0c\u63a7\u5236\u57fa\u6570\u3001\u5173\u6ce8\u5206\u4f4d\u3001\u5173\u8054\u4e09\u652f\u67f1\uff0c\u624d\u662f\u771f\u6b63\u51b3\u5b9a\u6210\u8d25\u7684\u7ec6\u8282\u3002<\/p>\n<hr style=\"border:none;border-top:1px solid #eaeef4;margin:34px 0\">\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><em style=\"color:#5a6b85;font-style:normal;background:#2f9ee01f;padding:1px 4px;border-radius:4px\">\u53c2\u8003\uff1a<a href=\"https:\/\/opentelemetry.io\/docs\/\" target=\"_blank\" rel=\"noopener\" style=\"color:#2f9ee0;text-decoration:none;border-bottom:1px solid #2f9ee066;transition:opacity .15s\">OpenTelemetry \u5b98\u65b9\u6587\u6863<\/a>\u3001<a href=\"https:\/\/prometheus.io\/docs\/\" target=\"_blank\" rel=\"noopener\" style=\"color:#2f9ee0;text-decoration:none;border-bottom:1px solid #2f9ee066;transition:opacity .15s\">Prometheus \u5b98\u65b9\u6587\u6863<\/a>\u3001<a href=\"https:\/\/grafana.com\/docs\/\" target=\"_blank\" rel=\"noopener\" style=\"color:#2f9ee0;text-decoration:none;border-bottom:1px solid #2f9ee066;transition:opacity .15s\">Grafana \u5b98\u65b9\u6587\u6863<\/a>\u3002Kubernetes \u7248\u672c\u4fe1\u606f\u53c2\u8003 <a href=\"https:\/\/endoflife.date\/api\/kubernetes.json\" target=\"_blank\" rel=\"noopener\" style=\"color:#2f9ee0;text-decoration:none;border-bottom:1px solid #2f9ee066;transition:opacity .15s\">endoflife.date<\/a>\uff0c\u91c7\u96c6\u4e8e 2026 \u5e74 9 \u6708 1 \u65e5\u3002<\/em><\/p>\n<div style=\"margin:42px 0 0;padding:22px 0 0;border-top:1px solid #eaeef4\">\n<div style=\"font-size:13px;color:#93a1b5;letter-spacing:1px;margin-bottom:12px\">\u6807\u7b7e<\/div>\n<p><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u53ef\u89c2\u6d4b\u6027<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#OpenTelemetry<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#Prometheus<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#DevOps<\/span><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u53ef\u89c2\u6d4b\u6027\u7684\u6807\u51c6\u7b54\u6848\u5df2\u6536\u655b\u4e3a OTel \u91c7\u96c6 + Prometheus \u5b58\u50a8 + Grafana \u5c55\u793a\u3002\u672c\u6587\u7ed9\u51fa\u4e09\u6839\u652f\u67f1\u7684\u5206\u5de5\u3001Collector \u6700\u5c0f\u914d\u7f6e\u3001\u56db\u4e2a\u6700\u5bb9\u6613\u505a\u9519\u7684\u5730\u65b9\uff0c\u4ee5\u53ca\u56db\u5468\u843d\u5730\u8282\u594f\u3002<\/p>\n","protected":false},"author":1,"featured_media":135,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,1],"tags":[55,53,54,52],"class_list":["post-71","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-engineering-practice","category-technical","tag-devops","tag-opentelemetry","tag-prometheus","tag-52"],"_links":{"self":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":2,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":182,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/71\/revisions\/182"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media\/135"}],"wp:attachment":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}