{"id":35446,"date":"2025-03-19T09:54:45","date_gmt":"2025-03-19T01:54:45","guid":{"rendered":"https:\/\/www.yunshan.net\/blog\/?p=35446"},"modified":"2025-03-19T09:54:45","modified_gmt":"2025-03-19T01:54:45","slug":"%e5%a6%82%e4%bd%95%e9%80%9a%e8%bf%87opentelemetry%e5%ae%9e%e7%8e%b0%e7%9b%91%e6%8e%a7%e6%95%b0%e6%8d%ae%e7%9a%84%e8%87%aa%e5%8a%a8%e5%bd%92%e6%a1%a3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yunshan.net\/blog\/archives\/35446.html","title":{"rendered":"\u5982\u4f55\u901a\u8fc7OpenTelemetry\u5b9e\u73b0\u76d1\u63a7\u6570\u636e\u7684\u81ea\u52a8\u5f52\u6863\uff1f"},"content":{"rendered":"<p style=\"text-align: center;\">\n<p><img decoding=\"async\" src=\"https:\/\/www.yunshan.net\/blog\/wp-content\/uploads\/2025\/03\/Tza9N2611.jpg\" alt=\"\u5982\u4f55\u901a\u8fc7OpenTelemetry\u5b9e\u73b0\u76d1\u63a7\u6570\u636e\u7684\u81ea\u52a8\u5f52\u6863\uff1f\" ><\/p>\n<\/p>\n<hr>\n<p>\u5728\u6570\u5b57\u5316\u6d6a\u6f6e\u5e2d\u5377\u5168\u7403\u7684\u4eca\u5929\uff0c\u4e00\u4e2a\u4e2d\u7b49\u89c4\u6a21\u7684\u4e91\u539f\u751f\u7cfb\u7edf\u6bcf\u5929\u4ea7\u751f\u7684\u76d1\u63a7\u6307\u6807\u53ef\u80fd\u8d85\u8fc7<strong>10\u4ebf\u6761<\/strong>\u3002\u5f53\u8fd0\u7ef4\u56e2\u961f\u75b2\u4e8e\u5e94\u5bf9\u6d77\u91cf\u65e5\u5fd7\u3001\u6307\u6807\u548c\u94fe\u8def\u6570\u636e\u65f6\uff0c\u5982\u4f55\u8ba9\u8fd9\u4e9b\u5b9d\u8d35\u7684\u6570\u636e\u65e2\u80fd\u6ee1\u8db3\u5b9e\u65f6\u5206\u6790\u9700\u6c42\uff0c\u53c8\u4e0d\u81f3\u4e8e\u6210\u4e3a\u541e\u566c\u5b58\u50a8\u8d44\u6e90\u7684&rdquo;\u9ed1\u6d1e&rdquo;\uff1f\u8fd9\u6b63\u662f<strong><a href=\"https:\/\/www.yunshan.net\/\"   target=\"_blank\" style=\"color:blue\">OpenTelemetry<\/a>\u76d1\u63a7\u6570\u636e\u81ea\u52a8\u5f52\u6863<\/strong>\u6280\u672f\u8981\u89e3\u51b3\u7684\u6838\u5fc3\u547d\u9898\u3002<\/p>\n<p>\u4f5c\u4e3aCNCF\u6bd5\u4e1a\u7684<strong>\u53ef\u89c2\u6d4b\u6027\u9886\u57df\u6807\u51c6<\/strong>\uff0c<a href=\"https:\/\/www.yunshan.net\/\"   target=\"_blank\" style=\"color:blue\">OpenTelemetry<\/a>\uff08\u7b80\u79f0OTel\uff09\u6b63\u5728\u91cd\u5851\u73b0\u4ee3\u7cfb\u7edf\u7684\u76d1\u63a7\u8303\u5f0f\u3002\u4f46\u9c9c\u4e3a\u4eba\u77e5\u7684\u662f\uff0c\u5b83\u7684\u6570\u636e\u7ba1\u9053\u67b6\u6784\u4e2d\u57cb\u85cf\u7740\u5b9e\u73b0\u667a\u80fd\u6570\u636e\u6cbb\u7406\u7684\u5bc6\u94a5\u2014\u2014\u901a\u8fc7<strong>\u81ea\u52a8\u5316\u6d41\u6c34\u7ebf\u8bbe\u8ba1<\/strong>\uff0c\u6211\u4eec\u4e0d\u4ec5\u80fd\u6536\u96c6\u6570\u636e\uff0c\u66f4\u80fd\u6784\u5efa\u5177\u5907\u81ea\u7ba1\u7406\u80fd\u529b\u7684\u76d1\u63a7\u4f53\u7cfb\u3002<\/p>\n<hr>\n<h3 id=\"\u4e00-opentelemetry\u6570\u636e\u7ba1\u9053\u7684\u4e09\u5c42\u67b6\u6784\">\u4e00\u3001OpenTelemetry\u6570\u636e\u7ba1\u9053\u7684\u4e09\u5c42\u67b6\u6784<\/h3>\n<p>\u8981\u7406\u89e3\u81ea\u52a8\u5f52\u6863\u7684\u5b9e\u73b0\u903b\u8f91\uff0c\u9996\u5148\u8981\u5256\u6790OTel\u7684<strong>\u6570\u636e\u6d41\u8f6c\u6a21\u578b<\/strong>\u3002\u5176\u6838\u5fc3\u67b6\u6784\u5206\u4e3a\u4e09\u4e2a\u5173\u952e\u5c42\u7ea7\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u91c7\u96c6\u5c42\uff08Instrumentation\uff09<\/strong><br \/>\n\u901a\u8fc7\u81ea\u52a8\/\u624b\u52a8\u63d2\u6869\u6355\u83b7\u6307\u6807\uff08Metrics\uff09\u3001\u65e5\u5fd7\uff08Logs\uff09\u3001\u8ffd\u8e2a\uff08Traces\uff09\u4e09\u5143\u6570\u636e\u3002\u73b0\u4ee3\u670d\u52a1\u7f51\u683c\u67b6\u6784\u4e2d\uff0c<strong>Sidecar\u6a21\u5f0f<\/strong>\u7684\u4ee3\u7406\u7ec4\u4ef6\u80fd\u5b9e\u73b0\u96f6\u4ee3\u7801\u4fb5\u5165\u7684\u6570\u636e\u91c7\u96c6\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u5c42\uff08Collector\uff09<\/strong><br \/>\n\u5f00\u6e90Collector\u7ec4\u4ef6\u901a\u8fc7<strong>\u63a5\u6536\u5668\uff08Receiver\uff09<\/strong>\u3001<strong>\u5904\u7406\u5668\uff08Processor\uff09<\/strong>\u3001<strong>\u5bfc\u51fa\u5668\uff08Exporter\uff09<\/strong>\u7684\u4e09\u6bb5\u5f0f\u7ba1\u9053\uff0c\u5b8c\u6210\u6570\u636e\u6e05\u6d17\u3001\u5bcc\u5316\u3001\u8def\u7531\u7b49\u64cd\u4f5c\u3002\u8fd9\u91cc\u6b63\u662f\u5b9e\u65bd\u5f52\u6863\u7b56\u7565\u7684<strong>\u9ec4\u91d1\u63a7\u5236\u70b9<\/strong>\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5b58\u50a8\u5c42\uff08Backend\uff09<\/strong><br \/>\n\u652f\u6301\u5bf9\u63a5<a href=\"https:\/\/www.yunshan.net\/\"   target=\"_blank\" style=\"color:blue\">Prometheus<\/a>\u3001Loki\u3001Jaeger\u7b49\u4e3b\u6d41\u5b58\u50a8\u7cfb\u7edf\uff0c\u4ee5\u53caS3\u3001HDFS\u7b49\u5bf9\u8c61\u5b58\u50a8\u3002\u901a\u8fc7<strong>\u5206\u5c42\u5b58\u50a8\u7b56\u7565<\/strong>\u5b9e\u73b0\u70ed\u6570\u636e\u5feb\u901f\u8bbf\u95ee\u4e0e\u51b7\u6570\u636e\u7ecf\u6d4e\u5b58\u50a8\u7684\u7ed3\u5408\u3002<\/p>\n<\/li>\n<\/ol>\n<hr>\n<h3 id=\"\u4e8c-\u81ea\u52a8\u5f52\u6863\u7684\u4e09\u5927\u5b9e\u73b0\u8def\u5f84\">\u4e8c\u3001\u81ea\u52a8\u5f52\u6863\u7684\u4e09\u5927\u5b9e\u73b0\u8def\u5f84<\/h3>\n<h4 id=\"2-1-\u57fa\u4e8e\u89c4\u5219\u7684\u667a\u80fd\u8def\u7531\">2.1 \u57fa\u4e8e\u89c4\u5219\u7684\u667a\u80fd\u8def\u7531<\/h4>\n<p>\u5728Collector\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u901a\u8fc7<strong>\u8fc7\u6ee4\u5904\u7406\u5668\uff08Filter Processor\uff09<\/strong>\u8bbe\u5b9a\u5f52\u6863\u6761\u4ef6\u3002\u4f8b\u5982\uff0c\u5c06\u4e09\u5929\u524d\u7684DEBUG\u7ea7\u522b\u65e5\u5fd7\u8def\u7531\u5230\u51b7\u5b58\u50a8\uff1a<\/p>\n<pre><code class=\"language-yaml\">processors:  \r\nattributes\/archive:  \r\nactions:  \r\n- key: log.retention_days  \r\nvalue: 3  \r\naction: upsert  \r\nexporters:  \r\ns3\/archive:  \r\nendpoint: &quot;s3:\/\/monitoring-archive&quot;  \r\nloki\/prod:  \r\nendpoint: &quot;https:\/\/loki.prod:3100&quot;  \r\nservice:  \r\npipelines:  \r\nlogs:  \r\nreceivers: [otlp]  \r\nprocessors: [batch, attributes\/archive]  \r\nexporters: [s3\/archive, loki\/prod]  \r\n<\/code><\/pre>\n<p>\u8be5\u914d\u7f6e\u901a\u8fc7\u5c5e\u6027\u6807\u8bb0\u5b9e\u73b0<strong>\u52a8\u6001\u8def\u7531<\/strong>\uff0c\u5f53\u6570\u636e\u5e74\u9f84\u8d85\u8fc7\u9608\u503c\u65f6\u81ea\u52a8\u5207\u6362\u5b58\u50a8\u76ee\u7684\u5730\uff0c\u907f\u514d\u5728\u70ed\u5b58\u50a8\u4e2d\u5806\u79ef\u9648\u65e7\u6570\u636e\u3002<\/p>\n<h4 id=\"2-2-\u65f6\u5e8f\u6570\u636e\u5e93\u7684\u5185\u5efa\u7b56\u7565\">2.2 \u65f6\u5e8f\u6570\u636e\u5e93\u7684\u5185\u5efa\u7b56\u7565<\/h4>\n<p>\u5bf9\u4e8e<a href=\"https:\/\/www.yunshan.net\/\"   target=\"_blank\" style=\"color:blue\">Prometheus<\/a>\u7b49TSDB\uff08\u65f6\u5e8f\u6570\u636e\u5e93\uff09\uff0c\u53ef\u7ed3\u5408<strong>\u5b58\u50a8\u5377\u58f0\u660e(Storage Volume Claim)<\/strong>\u4e0e<strong>\u4fdd\u7559\u7b56\u7565(Retention Policy)<\/strong>\u3002Thanos\u6216Cortex\u7b49\u957f\u671f\u5b58\u50a8\u65b9\u6848\u652f\u6301<strong>\u964d\u91c7\u6837\uff08Downsampling\uff09<\/strong>\u6280\u672f\uff0c\u5c06\u5386\u53f2\u6570\u636e\u538b\u7f29\u5b58\u50a8\uff1a<\/p>\n<pre><code class=\"language-sql\">CREATE CONTINUOUS QUERY &quot;archive_metrics&quot; ON &quot;telegraf&quot;  \r\nBEGIN  \r\nSELECT mean(*) INTO &quot;archive&quot;.&quot;autogen&quot;.:MEASUREMENT  \r\nFROM \/.*\/ GROUP BY time(1h), *  \r\nEND  \r\n<\/code><\/pre>\n<p>\u8be5\u8bed\u53e5\u6bcf\u5c0f\u65f6\u6267\u884c\u4e00\u6b21\u5747\u503c\u8ba1\u7b97\uff0c\u5c06\u539f\u59cb\u6570\u636e\u805a\u5408\u6210\u4f4e\u7cbe\u5ea6\u7248\u672c\u540e\u5f52\u6863\uff0c\u5b58\u50a8\u7a7a\u95f4\u53ef\u7f29\u51cf\u81f3\u539f\u6765\u7684<strong><sup>1<\/sup>&frasl;<sub>60<\/sub><\/strong>\u3002<\/p>\n<h4 id=\"2-3-\u4e91\u539f\u751f\u5b58\u50a8\u7684\u81ea\u52a8\u5316\u6cbb\u7406\">2.3 \u4e91\u539f\u751f\u5b58\u50a8\u7684\u81ea\u52a8\u5316\u6cbb\u7406<\/h4>\n<p>\u5728Kubernetes\u73af\u5883\u4e2d\uff0c\u901a\u8fc7<strong>CSI\u9a71\u52a8<\/strong>\u5bf9\u63a5\u4e91\u5382\u5546\u7684\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u3002AWS S3\u7684\u667a\u80fd\u5206\u5c42(Intelligent-Tiering)\u529f\u80fd\u53ef\u57fa\u4e8e\u8bbf\u95ee\u6a21\u5f0f\u81ea\u52a8\u8f6c\u79fb\u6570\u636e\u5b58\u50a8\u5c42\u7ea7\uff1a<\/p>\n<pre><code class=\"language-yaml\">apiVersion: monitoring.grafana.com\/v1alpha1  \r\nkind: S3BucketConfig  \r\nmetadata:  \r\nname: metrics-archive  \r\nspec:  \r\nlifecycleRules:  \r\n- id: move_to_glacier  \r\nstatus: Enabled  \r\ntransition:  \r\ndays: 7  \r\nstorageClass: GLACIER  \r\n<\/code><\/pre>\n<p>\u8be5\u914d\u7f6e\u4f7f7\u5929\u672a\u8bbf\u95ee\u7684\u6570\u636e\u81ea\u52a8\u8f6c\u5165\u4f4e\u6210\u672c\u5b58\u50a8\u5c42\uff0c\u76f8\u6bd4\u6807\u51c6\u5b58\u50a8\u53ef\u8282\u7701<strong>40-70%<\/strong>\u7684\u6210\u672c\u3002<\/p>\n<hr>\n<h3 id=\"\u4e09-\u6280\u672f\u5b9e\u65bd\u4e2d\u7684\u5173\u952e\u51b3\u7b56\u70b9\">\u4e09\u3001\u6280\u672f\u5b9e\u65bd\u4e2d\u7684\u5173\u952e\u51b3\u7b56\u70b9<\/h3>\n<ol>\n<li>\n<p><strong>\u6570\u636e\u53ef\u7528\u6027\u5e73\u8861<\/strong><br \/>\n\u5efa\u8bae\u91c7\u7528<strong>Tiered Storage\u67b6\u6784<\/strong>\uff0c\u5c06\u6700\u8fd172\u5c0f\u65f6\u6570\u636e\u4fdd\u7559\u5728SSD\u5b58\u50a8\uff0c1-30\u5929\u6570\u636e\u4f7f\u7528HDD\uff0c\u8d85\u8fc730\u5929\u7684\u8f6c\u5b58\u5bf9\u8c61\u5b58\u50a8\u3002\u8fd9\u79cd\u5206\u7ea7\u7b56\u7565\u53ef\u4f7f\u5b58\u50a8\u6210\u672c\u4e0b\u964d<strong>50%<\/strong>\u7684\u540c\u65f6\uff0c\u4fdd\u8bc1P99\u67e5\u8be2\u5ef6\u8fdf\u4e0d\u8d85\u8fc72\u79d2\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5143\u6570\u636e\u6cbb\u7406<\/strong><br \/>\n\u5728\u5f52\u6863\u8fc7\u7a0b\u4e2d\u9700\u4fdd\u6301<strong>\u6570\u636e\u76ee\u5f55\uff08Catalog\uff09<\/strong>\u7684\u540c\u6b65\u66f4\u65b0\u3002OTel\u7684Resource\u6a21\u578b\u80fd\u81ea\u52a8\u8bb0\u5f55\u670d\u52a1\u540d\u79f0\u3001\u5b9e\u4f8bID\u7b49\u4e0a\u4e0b\u6587\u4fe1\u606f\uff0c\u5efa\u8bae\u5c06\u8fd9\u4e9b\u5143\u6570\u636e\u6ce8\u5165\u5230Parquet\u6587\u4ef6\u7684<strong>\u5143\u5b58\u50a8\uff08\u5982AWS Glue\uff09<\/strong>\u4e2d\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5408\u89c4\u6027\u8003\u91cf<\/strong><br \/>\n\u533b\u7597\u3001\u91d1\u878d\u7b49\u884c\u4e1a\u9700\u7279\u522b\u6ce8\u610f\u5f52\u6863\u6570\u636e\u7684<strong>\u52a0\u5bc6\u5b58\u50a8<\/strong>\u3002\u5728Exporter\u73af\u8282\u96c6\u6210KMS\u670d\u52a1\uff0c\u5b9e\u73b0\u5ba2\u6237\u7aef\u52a0\u5bc6\uff1a<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"language-go\">exporter := s3.NewExporter(  \r\ns3.WithEncryptor(aws.NewKMSEncryptor(&quot;arn:aws:kms:us-west-2:111122223333:key\/1234abcd&quot;)),  \r\n)  \r\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u7aef\u5230\u7aef\u52a0\u5bc6\u786e\u4fdd\u5373\u4f7f\u5b58\u50a8\u4ecb\u8d28\u88ab\u7269\u7406\u8bbf\u95ee\uff0c\u6570\u636e\u4ecd\u5904\u4e8e\u4fdd\u62a4\u72b6\u6001\u3002<\/p>\n<hr>\n<h3 id=\"\u56db-\u6548\u80fd\u9a8c\u8bc1\u4e0e\u4f18\u5316\u5b9e\u8df5\">\u56db\u3001\u6548\u80fd\u9a8c\u8bc1\u4e0e\u4f18\u5316\u5b9e\u8df5<\/h3>\n<p>\u67d0\u5934\u90e8\u7535\u5546\u5e73\u53f0\u5b9e\u65bd\u81ea\u52a8\u5f52\u6863\u540e\uff0c\u76d1\u63a7\u6570\u636e\u5b58\u50a8\u652f\u51fa\u4ece<strong>$58\u4e07\/\u6708<\/strong>\u964d\u81f3$21\u4e07\/\u6708\u3002\u5176\u6280\u672f\u65b9\u6848\u5305\u542b\u4e09\u4e2a\u6838\u5fc3\u4f18\u5316\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u5217\u5f0f\u5b58\u50a8\u8f6c\u6362<\/strong><br \/>\n\u5c06JSON\u683c\u5f0f\u65e5\u5fd7\u8f6c\u6362\u4e3aParquet\u683c\u5f0f\uff0c\u538b\u7f29\u7387\u63d0\u5347<strong>4-5\u500d<\/strong>\u3002\u914d\u5408ZSTD\u538b\u7f29\u7b97\u6cd5\uff0c1TB\u539f\u59cb\u6570\u636e\u53ef\u538b\u7f29\u81f3\u7ea6130GB\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5206\u533a\u7b56\u7565\u4f18\u5316<\/strong><br \/>\n\u6309\u65f6\u95f4\uff08date=20230101\uff09\u548c\u670d\u52a1\uff08service=payment\uff09\u8fdb\u884c\u53cc\u91cd\u5206\u533a\uff0c\u67e5\u8be2\u65f6\u901a\u8fc7\u5206\u533a\u526a\u679d\uff08Partition Pruning\uff09\u51cf\u5c11<strong>70%<\/strong>\u7684IO\u6d88\u8017\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u51b7\u70ed\u5206\u79bb\u67e5\u8be2<\/strong><br \/>\n\u5728Grafana\u4e2d\u914d\u7f6e<strong>\u591a\u6570\u636e\u6e90\u8054\u90a6\u67e5\u8be2<\/strong>\uff0c\u81ea\u52a8\u8def\u7531\u67e5\u8be2\u8bf7\u6c42\u5230\u5bf9\u5e94\u5b58\u50a8\u5c42\u3002\u5bf9\u4e8e\u9700\u8981\u8054\u5408\u5206\u6790\u7684\u573a\u666f\uff0c\u901a\u8fc7<strong>\u9884\u8ba1\u7b97\u7269\u5316\u89c6\u56fe<\/strong>\u52a0\u901f\u54cd\u5e94\u3002<\/p>\n<\/li>\n<\/ol>\n<hr>\n<h3 id=\"\u4e94-\u672a\u6765\u6f14\u8fdb\u65b9\u5411\">\u4e94\u3001\u672a\u6765\u6f14\u8fdb\u65b9\u5411<\/h3>\n<p>\u968f\u7740<a href=\"https:\/\/www.yunshan.net\/\"   target=\"_blank\" style=\"color:blue\">eBPF<\/a>\u6280\u672f\u7684\u6210\u719f\uff0c<strong>\u5185\u6838\u7ea7\u6570\u636e\u8fc7\u6ee4<\/strong>\u5c06\u6210\u4e3a\u53ef\u80fd\u3002OTel\u793e\u533a\u6b63\u5728\u63a2\u7d22\u5c06WASM\u6a21\u5757\u5d4c\u5165\u5904\u7406\u7ba1\u9053\uff0c\u5b9e\u73b0\u52a8\u6001\u52a0\u8f7d\u5f52\u6863\u7b56\u7565\u3002\u7ed3\u5408\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u9884\u6d4b\u6570\u636e\u4ef7\u503c\uff0c\u6784\u5efa<strong>\u81ea\u9002\u5e94\u5f52\u6863\u7cfb\u7edf<\/strong>\uff0c\u8fd9\u6216\u8bb8\u4f1a\u6210\u4e3a\u53ef\u89c2\u6d4b\u6027\u9886\u57df\u4e0b\u4e00\u4e2a\u7a81\u7834\u70b9\u3002<\/p>\n<p>\u5f53\u6570\u636e\u6cbb\u7406\u8fdb\u5165\u81ea\u52a8\u9a7e\u9a76\u65f6\u4ee3\uff0c\u8fd0\u7ef4\u5de5\u7a0b\u5e08\u7ec8\u4e8e\u53ef\u4ee5\u4ece\u65e0\u5c3d\u7684\u5b58\u50a8\u544a\u8b66\u4e2d\u89e3\u8131\u51fa\u6765\u2014\u2014\u8fd9\u6216\u8bb8\u6b63\u662fOpenTelemetry\u8bbe\u8ba1\u8005\u4eec\u57cb\u85cf\u5728\u4ee3\u7801\u6df1\u5904\u7684\u7ec8\u6781\u613f\u666f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u6570\u5b57\u5316\u6d6a\u6f6e\u5e2d\u5377\u5168\u7403\u7684\u4eca\u5929\uff0c\u4e00\u4e2a\u4e2d\u7b49\u89c4\u6a21\u7684\u4e91\u539f\u751f\u7cfb\u7edf\u6bcf\u5929\u4ea7\u751f\u7684\u76d1\u63a7\u6307\u6807\u53ef\u80fd\u8d85\u8fc710\u4ebf\u6761\u3002\u5f53\u8fd0\u7ef4\u56e2\u961f\u75b2\u4e8e\u5e94\u5bf9\u6d77\u91cf\u65e5\u5fd7\u3001\u6307\u6807\u548c\u94fe\u8def\u6570\u636e\u65f6\uff0c\u5982\u4f55\u8ba9\u8fd9\u4e9b\u5b9d\u8d35\u7684\u6570\u636e\u65e2\u80fd\u6ee1\u8db3\u5b9e\u65f6\u5206\u6790\u9700\u6c42\uff0c\u53c8\u4e0d\u81f3\u4e8e\u6210\u4e3a\u541e\u566c\u5b58\u50a8\u8d44\u6e90\u7684&rdquo;\u9ed1\u6d1e&rdquo;\uff1f\u8fd9\u6b63\u662fOpenTelemetry\u76d1\u63a7\u6570\u636e\u81ea\u52a8\u5f52\u6863\u6280\u672f\u8981\u89e3\u51b3\u7684\u6838\u5fc3\u547d\u9898\u3002 \u4f5c\u4e3aCNCF\u6bd5\u4e1a\u7684\u53ef\u89c2\u6d4b\u6027\u9886\u57df\u6807\u51c6\uff0cOpenTelemetry\uff08\u7b80\u79f0OTel\uff09\u6b63\u5728\u91cd\u5851\u73b0\u4ee3\u7cfb\u7edf\u7684\u76d1\u63a7\u8303\u5f0f\u3002\u4f46\u9c9c\u4e3a\u4eba\u77e5\u7684\u662f\uff0c\u5b83\u7684\u6570\u636e\u7ba1\u9053\u67b6\u6784\u4e2d\u57cb\u85cf\u7740\u5b9e\u73b0\u667a\u80fd\u6570\u636e\u6cbb\u7406\u7684\u5bc6\u94a5\u2014\u2014\u901a\u8fc7\u81ea\u52a8\u5316\u6d41\u6c34\u7ebf\u8bbe\u8ba1\uff0c\u6211\u4eec\u4e0d\u4ec5\u80fd\u6536\u96c6\u6570\u636e\uff0c\u66f4\u80fd\u6784\u5efa\u5177\u5907\u81ea\u7ba1\u7406\u80fd\u529b\u7684\u76d1\u63a7\u4f53\u7cfb\u3002 \u4e00\u3001OpenTelemetry\u6570\u636e\u7ba1\u9053\u7684\u4e09\u5c42\u67b6\u6784 \u8981\u7406\u89e3\u81ea\u52a8\u5f52\u6863\u7684\u5b9e\u73b0\u903b\u8f91\uff0c\u9996\u5148\u8981\u5256\u6790OTel\u7684\u6570\u636e\u6d41\u8f6c\u6a21\u578b\u3002\u5176\u6838\u5fc3\u67b6\u6784\u5206\u4e3a\u4e09\u4e2a\u5173\u952e\u5c42\u7ea7\uff1a \u91c7\u96c6\u5c42\uff08Instrumentation\uff09 \u901a\u8fc7\u81ea\u52a8\/\u624b\u52a8\u63d2\u6869\u6355\u83b7\u6307\u6807\uff08Metrics\uff09\u3001\u65e5\u5fd7\uff08Logs\uff09\u3001\u8ffd\u8e2a\uff08Traces\uff09\u4e09\u5143\u6570\u636e\u3002\u73b0\u4ee3\u670d\u52a1\u7f51\u683c\u67b6\u6784\u4e2d\uff0cSidecar\u6a21\u5f0f\u7684\u4ee3\u7406\u7ec4\u4ef6\u80fd\u5b9e\u73b0\u96f6\u4ee3\u7801\u4fb5\u5165\u7684\u6570\u636e\u91c7\u96c6\u3002 \u5904\u7406\u5c42\uff08Collector\uff09 \u5f00\u6e90Collector\u7ec4\u4ef6\u901a\u8fc7\u63a5\u6536\u5668\uff08Receiver\uff09\u3001\u5904\u7406\u5668\uff08Processor\uff09\u3001\u5bfc\u51fa\u5668\uff08Exporter\uff09\u7684\u4e09\u6bb5\u5f0f\u7ba1\u9053\uff0c\u5b8c\u6210\u6570\u636e\u6e05\u6d17\u3001\u5bcc\u5316\u3001\u8def\u7531\u7b49\u64cd\u4f5c\u3002\u8fd9\u91cc\u6b63\u662f\u5b9e\u65bd\u5f52\u6863\u7b56\u7565\u7684\u9ec4\u91d1\u63a7\u5236\u70b9\u3002 \u5b58\u50a8\u5c42\uff08Backend\uff09 \u652f\u6301\u5bf9\u63a5Prometheus\u3001Loki\u3001Jaeger\u7b49\u4e3b\u6d41\u5b58\u50a8\u7cfb\u7edf\uff0c\u4ee5\u53caS3\u3001HDFS\u7b49\u5bf9\u8c61\u5b58\u50a8\u3002\u901a\u8fc7\u5206\u5c42\u5b58\u50a8\u7b56\u7565\u5b9e\u73b0\u70ed\u6570\u636e\u5feb\u901f\u8bbf\u95ee\u4e0e\u51b7\u6570\u636e\u7ecf\u6d4e\u5b58\u50a8\u7684\u7ed3\u5408\u3002 \u4e8c\u3001\u81ea\u52a8\u5f52\u6863\u7684\u4e09\u5927\u5b9e\u73b0\u8def\u5f84 2.1 \u57fa\u4e8e\u89c4\u5219\u7684\u667a\u80fd\u8def\u7531 \u5728Collector\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u901a\u8fc7\u8fc7\u6ee4\u5904\u7406\u5668\uff08Filter Processor\uff09\u8bbe\u5b9a\u5f52\u6863\u6761\u4ef6\u3002\u4f8b\u5982\uff0c\u5c06\u4e09\u5929\u524d\u7684DEBUG\u7ea7\u522b\u65e5\u5fd7\u8def\u7531\u5230\u51b7\u5b58\u50a8\uff1a processors: attributes\/archive: actions: &#8211; key: log.retention_days value: 3 action: upsert exporters: s3\/archive: endpoint: &quot;s3:\/\/monitoring-archive&quot; loki\/prod: endpoint: &quot;https:\/\/loki.prod:3100&quot; service: pipelines: logs: receivers: [otlp] processors: [batch, attributes\/archive] exporters: [s3\/archive, loki\/prod] \u8be5\u914d\u7f6e\u901a\u8fc7\u5c5e\u6027\u6807\u8bb0\u5b9e\u73b0\u52a8\u6001\u8def\u7531\uff0c\u5f53\u6570\u636e\u5e74\u9f84\u8d85\u8fc7\u9608\u503c\u65f6\u81ea\u52a8\u5207\u6362\u5b58\u50a8\u76ee\u7684\u5730\uff0c\u907f\u514d\u5728\u70ed\u5b58\u50a8\u4e2d\u5806\u79ef\u9648\u65e7\u6570\u636e\u3002 2.2 \u65f6\u5e8f\u6570\u636e\u5e93\u7684\u5185\u5efa\u7b56\u7565 \u5bf9\u4e8ePrometheus\u7b49TSDB\uff08\u65f6\u5e8f\u6570\u636e\u5e93\uff09\uff0c\u53ef\u7ed3\u5408\u5b58\u50a8\u5377\u58f0\u660e(Storage Volume Claim)\u4e0e\u4fdd\u7559\u7b56\u7565(Retention Policy)\u3002Thanos\u6216Cortex\u7b49\u957f\u671f\u5b58\u50a8\u65b9\u6848\u652f\u6301\u964d\u91c7\u6837\uff08Downsampling\uff09\u6280\u672f\uff0c\u5c06\u5386\u53f2\u6570\u636e\u538b\u7f29\u5b58\u50a8\uff1a CREATE CONTINUOUS QUERY &quot;archive_metrics&quot; ON [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":35447,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-35446","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-product-news"],"_links":{"self":[{"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/posts\/35446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/comments?post=35446"}],"version-history":[{"count":1,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/posts\/35446\/revisions"}],"predecessor-version":[{"id":35448,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/posts\/35446\/revisions\/35448"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/media\/35447"}],"wp:attachment":[{"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/media?parent=35446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/categories?post=35446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/tags?post=35446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}