{
    "componentChunkName": "component---node-modules-shenhh-smooth-doc-src-templates-doc-js",
    "path": "/docs/kubernetes/operator-target-allocator/",
    "result": {"data":{"mdx":{"fields":{"pageType":"doc","title":"Target Allocator","editLink":"https://gitlab.corp.youdao.com/DevOPS/apm/docs/edit/master/pages/docs/kubernetes/operator-target-allocator.mdx"},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Target Allocator\",\n  \"section\": \"Kubernetes 部署\",\n  \"slug\": \"/docs/kubernetes/operator-target-allocator/\",\n  \"order\": 4\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h1\", {\n    \"id\": \"target-allocator\"\n  }, mdx(\"a\", {\n    parentName: \"h1\",\n    \"href\": \"#target-allocator\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"Target Allocator\"), mdx(\"p\", null, \"Target Allocator\\uFF08TA\\uFF09\\u662F OpenTelemetry Operator \\u7684\\u4E00\\u4E2A\\u53EF\\u9009\\u7EC4\\u4EF6\\uFF0C\\u7528\\u4E8E\\u5728\\u591A\\u4E2A Collector \\u5B9E\\u4F8B\\u4E4B\\u95F4\\u5206\\u53D1 Prometheus targets\\u3002\\u5B83\\u89E3\\u8026\\u4E86 Prometheus \\u7684\\u670D\\u52A1\\u53D1\\u73B0\\u548C\\u6307\\u6807\\u6536\\u96C6\\u529F\\u80FD\\uFF0C\\u4F7F\\u5B83\\u4EEC\\u53EF\\u4EE5\\u72EC\\u7ACB\\u6269\\u5C55\\u3002\\u901A\\u8FC7\\u4F7F\\u7528 Target Allocator\\uFF0CCollector \\u53EF\\u4EE5\\u7BA1\\u7406 Prometheus \\u6307\\u6807\\uFF0C\\u800C\\u65E0\\u9700\\u5B89\\u88C5\\u5B8C\\u6574\\u7684 Prometheus\\u3002\"), mdx(\"h2\", {\n    \"id\": \"概述\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E6%A6%82%E8%BF%B0\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u6982\\u8FF0\"), mdx(\"h3\", {\n    \"id\": \"什么是-target-allocator\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E4%BB%80%E4%B9%88%E6%98%AF-target-allocator\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u4EC0\\u4E48\\u662F Target Allocator\\uFF1F\"), mdx(\"p\", null, \"Target Allocator \\u662F\\u4E00\\u4E2A\\u5DE5\\u5177\\uFF0C\\u7528\\u4E8E\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u5206\\u53D1 Prometheus targets\"), \"\\uFF1A\\u5728\\u591A\\u4E2A Collector \\u5B9E\\u4F8B\\u4E4B\\u95F4\\u5747\\u5300\\u5206\\u53D1 Prometheus \\u6293\\u53D6\\u76EE\\u6807\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u53D1\\u73B0 Prometheus Custom Resources\"), \"\\uFF1A\\u81EA\\u52A8\\u53D1\\u73B0 Kubernetes \\u4E2D\\u7684 Prometheus Custom Resources\\uFF08\\u5982 ServiceMonitor\\u3001PodMonitor\\uFF09\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u63D0\\u4F9B HTTP \\u670D\\u52A1\\u53D1\\u73B0\"), \"\\uFF1A\\u4E3A\\u6BCF\\u4E2A Collector Pod \\u63D0\\u4F9B\\u4E13\\u7528\\u7684 HTTP \\u670D\\u52A1\\u53D1\\u73B0\\u914D\\u7F6E\")), mdx(\"h3\", {\n    \"id\": \"为什么需要-target-allocator\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81-target-allocator\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u4E3A\\u4EC0\\u4E48\\u9700\\u8981 Target Allocator\\uFF1F\"), mdx(\"p\", null, \"\\u5728 Kubernetes \\u73AF\\u5883\\u4E2D\\u4F7F\\u7528 Prometheus Receiver \\u65F6\\uFF0C\\u9762\\u4E34\\u4EE5\\u4E0B\\u6311\\u6218\\uFF1A\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Target \\u5206\\u53D1\\u95EE\\u9898\"), \"\\uFF1A\\u5F53\\u6709\\u591A\\u4E2A Collector \\u5B9E\\u4F8B\\u65F6\\uFF0C\\u5982\\u4F55\\u786E\\u4FDD\\u6BCF\\u4E2A target \\u53EA\\u88AB\\u4E00\\u4E2A Collector \\u6293\\u53D6\\uFF1F\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u670D\\u52A1\\u53D1\\u73B0\\u590D\\u6742\\u6027\"), \"\\uFF1APrometheus \\u7684\\u670D\\u52A1\\u53D1\\u73B0\\u914D\\u7F6E\\u9700\\u8981\\u5728\\u6BCF\\u4E2A Collector \\u4E2D\\u91CD\\u590D\\u914D\\u7F6E\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u6269\\u5C55\\u6027\\u95EE\\u9898\"), \"\\uFF1A\\u589E\\u52A0 Collector \\u5B9E\\u4F8B\\u65F6\\uFF0C\\u9700\\u8981\\u91CD\\u65B0\\u914D\\u7F6E\\u6240\\u6709\\u5B9E\\u4F8B\")), mdx(\"p\", null, \"Target Allocator \\u89E3\\u51B3\\u4E86\\u8FD9\\u4E9B\\u95EE\\u9898\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u81EA\\u52A8\\u5206\\u53D1\"), \"\\uFF1A\\u81EA\\u52A8\\u5728 Collector \\u5B9E\\u4F8B\\u4E4B\\u95F4\\u5206\\u53D1 targets\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u7EDF\\u4E00\\u7BA1\\u7406\"), \"\\uFF1A\\u5728\\u4E00\\u4E2A\\u5730\\u65B9\\u7BA1\\u7406\\u6240\\u6709 Prometheus \\u914D\\u7F6E\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u6613\\u4E8E\\u6269\\u5C55\"), \"\\uFF1A\\u589E\\u52A0 Collector \\u5B9E\\u4F8B\\u65F6\\uFF0C\\u81EA\\u52A8\\u91CD\\u65B0\\u5206\\u53D1 targets\")), mdx(\"h3\", {\n    \"id\": \"target-allocator-的优势\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#target-allocator-%E7%9A%84%E4%BC%98%E5%8A%BF\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"Target Allocator \\u7684\\u4F18\\u52BF\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u89E3\\u8026\\u670D\\u52A1\\u53D1\\u73B0\\u548C\\u6536\\u96C6\"), \"\\uFF1A\\u670D\\u52A1\\u53D1\\u73B0\\u548C\\u6307\\u6807\\u6536\\u96C6\\u53EF\\u4EE5\\u72EC\\u7ACB\\u6269\\u5C55\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u907F\\u514D\\u91CD\\u590D\\u6293\\u53D6\"), \"\\uFF1A\\u786E\\u4FDD\\u6BCF\\u4E2A target \\u53EA\\u88AB\\u4E00\\u4E2A Collector \\u6293\\u53D6\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u7B80\\u5316\\u914D\\u7F6E\"), \"\\uFF1A\\u65E0\\u9700\\u5728\\u6BCF\\u4E2A Collector \\u4E2D\\u914D\\u7F6E\\u670D\\u52A1\\u53D1\\u73B0\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u81EA\\u52A8\\u53D1\\u73B0\"), \"\\uFF1A\\u81EA\\u52A8\\u53D1\\u73B0 Kubernetes \\u4E2D\\u7684 Prometheus Custom Resources\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u52A8\\u6001\\u66F4\\u65B0\"), \"\\uFF1ATarget \\u53D8\\u5316\\u65F6\\u81EA\\u52A8\\u66F4\\u65B0\\u5206\\u53D1\")), mdx(\"h2\", {\n    \"id\": \"核心功能\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E6%A0%B8%E5%BF%83%E5%8A%9F%E8%83%BD\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u6838\\u5FC3\\u529F\\u80FD\"), mdx(\"p\", null, \"Target Allocator \\u63D0\\u4F9B\\u4E24\\u4E2A\\u6838\\u5FC3\\u529F\\u80FD\\uFF1A\"), mdx(\"h3\", {\n    \"id\": \"1-prometheus-targets-分发\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#1-prometheus-targets-%E5%88%86%E5%8F%91\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"1. Prometheus Targets \\u5206\\u53D1\"), mdx(\"p\", null, \"Target Allocator \\u7684\\u4E3B\\u8981\\u529F\\u80FD\\u662F\\u5728\\u591A\\u4E2A Collector \\u5B9E\\u4F8B\\u4E4B\\u95F4\\u5747\\u5300\\u5206\\u53D1 Prometheus targets\\u3002\\u8FD9\\u786E\\u4FDD\\u4E86\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u8D1F\\u8F7D\\u5747\\u8861\"), \"\\uFF1A\\u6BCF\\u4E2A Collector \\u5B9E\\u4F8B\\u8D1F\\u8D23\\u5927\\u81F4\\u76F8\\u540C\\u6570\\u91CF\\u7684 targets\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u907F\\u514D\\u91CD\\u590D\"), \"\\uFF1A\\u6BCF\\u4E2A target \\u53EA\\u88AB\\u4E00\\u4E2A Collector \\u6293\\u53D6\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u52A8\\u6001\\u8C03\\u6574\"), \"\\uFF1A\\u5F53 Collector \\u5B9E\\u4F8B\\u6570\\u91CF\\u53D8\\u5316\\u65F6\\uFF0C\\u81EA\\u52A8\\u91CD\\u65B0\\u5206\\u53D1 targets\")), mdx(\"h3\", {\n    \"id\": \"2-prometheus-custom-resources-发现\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#2-prometheus-custom-resources-%E5%8F%91%E7%8E%B0\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"2. Prometheus Custom Resources \\u53D1\\u73B0\"), mdx(\"p\", null, \"Target Allocator \\u53EF\\u4EE5\\u81EA\\u52A8\\u53D1\\u73B0 Kubernetes \\u4E2D\\u7684 Prometheus Custom Resources\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"ServiceMonitor\"), \"\\uFF1A\\u57FA\\u4E8E Service \\u7684\\u76D1\\u63A7\\u914D\\u7F6E\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"PodMonitor\"), \"\\uFF1A\\u57FA\\u4E8E Pod \\u7684\\u76D1\\u63A7\\u914D\\u7F6E\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"PrometheusRule\"), \"\\uFF1APrometheus \\u544A\\u8B66\\u89C4\\u5219\")), mdx(\"p\", null, \"\\u8FD9\\u4E9B\\u8D44\\u6E90\\u7531 \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/prometheus-operator/prometheus-operator\"\n  }, \"Prometheus Operator\"), \" \\u5B9A\\u4E49\\uFF0CTarget Allocator \\u53EF\\u4EE5\\u81EA\\u52A8\\u53D1\\u73B0\\u5E76\\u4F7F\\u7528\\u5B83\\u4EEC\\u3002\"), mdx(\"h2\", {\n    \"id\": \"工作原理\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u5DE5\\u4F5C\\u539F\\u7406\"), mdx(\"h3\", {\n    \"id\": \"架构图\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E6%9E%B6%E6%9E%84%E5%9B%BE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u67B6\\u6784\\u56FE\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\"\n  }, \"\\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510\\n\\u2502  Kubernetes Cluster                                      \\u2502\\n\\u2502                                                          \\u2502\\n\\u2502  \\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510  \\u2502\\n\\u2502  \\u2502  Prometheus Custom Resources                     \\u2502  \\u2502\\n\\u2502  \\u2502  \\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510  \\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510            \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2502ServiceMonitor\\u2502  \\u2502 PodMonitor   \\u2502            \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518  \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518            \\u2502  \\u2502\\n\\u2502  \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518  \\u2502\\n\\u2502            \\u2502                                            \\u2502\\n\\u2502            \\u25BC                                            \\u2502\\n\\u2502  \\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510  \\u2502\\n\\u2502  \\u2502  Target Allocator                                 \\u2502  \\u2502\\n\\u2502  \\u2502  \\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510 \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2502  1. \\u53D1\\u73B0 Prometheus Custom Resources      \\u2502 \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2502  2. \\u89E3\\u6790 scrape_configs                   \\u2502 \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2502  3. \\u5206\\u53D1 targets \\u5230 Collector \\u5B9E\\u4F8B        \\u2502 \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2502  4. \\u63D0\\u4F9B HTTP SD API                     \\u2502 \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518 \\u2502  \\u2502\\n\\u2502  \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518  \\u2502\\n\\u2502            \\u2502                                            \\u2502\\n\\u2502            \\u25BC                                            \\u2502\\n\\u2502  \\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510  \\u2502\\n\\u2502  \\u2502  Collector Instances                             \\u2502  \\u2502\\n\\u2502  \\u2502  \\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510  \\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510  \\u250C\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510     \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2502Collector\\u2502  \\u2502Collector \\u2502  \\u2502Collector \\u2502     \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2502  Pod 1   \\u2502  \\u2502  Pod 2   \\u2502  \\u2502  Pod 3   \\u2502     \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2502Targets: \\u2502  \\u2502Targets:  \\u2502  \\u2502Targets:  \\u2502     \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2502 1,4,7   \\u2502  \\u2502 2,5,8     \\u2502  \\u2502 3,6,9    \\u2502     \\u2502  \\u2502\\n\\u2502  \\u2502  \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518  \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518  \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518     \\u2502  \\u2502\\n\\u2502  \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518  \\u2502\\n\\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518\\n\")), mdx(\"h3\", {\n    \"id\": \"工作流程\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E5%B7%A5%E4%BD%9C%E6%B5%81%E7%A8%8B\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u5DE5\\u4F5C\\u6D41\\u7A0B\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Target Allocator \\u542F\\u52A8\"), \"\\uFF1A\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u8BFB\\u53D6 OpenTelemetryCollector \\u914D\\u7F6E\\u4E2D\\u7684 Prometheus receiver \\u914D\\u7F6E\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u53D1\\u73B0 Kubernetes \\u4E2D\\u7684 Prometheus Custom Resources\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u89E3\\u6790\\u6240\\u6709 scrape_configs\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Target \\u5206\\u53D1\"), \"\\uFF1A\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u6536\\u96C6\\u6240\\u6709\\u9700\\u8981\\u6293\\u53D6\\u7684 targets\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u6839\\u636E Collector \\u5B9E\\u4F8B\\u6570\\u91CF\\u8BA1\\u7B97\\u6BCF\\u4E2A\\u5B9E\\u4F8B\\u5E94\\u8BE5\\u8D1F\\u8D23\\u7684 targets\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4F7F\\u7528\\u4E00\\u81F4\\u6027\\u54C8\\u5E0C\\u7B97\\u6CD5\\u5206\\u53D1 targets\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"HTTP SD API\"), \"\\uFF1A\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4E3A\\u6BCF\\u4E2A Collector Pod \\u63D0\\u4F9B\\u4E13\\u7528\\u7684 HTTP \\u670D\\u52A1\\u53D1\\u73B0\\u7AEF\\u70B9\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Collector Pod \\u901A\\u8FC7 \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"$POD_NAME\"), \" \\u6807\\u8BC6\\u81EA\\u5DF1\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Target Allocator \\u8FD4\\u56DE\\u8BE5 Pod \\u5E94\\u8BE5\\u6293\\u53D6\\u7684 targets\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u52A8\\u6001\\u66F4\\u65B0\"), \"\\uFF1A\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u5F53 targets \\u53D8\\u5316\\u65F6\\uFF08\\u65B0\\u589E\\u3001\\u5220\\u9664\\u3001\\u4FEE\\u6539\\uFF09\\uFF0C\\u81EA\\u52A8\\u66F4\\u65B0\\u5206\\u53D1\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u5F53 Collector \\u5B9E\\u4F8B\\u6570\\u91CF\\u53D8\\u5316\\u65F6\\uFF0C\\u81EA\\u52A8\\u91CD\\u65B0\\u5206\\u53D1\")))), mdx(\"h3\", {\n    \"id\": \"http-服务发现配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#http-%E6%9C%8D%E5%8A%A1%E5%8F%91%E7%8E%B0%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"HTTP \\u670D\\u52A1\\u53D1\\u73B0\\u914D\\u7F6E\"), mdx(\"p\", null, \"Target Allocator \\u4F7F\\u7528 Prometheus \\u7684 HTTP \\u670D\\u52A1\\u53D1\\u73B0\\uFF08HTTP SD\\uFF09\\u673A\\u5236\\u3002\\u5F53\\u542F\\u7528 Target Allocator \\u65F6\\uFF0COperator \\u4F1A\\u81EA\\u52A8\\u4FEE\\u6539 Collector \\u914D\\u7F6E\\uFF1A\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u539F\\u59CB\\u914D\\u7F6E\"), \"\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"receivers:\\n  prometheus:\\n    config:\\n      scrape_configs:\\n        - job_name: 'otel-collector'\\n          scrape_interval: 10s\\n          static_configs:\\n            - targets: ['0.0.0.0:8888']\\n\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u8F6C\\u6362\\u540E\\u7684\\u914D\\u7F6E\"), \"\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"receivers:\\n  prometheus:\\n    config:\\n      scrape_configs:\\n        - job_name: otel-collector\\n          scrape_interval: 10s\\n          http_sd_configs:\\n            - url: http://collector-with-ta-targetallocator:80/jobs/otel-collector/targets?collector_id=$POD_NAME\\n\")), mdx(\"h2\", {\n    \"id\": \"启用-target-allocator\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E5%90%AF%E7%94%A8-target-allocator\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u542F\\u7528 Target Allocator\"), mdx(\"h3\", {\n    \"id\": \"基本配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u57FA\\u672C\\u914D\\u7F6E\"), mdx(\"p\", null, \"\\u5728 OpenTelemetryCollector \\u8D44\\u6E90\\u4E2D\\u542F\\u7528 Target Allocator\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"apiVersion: opentelemetry.io/v1alpha1\\nkind: OpenTelemetryCollector\\nmetadata:\\n  name: collector-with-ta\\nspec:\\n  mode: statefulset\\n  targetAllocator:\\n    enabled: true\\n  config: |\\n    receivers:\\n      prometheus:\\n        config:\\n          scrape_configs:\\n            - job_name: 'otel-collector'\\n              scrape_interval: 10s\\n              static_configs:\\n                - targets: ['0.0.0.0:8888']\\n              metric_relabel_configs:\\n                - action: labeldrop\\n                  regex: (id|name)\\n                  replacement: $$1\\n                - action: labelmap\\n                  regex: label_(.+)\\n                  replacement: $$1\\n    exporters:\\n      debug: {}\\n    service:\\n      pipelines:\\n        metrics:\\n          receivers: [prometheus]\\n          processors: []\\n          exporters: [debug]\\n\")), mdx(\"h3\", {\n    \"id\": \"配置说明\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u914D\\u7F6E\\u8BF4\\u660E\"), mdx(\"h4\", {\n    \"id\": \"targetallocatorenabled\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#targetallocatorenabled\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"targetAllocator.enabled\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u7C7B\\u578B\"), \"\\uFF1A\\u5E03\\u5C14\\u503C\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u9ED8\\u8BA4\\u503C\"), \"\\uFF1Afalse\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u8BF4\\u660E\"), \"\\uFF1A\\u542F\\u7528\\u6216\\u7981\\u7528 Target Allocator\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u5FC5\\u9700\"), \"\\uFF1A\\u662F\")), mdx(\"h4\", {\n    \"id\": \"prometheus-receiver-配置\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#prometheus-receiver-%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"Prometheus Receiver \\u914D\\u7F6E\"), mdx(\"p\", null, \"\\u5F53\\u542F\\u7528 Target Allocator \\u65F6\\uFF0C\\u9700\\u8981\\u6CE8\\u610F\\uFF1A\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u670D\\u52A1\\u53D1\\u73B0\\u914D\\u7F6E\\u4F1A\\u88AB\\u66FF\\u6362\"), \"\\uFF1A\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"static_configs\"), \"\\u3001\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"file_sd_configs\"), \" \\u7B49\\u4F1A\\u88AB\\u79FB\\u9664\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u66FF\\u6362\\u4E3A \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"http_sd_configs\"), \" \\u914D\\u7F6E\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u4FDD\\u7559\\u5176\\u4ED6\\u914D\\u7F6E\"), \"\\uFF1A\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"scrape_interval\"), \"\\u3001\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"scrape_timeout\"), \" \\u7B49\\u914D\\u7F6E\\u4F1A\\u4FDD\\u7559\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"metric_relabel_configs\"), \" \\u4F1A\\u4FDD\\u7559\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"relabel_configs\"), \" \\u4F1A\\u4FDD\\u7559\")))), mdx(\"h3\", {\n    \"id\": \"完整配置示例\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E5%AE%8C%E6%95%B4%E9%85%8D%E7%BD%AE%E7%A4%BA%E4%BE%8B\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u5B8C\\u6574\\u914D\\u7F6E\\u793A\\u4F8B\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"apiVersion: opentelemetry.io/v1alpha1\\nkind: OpenTelemetryCollector\\nmetadata:\\n  name: collector-with-ta\\n  namespace: observability\\nspec:\\n  mode: statefulset\\n  replicas: 3\\n  \\n  # \\u542F\\u7528 Target Allocator\\n  targetAllocator:\\n    enabled: true\\n  \\n  # Collector \\u914D\\u7F6E\\n  config: |\\n    receivers:\\n      prometheus:\\n        config:\\n          scrape_configs:\\n            # Job 1: \\u76D1\\u63A7 Collector \\u81EA\\u8EAB\\n            - job_name: 'otel-collector'\\n              scrape_interval: 10s\\n              static_configs:\\n                - targets: ['0.0.0.0:8888']\\n              metric_relabel_configs:\\n                - action: labeldrop\\n                  regex: (id|name)\\n                  replacement: $$1\\n                - action: labelmap\\n                  regex: label_(.+)\\n                  replacement: $$1\\n            \\n            # Job 2: \\u76D1\\u63A7 Kubernetes \\u670D\\u52A1\\n            - job_name: 'kubernetes-services'\\n              kubernetes_sd_configs:\\n                - role: service\\n              relabel_configs:\\n                - source_labels: [__meta_kubernetes_service_name]\\n                  action: keep\\n                  regex: my-service\\n                - source_labels: [__meta_kubernetes_service_port_name]\\n                  action: keep\\n                  regex: metrics\\n    \\n    processors:\\n      memory_limiter:\\n        check_interval: 1s\\n        limit_percentage: 75\\n        spike_limit_percentage: 15\\n      batch:\\n        timeout: 1s\\n        send_batch_size: 1024\\n    \\n    exporters:\\n      otlp:\\n        endpoint: uptrace-grpc.yodao.cn:4317\\n        tls:\\n          insecure: false\\n    \\n    service:\\n      pipelines:\\n        metrics:\\n          receivers: [prometheus]\\n          processors: [memory_limiter, batch]\\n          exporters: [otlp]\\n\")), mdx(\"h3\", {\n    \"id\": \"应用配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E5%BA%94%E7%94%A8%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u5E94\\u7528\\u914D\\u7F6E\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u5E94\\u7528\\u914D\\u7F6E\\nkubectl apply -f collector-with-ta.yaml\\n\\n# \\u68C0\\u67E5 Target Allocator \\u662F\\u5426\\u521B\\u5EFA\\nkubectl get deployment -n observability | grep targetallocator\\n\\n# \\u68C0\\u67E5 Target Allocator Pod\\nkubectl get pods -n observability | grep targetallocator\\n\\n# \\u68C0\\u67E5 Target Allocator Service\\nkubectl get svc -n observability | grep targetallocator\\n\")), mdx(\"h2\", {\n    \"id\": \"配置转换说明\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E9%85%8D%E7%BD%AE%E8%BD%AC%E6%8D%A2%E8%AF%B4%E6%98%8E\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u914D\\u7F6E\\u8F6C\\u6362\\u8BF4\\u660E\"), mdx(\"p\", null, \"\\u5F53\\u542F\\u7528 Target Allocator \\u65F6\\uFF0COperator \\u4F1A\\u81EA\\u52A8\\u8F6C\\u6362 Collector \\u914D\\u7F6E\\u3002\\u7406\\u89E3\\u8FD9\\u4E2A\\u8F6C\\u6362\\u8FC7\\u7A0B\\u5BF9\\u4E8E\\u6B63\\u786E\\u914D\\u7F6E\\u5F88\\u91CD\\u8981\\u3002\"), mdx(\"h3\", {\n    \"id\": \"转换规则\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E8%BD%AC%E6%8D%A2%E8%A7%84%E5%88%99\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u8F6C\\u6362\\u89C4\\u5219\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u79FB\\u9664\\u670D\\u52A1\\u53D1\\u73B0\\u914D\\u7F6E\"), \"\\uFF1A\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u79FB\\u9664 \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"static_configs\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u79FB\\u9664 \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"file_sd_configs\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u79FB\\u9664 \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"kubernetes_sd_configs\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u79FB\\u9664\\u5176\\u4ED6\\u670D\\u52A1\\u53D1\\u73B0\\u914D\\u7F6E\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u6DFB\\u52A0 HTTP SD \\u914D\\u7F6E\"), \"\\uFF1A\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4E3A\\u6BCF\\u4E2A \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"scrape_configs\"), \" \\u6DFB\\u52A0 \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"http_sd_configs\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"URL \\u683C\\u5F0F\\uFF1A\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"http://<ta-service-name>:80/jobs/<job_name>/targets?collector_id=$POD_NAME\")))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u4FDD\\u7559\\u5176\\u4ED6\\u914D\\u7F6E\"), \"\\uFF1A\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4FDD\\u7559 \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"scrape_interval\"), \"\\u3001\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"scrape_timeout\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4FDD\\u7559 \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"metric_relabel_configs\"), \"\\u3001\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"relabel_configs\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4FDD\\u7559 \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"scheme\"), \"\\u3001\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"metrics_path\"), \" \\u7B49\")))), mdx(\"h3\", {\n    \"id\": \"转换示例\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E8%BD%AC%E6%8D%A2%E7%A4%BA%E4%BE%8B\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u8F6C\\u6362\\u793A\\u4F8B\"), mdx(\"h4\", {\n    \"id\": \"原始配置\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E5%8E%9F%E5%A7%8B%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u539F\\u59CB\\u914D\\u7F6E\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"receivers:\\n  prometheus:\\n    config:\\n      scrape_configs:\\n        - job_name: 'otel-collector'\\n          scrape_interval: 10s\\n          static_configs:\\n            - targets: ['0.0.0.0:8888']\\n          metric_relabel_configs:\\n            - action: labeldrop\\n              regex: (id|name)\\n              replacement: $$1\\n\")), mdx(\"h4\", {\n    \"id\": \"转换后的配置\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E8%BD%AC%E6%8D%A2%E5%90%8E%E7%9A%84%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u8F6C\\u6362\\u540E\\u7684\\u914D\\u7F6E\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"receivers:\\n  prometheus:\\n    config:\\n      scrape_configs:\\n        - job_name: otel-collector\\n          scrape_interval: 10s\\n          http_sd_configs:\\n            - url: http://collector-with-ta-targetallocator:80/jobs/otel-collector/targets?collector_id=$POD_NAME\\n          metric_relabel_configs:\\n            - action: labeldrop\\n              regex: (id|name)\\n              replacement: $$1\\n\")), mdx(\"h3\", {\n    \"id\": \"查看实际配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E6%9F%A5%E7%9C%8B%E5%AE%9E%E9%99%85%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u67E5\\u770B\\u5B9E\\u9645\\u914D\\u7F6E\"), mdx(\"p\", null, \"\\u53EF\\u4EE5\\u901A\\u8FC7\\u4EE5\\u4E0B\\u65B9\\u5F0F\\u67E5\\u770B Operator \\u8F6C\\u6362\\u540E\\u7684\\u5B9E\\u9645\\u914D\\u7F6E\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u67E5\\u770B Collector ConfigMap\\nkubectl get configmap <collector-name>-collector -n <namespace> -o yaml\\n\\n# \\u6216\\u67E5\\u770B Collector Pod \\u7684\\u73AF\\u5883\\u53D8\\u91CF\\nkubectl exec <collector-pod-name> -n <namespace> -- env | grep OTEL_CONFIG\\n\")), mdx(\"h2\", {\n    \"id\": \"高级配置\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E9%AB%98%E7%BA%A7%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u9AD8\\u7EA7\\u914D\\u7F6E\"), mdx(\"h3\", {\n    \"id\": \"target-allocator-资源配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#target-allocator-%E8%B5%84%E6%BA%90%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"Target Allocator \\u8D44\\u6E90\\u914D\\u7F6E\"), mdx(\"p\", null, \"\\u53EF\\u4EE5\\u81EA\\u5B9A\\u4E49 Target Allocator \\u7684\\u8D44\\u6E90\\u8BF7\\u6C42\\u548C\\u9650\\u5236\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"spec:\\n  targetAllocator:\\n    enabled: true\\n    resources:\\n      limits:\\n        cpu: 500m\\n        memory: 256Mi\\n      requests:\\n        cpu: 100m\\n        memory: 128Mi\\n\")), mdx(\"h3\", {\n    \"id\": \"target-allocator-副本数\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#target-allocator-%E5%89%AF%E6%9C%AC%E6%95%B0\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"Target Allocator \\u526F\\u672C\\u6570\"), mdx(\"p\", null, \"\\u9ED8\\u8BA4\\u60C5\\u51B5\\u4E0B\\uFF0CTarget Allocator \\u4EE5\\u5355\\u526F\\u672C Deployment \\u8FD0\\u884C\\u3002\\u5982\\u679C\\u9700\\u8981\\u9AD8\\u53EF\\u7528\\uFF0C\\u53EF\\u4EE5\\u914D\\u7F6E\\u591A\\u4E2A\\u526F\\u672C\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"spec:\\n  targetAllocator:\\n    enabled: true\\n    replicas: 2\\n\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u6CE8\\u610F\"), \"\\uFF1A\\u591A\\u4E2A Target Allocator \\u5B9E\\u4F8B\\u4F1A\\u5171\\u4EAB\\u914D\\u7F6E\\uFF0C\\u4F46\\u6BCF\\u4E2A Collector Pod \\u4ECD\\u7136\\u53EA\\u4ECE\\u4E00\\u4E2A Target Allocator \\u83B7\\u53D6 targets\\u3002\"), mdx(\"h3\", {\n    \"id\": \"自定义-target-allocator-镜像\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E8%87%AA%E5%AE%9A%E4%B9%89-target-allocator-%E9%95%9C%E5%83%8F\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u81EA\\u5B9A\\u4E49 Target Allocator \\u955C\\u50CF\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"spec:\\n  targetAllocator:\\n    enabled: true\\n    image: ghcr.io/open-telemetry/opentelemetry-operator/target-allocator:v0.100.0\\n\")), mdx(\"h3\", {\n    \"id\": \"环境变量配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u73AF\\u5883\\u53D8\\u91CF\\u914D\\u7F6E\"), mdx(\"p\", null, \"\\u4E3A Target Allocator \\u6DFB\\u52A0\\u73AF\\u5883\\u53D8\\u91CF\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"spec:\\n  targetAllocator:\\n    enabled: true\\n    env:\\n      - name: LOG_LEVEL\\n        value: debug\\n      - name: ALLOCATOR_STRATEGY\\n        value: consistent-hashing\\n\")), mdx(\"h3\", {\n    \"id\": \"prometheus-custom-resources-发现\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#prometheus-custom-resources-%E5%8F%91%E7%8E%B0\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"Prometheus Custom Resources \\u53D1\\u73B0\"), mdx(\"p\", null, \"Target Allocator \\u53EF\\u4EE5\\u81EA\\u52A8\\u53D1\\u73B0 Prometheus Custom Resources\\u3002\\u786E\\u4FDD\\u5DF2\\u5B89\\u88C5 Prometheus Operator\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u68C0\\u67E5 Prometheus Operator\\nkubectl get crd | grep prometheus\\n\\n# \\u5E94\\u8BE5\\u770B\\u5230\\uFF1A\\n# - servicemonitors.monitoring.coreos.com\\n# - podmonitors.monitoring.coreos.com\\n# - prometheusrules.monitoring.coreos.com\\n\")), mdx(\"p\", null, \"\\u521B\\u5EFA ServiceMonitor \\u793A\\u4F8B\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"apiVersion: monitoring.coreos.com/v1\\nkind: ServiceMonitor\\nmetadata:\\n  name: my-service-monitor\\n  namespace: observability\\nspec:\\n  selector:\\n    matchLabels:\\n      app: my-app\\n  endpoints:\\n    - port: metrics\\n      interval: 30s\\n      path: /metrics\\n\")), mdx(\"p\", null, \"Target Allocator \\u4F1A\\u81EA\\u52A8\\u53D1\\u73B0\\u8FD9\\u4E2A ServiceMonitor \\u5E76\\u521B\\u5EFA\\u76F8\\u5E94\\u7684 scrape_configs\\u3002\"), mdx(\"h2\", {\n    \"id\": \"实战示例\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E5%AE%9E%E6%88%98%E7%A4%BA%E4%BE%8B\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u5B9E\\u6218\\u793A\\u4F8B\"), mdx(\"h3\", {\n    \"id\": \"示例-1监控-kubernetes-服务\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E7%A4%BA%E4%BE%8B-1%E7%9B%91%E6%8E%A7-kubernetes-%E6%9C%8D%E5%8A%A1\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u793A\\u4F8B 1\\uFF1A\\u76D1\\u63A7 Kubernetes \\u670D\\u52A1\"), mdx(\"h4\", {\n    \"id\": \"1-创建-servicemonitor\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#1-%E5%88%9B%E5%BB%BA-servicemonitor\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"1. \\u521B\\u5EFA ServiceMonitor\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"apiVersion: monitoring.coreos.com/v1\\nkind: ServiceMonitor\\nmetadata:\\n  name: app-metrics\\n  namespace: production\\n  labels:\\n    app: my-app\\nspec:\\n  selector:\\n    matchLabels:\\n      app: my-app\\n  endpoints:\\n    - port: metrics\\n      interval: 30s\\n      path: /metrics\\n\")), mdx(\"h4\", {\n    \"id\": \"2-配置-collector-使用-target-allocator\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#2-%E9%85%8D%E7%BD%AE-collector-%E4%BD%BF%E7%94%A8-target-allocator\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"2. \\u914D\\u7F6E Collector \\u4F7F\\u7528 Target Allocator\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"apiVersion: opentelemetry.io/v1alpha1\\nkind: OpenTelemetryCollector\\nmetadata:\\n  name: collector-with-ta\\n  namespace: observability\\nspec:\\n  mode: statefulset\\n  replicas: 3\\n  targetAllocator:\\n    enabled: true\\n  config: |\\n    receivers:\\n      prometheus:\\n        config:\\n          scrape_configs:\\n            - job_name: 'kubernetes-services'\\n              kubernetes_sd_configs:\\n                - role: service\\n              relabel_configs:\\n                - source_labels: [__meta_kubernetes_service_label_app]\\n                  action: keep\\n                  regex: my-app\\n    exporters:\\n      otlp:\\n        endpoint: uptrace-grpc.yodao.cn:4317\\n    service:\\n      pipelines:\\n        metrics:\\n          receivers: [prometheus]\\n          exporters: [otlp]\\n\")), mdx(\"h4\", {\n    \"id\": \"3-验证\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#3-%E9%AA%8C%E8%AF%81\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"3. \\u9A8C\\u8BC1\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u68C0\\u67E5 Target Allocator \\u662F\\u5426\\u53D1\\u73B0 targets\\nkubectl logs -l app.kubernetes.io/name=target-allocator -n observability | grep targets\\n\\n# \\u68C0\\u67E5 Collector \\u662F\\u5426\\u6B63\\u5728\\u6293\\u53D6\\nkubectl logs -l app.kubernetes.io/name=opentelemetry-collector -n observability | grep prometheus\\n\")), mdx(\"h3\", {\n    \"id\": \"示例-2监控多个应用\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E7%A4%BA%E4%BE%8B-2%E7%9B%91%E6%8E%A7%E5%A4%9A%E4%B8%AA%E5%BA%94%E7%94%A8\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u793A\\u4F8B 2\\uFF1A\\u76D1\\u63A7\\u591A\\u4E2A\\u5E94\\u7528\"), mdx(\"h4\", {\n    \"id\": \"1-创建多个-servicemonitor\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#1-%E5%88%9B%E5%BB%BA%E5%A4%9A%E4%B8%AA-servicemonitor\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"1. \\u521B\\u5EFA\\u591A\\u4E2A ServiceMonitor\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"# ServiceMonitor 1\\napiVersion: monitoring.coreos.com/v1\\nkind: ServiceMonitor\\nmetadata:\\n  name: frontend-metrics\\n  namespace: production\\nspec:\\n  selector:\\n    matchLabels:\\n      app: frontend\\n  endpoints:\\n    - port: metrics\\n      interval: 30s\\n\\n---\\n# ServiceMonitor 2\\napiVersion: monitoring.coreos.com/v1\\nkind: ServiceMonitor\\nmetadata:\\n  name: backend-metrics\\n  namespace: production\\nspec:\\n  selector:\\n    matchLabels:\\n      app: backend\\n  endpoints:\\n    - port: metrics\\n      interval: 30s\\n\")), mdx(\"h4\", {\n    \"id\": \"2-配置-collector\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#2-%E9%85%8D%E7%BD%AE-collector\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"2. \\u914D\\u7F6E Collector\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"apiVersion: opentelemetry.io/v1alpha1\\nkind: OpenTelemetryCollector\\nmetadata:\\n  name: collector-with-ta\\n  namespace: observability\\nspec:\\n  mode: statefulset\\n  replicas: 3\\n  targetAllocator:\\n    enabled: true\\n  config: |\\n    receivers:\\n      prometheus:\\n        config:\\n          scrape_configs:\\n            - job_name: 'frontend'\\n              kubernetes_sd_configs:\\n                - role: service\\n              relabel_configs:\\n                - source_labels: [__meta_kubernetes_service_label_app]\\n                  action: keep\\n                  regex: frontend\\n            - job_name: 'backend'\\n              kubernetes_sd_configs:\\n                - role: service\\n              relabel_configs:\\n                - source_labels: [__meta_kubernetes_service_label_app]\\n                  action: keep\\n                  regex: backend\\n    exporters:\\n      otlp:\\n        endpoint: uptrace-grpc.yodao.cn:4317\\n    service:\\n      pipelines:\\n        metrics:\\n          receivers: [prometheus]\\n          exporters: [otlp]\\n\")), mdx(\"h3\", {\n    \"id\": \"示例-3使用静态配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E7%A4%BA%E4%BE%8B-3%E4%BD%BF%E7%94%A8%E9%9D%99%E6%80%81%E9%85%8D%E7%BD%AE\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u793A\\u4F8B 3\\uFF1A\\u4F7F\\u7528\\u9759\\u6001\\u914D\\u7F6E\"), mdx(\"p\", null, \"\\u5373\\u4F7F\\u4F7F\\u7528 Target Allocator\\uFF0C\\u4E5F\\u53EF\\u4EE5\\u4F7F\\u7528\\u9759\\u6001\\u914D\\u7F6E\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"apiVersion: opentelemetry.io/v1alpha1\\nkind: OpenTelemetryCollector\\nmetadata:\\n  name: collector-with-ta\\nspec:\\n  mode: statefulset\\n  targetAllocator:\\n    enabled: true\\n  config: |\\n    receivers:\\n      prometheus:\\n        config:\\n          scrape_configs:\\n            - job_name: 'static-targets'\\n              scrape_interval: 10s\\n              static_configs:\\n                - targets:\\n                  - 'external-service-1:9090'\\n                  - 'external-service-2:9090'\\n                  - 'external-service-3:9090'\\n    exporters:\\n      otlp:\\n        endpoint: uptrace-grpc.yodao.cn:4317\\n    service:\\n      pipelines:\\n        metrics:\\n          receivers: [prometheus]\\n          exporters: [otlp]\\n\")), mdx(\"p\", null, \"Target Allocator \\u4F1A\\u5C06\\u9759\\u6001 targets \\u5206\\u53D1\\u5230\\u5404\\u4E2A Collector \\u5B9E\\u4F8B\\u3002\"), mdx(\"h2\", {\n    \"id\": \"故障排查\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E6%95%85%E9%9A%9C%E6%8E%92%E6%9F%A5\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u6545\\u969C\\u6392\\u67E5\"), mdx(\"h3\", {\n    \"id\": \"1-target-allocator-无法启动\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#1-target-allocator-%E6%97%A0%E6%B3%95%E5%90%AF%E5%8A%A8\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"1. Target Allocator \\u65E0\\u6CD5\\u542F\\u52A8\\uFF1F\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u68C0\\u67E5\\u6B65\\u9AA4\"), \"\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u68C0\\u67E5 Target Allocator Pod \\u72B6\\u6001\\nkubectl get pods -l app.kubernetes.io/name=target-allocator -n <namespace>\\n\\n# \\u67E5\\u770B Target Allocator \\u65E5\\u5FD7\\nkubectl logs -l app.kubernetes.io/name=target-allocator -n <namespace>\\n\\n# \\u68C0\\u67E5 Target Allocator Service\\nkubectl get svc -l app.kubernetes.io/name=target-allocator -n <namespace>\\n\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u5E38\\u89C1\\u539F\\u56E0\"), \"\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u914D\\u7F6E\\u9519\\u8BEF\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u8D44\\u6E90\\u4E0D\\u8DB3\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u955C\\u50CF\\u62C9\\u53D6\\u5931\\u8D25\")), mdx(\"h3\", {\n    \"id\": \"2-collector-无法从-target-allocator-获取-targets\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#2-collector-%E6%97%A0%E6%B3%95%E4%BB%8E-target-allocator-%E8%8E%B7%E5%8F%96-targets\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"2. Collector \\u65E0\\u6CD5\\u4ECE Target Allocator \\u83B7\\u53D6 targets\\uFF1F\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u68C0\\u67E5\\u6B65\\u9AA4\"), \"\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u68C0\\u67E5 Collector Pod \\u65E5\\u5FD7\\nkubectl logs <collector-pod-name> -n <namespace> | grep -i \\\"http_sd\\\\|target\\\"\\n\\n# \\u68C0\\u67E5 Target Allocator HTTP SD \\u7AEF\\u70B9\\nkubectl exec <collector-pod-name> -n <namespace> -- \\\\\\n  curl http://<ta-service-name>:80/jobs/<job_name>/targets?collector_id=<pod-name>\\n\\n# \\u68C0\\u67E5\\u7F51\\u7EDC\\u8FDE\\u63A5\\nkubectl exec <collector-pod-name> -n <namespace> -- \\\\\\n  ping <ta-service-name>\\n\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u5E38\\u89C1\\u539F\\u56E0\"), \"\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Target Allocator Service \\u672A\\u521B\\u5EFA\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u7F51\\u7EDC\\u7B56\\u7565\\u963B\\u6B62\\u8FDE\\u63A5\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Target Allocator \\u672A\\u53D1\\u73B0 targets\")), mdx(\"h3\", {\n    \"id\": \"3-targets-未分发\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#3-targets-%E6%9C%AA%E5%88%86%E5%8F%91\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"3. Targets \\u672A\\u5206\\u53D1\\uFF1F\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u68C0\\u67E5\\u6B65\\u9AA4\"), \"\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u68C0\\u67E5 Target Allocator \\u65E5\\u5FD7\\nkubectl logs -l app.kubernetes.io/name=target-allocator -n <namespace> | grep -i \\\"target\\\\|allocation\\\"\\n\\n# \\u68C0\\u67E5 Collector \\u914D\\u7F6E\\nkubectl get configmap <collector-name>-collector -n <namespace> -o yaml\\n\\n# \\u68C0\\u67E5 Prometheus Custom Resources\\nkubectl get servicemonitor -n <namespace>\\nkubectl get podmonitor -n <namespace>\\n\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u5E38\\u89C1\\u539F\\u56E0\"), \"\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Prometheus Custom Resources \\u672A\\u521B\\u5EFA\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Target Allocator \\u672A\\u53D1\\u73B0 Custom Resources\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u914D\\u7F6E\\u89E3\\u6790\\u9519\\u8BEF\")), mdx(\"h3\", {\n    \"id\": \"4-如何查看-target-allocator-分发的-targets\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#4-%E5%A6%82%E4%BD%95%E6%9F%A5%E7%9C%8B-target-allocator-%E5%88%86%E5%8F%91%E7%9A%84-targets\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"4. \\u5982\\u4F55\\u67E5\\u770B Target Allocator \\u5206\\u53D1\\u7684 targets\\uFF1F\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u65B9\\u6CD5 1\\uFF1A\\u901A\\u8FC7 HTTP API\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u83B7\\u53D6 Target Allocator Service \\u540D\\u79F0\\nTA_SERVICE=$(kubectl get svc -l app.kubernetes.io/name=target-allocator -n <namespace> -o jsonpath='{.items[0].metadata.name}')\\n\\n# \\u67E5\\u8BE2\\u7279\\u5B9A job \\u7684\\u6240\\u6709 targets\\nkubectl run -it --rm debug --image=curlimages/curl --restart=Never -- \\\\\\n  curl http://$TA_SERVICE:80/jobs/<job_name>/targets\\n\\n# \\u67E5\\u8BE2\\u7279\\u5B9A Collector Pod \\u7684 targets\\nCOLLECTOR_POD=$(kubectl get pod -l app.kubernetes.io/name=opentelemetry-collector -n <namespace> -o jsonpath='{.items[0].metadata.name}')\\nkubectl run -it --rm debug --image=curlimages/curl --restart=Never -- \\\\\\n  curl \\\"http://$TA_SERVICE:80/jobs/<job_name>/targets?collector_id=$COLLECTOR_POD\\\"\\n\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u65B9\\u6CD5 2\\uFF1A\\u67E5\\u770B Target Allocator \\u65E5\\u5FD7\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"kubectl logs -l app.kubernetes.io/name=target-allocator -n <namespace> | grep -i target\\n\")), mdx(\"h3\", {\n    \"id\": \"5-target-allocator-发现不了-prometheus-custom-resources\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#5-target-allocator-%E5%8F%91%E7%8E%B0%E4%B8%8D%E4%BA%86-prometheus-custom-resources\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"5. Target Allocator \\u53D1\\u73B0\\u4E0D\\u4E86 Prometheus Custom Resources\\uFF1F\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u68C0\\u67E5\\u6B65\\u9AA4\"), \"\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u68C0\\u67E5 Prometheus Operator \\u662F\\u5426\\u5B89\\u88C5\\nkubectl get crd | grep prometheus\\n\\n# \\u68C0\\u67E5 ServiceMonitor/PodMonitor \\u662F\\u5426\\u5B58\\u5728\\nkubectl get servicemonitor -A\\nkubectl get podmonitor -A\\n\\n# \\u68C0\\u67E5 Target Allocator \\u65E5\\u5FD7\\nkubectl logs -l app.kubernetes.io/name=target-allocator -n <namespace> | grep -i \\\"discover\\\\|service\\\\|pod\\\"\\n\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"\\u89E3\\u51B3\\u65B9\\u6CD5\"), \"\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u786E\\u4FDD\\u5DF2\\u5B89\\u88C5 Prometheus Operator\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u786E\\u4FDD ServiceMonitor/PodMonitor \\u7684\\u6807\\u7B7E\\u9009\\u62E9\\u5668\\u6B63\\u786E\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u68C0\\u67E5 Target Allocator \\u7684\\u6743\\u9650\\u914D\\u7F6E\")), mdx(\"p\", null, \"\\u8BE6\\u7EC6\\u6545\\u969C\\u6392\\u67E5\\u8BF7\\u53C2\\u8003 \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"/docs/kubernetes/operator-troubleshooting/\"\n  }, \"\\u6545\\u969C\\u6392\\u67E5\\u6587\\u6863\"), \"\\u3002\"), mdx(\"h2\", {\n    \"id\": \"最佳实践\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u6700\\u4F73\\u5B9E\\u8DF5\"), mdx(\"h3\", {\n    \"id\": \"1-合理设置-collector-副本数\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#1-%E5%90%88%E7%90%86%E8%AE%BE%E7%BD%AE-collector-%E5%89%AF%E6%9C%AC%E6%95%B0\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"1. \\u5408\\u7406\\u8BBE\\u7F6E Collector \\u526F\\u672C\\u6570\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u6839\\u636E targets \\u6570\\u91CF\\u8BBE\\u7F6E\\u5408\\u7406\\u7684\\u526F\\u672C\\u6570\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u6BCF\\u4E2A Collector \\u5B9E\\u4F8B\\u8D1F\\u8D23\\u7684 targets \\u6570\\u91CF\\u5EFA\\u8BAE\\u5728 50-200 \\u4E4B\\u95F4\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4F7F\\u7528 HPA \\u81EA\\u52A8\\u8C03\\u6574\\u526F\\u672C\\u6570\")), mdx(\"h3\", {\n    \"id\": \"2-使用-prometheus-custom-resources\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#2-%E4%BD%BF%E7%94%A8-prometheus-custom-resources\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"2. \\u4F7F\\u7528 Prometheus Custom Resources\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4F18\\u5148\\u4F7F\\u7528 ServiceMonitor \\u548C PodMonitor\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u907F\\u514D\\u5728 Collector \\u914D\\u7F6E\\u4E2D\\u786C\\u7F16\\u7801 targets\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u5229\\u7528 Kubernetes \\u7684\\u6807\\u7B7E\\u9009\\u62E9\\u5668\\u8FDB\\u884C\\u52A8\\u6001\\u53D1\\u73B0\")), mdx(\"h3\", {\n    \"id\": \"3-监控-target-allocator\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#3-%E7%9B%91%E6%8E%A7-target-allocator\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"3. \\u76D1\\u63A7 Target Allocator\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u76D1\\u63A7 Target Allocator \\u7684 CPU \\u548C\\u5185\\u5B58\\u4F7F\\u7528\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u76D1\\u63A7 Target Allocator \\u7684\\u65E5\\u5FD7\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u8BBE\\u7F6E\\u544A\\u8B66\\u89C4\\u5219\")), mdx(\"h3\", {\n    \"id\": \"4-配置资源限制\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#4-%E9%85%8D%E7%BD%AE%E8%B5%84%E6%BA%90%E9%99%90%E5%88%B6\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"4. \\u914D\\u7F6E\\u8D44\\u6E90\\u9650\\u5236\"), mdx(\"p\", null, \"\\u4E3A Target Allocator \\u914D\\u7F6E\\u5408\\u7406\\u7684\\u8D44\\u6E90\\u9650\\u5236\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"targetAllocator:\\n  enabled: true\\n  resources:\\n    limits:\\n      cpu: 500m\\n      memory: 256Mi\\n    requests:\\n      cpu: 100m\\n      memory: 128Mi\\n\")), mdx(\"h3\", {\n    \"id\": \"5-使用版本固定的镜像\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#5-%E4%BD%BF%E7%94%A8%E7%89%88%E6%9C%AC%E5%9B%BA%E5%AE%9A%E7%9A%84%E9%95%9C%E5%83%8F\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"5. \\u4F7F\\u7528\\u7248\\u672C\\u56FA\\u5B9A\\u7684\\u955C\\u50CF\"), mdx(\"p\", null, \"\\u907F\\u514D\\u4F7F\\u7528 \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"latest\"), \" \\u6807\\u7B7E\\uFF1A\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"targetAllocator:\\n  enabled: true\\n  image: ghcr.io/open-telemetry/opentelemetry-operator/target-allocator:v0.100.0\\n\")), mdx(\"h3\", {\n    \"id\": \"6-测试-target-分发\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#6-%E6%B5%8B%E8%AF%95-target-%E5%88%86%E5%8F%91\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"6. \\u6D4B\\u8BD5 Target \\u5206\\u53D1\"), mdx(\"p\", null, \"\\u5728\\u90E8\\u7F72\\u5230\\u751F\\u4EA7\\u73AF\\u5883\\u4E4B\\u524D\\uFF0C\\u6D4B\\u8BD5 Target Allocator \\u7684\\u5206\\u53D1\\u903B\\u8F91\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u521B\\u5EFA\\u6D4B\\u8BD5 targets\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u9A8C\\u8BC1 targets \\u662F\\u5426\\u6B63\\u786E\\u5206\\u53D1\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u9A8C\\u8BC1 Collector \\u662F\\u5426\\u80FD\\u591F\\u6293\\u53D6 targets\")), mdx(\"h2\", {\n    \"id\": \"常见问题\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u5E38\\u89C1\\u95EE\\u9898\"), mdx(\"h3\", {\n    \"id\": \"1-target-allocator-和-prometheus-的区别\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#1-target-allocator-%E5%92%8C-prometheus-%E7%9A%84%E5%8C%BA%E5%88%AB\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"1. Target Allocator \\u548C Prometheus \\u7684\\u533A\\u522B\\uFF1F\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Prometheus\"), \"\\uFF1A\\u5B8C\\u6574\\u7684\\u76D1\\u63A7\\u7CFB\\u7EDF\\uFF0C\\u5305\\u542B\\u5B58\\u50A8\\u3001\\u67E5\\u8BE2\\u3001\\u544A\\u8B66\\u7B49\\u529F\\u80FD\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Target Allocator\"), \"\\uFF1A\\u53EA\\u8D1F\\u8D23\\u5206\\u53D1 targets\\uFF0C\\u4E0D\\u5B58\\u50A8\\u6570\\u636E\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Collector\"), \"\\uFF1A\\u8D1F\\u8D23\\u6293\\u53D6\\u6307\\u6807\\u5E76\\u5BFC\\u51FA\\u5230\\u540E\\u7AEF\\u7CFB\\u7EDF\")), mdx(\"h3\", {\n    \"id\": \"2-可以同时使用-target-allocator-和直接配置吗\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#2-%E5%8F%AF%E4%BB%A5%E5%90%8C%E6%97%B6%E4%BD%BF%E7%94%A8-target-allocator-%E5%92%8C%E7%9B%B4%E6%8E%A5%E9%85%8D%E7%BD%AE%E5%90%97\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"2. \\u53EF\\u4EE5\\u540C\\u65F6\\u4F7F\\u7528 Target Allocator \\u548C\\u76F4\\u63A5\\u914D\\u7F6E\\u5417\\uFF1F\"), mdx(\"p\", null, \"\\u53EF\\u4EE5\\uFF0C\\u4F46 Target Allocator \\u4F1A\\u4F18\\u5148\\u5904\\u7406 Prometheus receiver \\u7684\\u914D\\u7F6E\\u3002\\u5982\\u679C\\u9700\\u8981\\u5728\\u67D0\\u4E9B job \\u4E2D\\u7981\\u7528 Target Allocator\\uFF0C\\u9700\\u8981\\u5355\\u72EC\\u914D\\u7F6E\\u3002\"), mdx(\"h3\", {\n    \"id\": \"3-target-allocator-支持哪些服务发现方式\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#3-target-allocator-%E6%94%AF%E6%8C%81%E5%93%AA%E4%BA%9B%E6%9C%8D%E5%8A%A1%E5%8F%91%E7%8E%B0%E6%96%B9%E5%BC%8F\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"3. Target Allocator \\u652F\\u6301\\u54EA\\u4E9B\\u670D\\u52A1\\u53D1\\u73B0\\u65B9\\u5F0F\\uFF1F\"), mdx(\"p\", null, \"Target Allocator \\u652F\\u6301\\u6240\\u6709 Prometheus \\u652F\\u6301\\u7684\\u670D\\u52A1\\u53D1\\u73B0\\u65B9\\u5F0F\\uFF0C\\u5305\\u62EC\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"static_configs\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"kubernetes_sd_configs\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"file_sd_configs\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4EE5\\u53CA\\u901A\\u8FC7 Prometheus Custom Resources \\u53D1\\u73B0\")), mdx(\"h3\", {\n    \"id\": \"4-如何调试-target-allocator\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#4-%E5%A6%82%E4%BD%95%E8%B0%83%E8%AF%95-target-allocator\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"4. \\u5982\\u4F55\\u8C03\\u8BD5 Target Allocator\\uFF1F\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u542F\\u7528\\u8C03\\u8BD5\\u65E5\\u5FD7\\nkubectl set env deployment/<ta-deployment> LOG_LEVEL=debug -n <namespace>\\n\\n# \\u67E5\\u770B\\u8BE6\\u7EC6\\u65E5\\u5FD7\\nkubectl logs -l app.kubernetes.io/name=target-allocator -n <namespace> --tail=100 -f\\n\")), mdx(\"h3\", {\n    \"id\": \"5-target-allocator-的性能如何\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#5-target-allocator-%E7%9A%84%E6%80%A7%E8%83%BD%E5%A6%82%E4%BD%95\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"5. Target Allocator \\u7684\\u6027\\u80FD\\u5982\\u4F55\\uFF1F\"), mdx(\"p\", null, \"Target Allocator \\u7684\\u6027\\u80FD\\u901A\\u5E38\\u5F88\\u597D\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"CPU \\u4F7F\\u7528\"), \"\\uFF1A< 100m\\uFF08\\u6B63\\u5E38\\u60C5\\u51B5\\uFF09\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u5185\\u5B58\\u4F7F\\u7528\"), \"\\uFF1A< 128Mi\\uFF08\\u6B63\\u5E38\\u60C5\\u51B5\\uFF09\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u54CD\\u5E94\\u65F6\\u95F4\"), \"\\uFF1A< 100ms\\uFF08HTTP SD API\\uFF09\")), mdx(\"p\", null, \"\\u5982\\u679C\\u53D1\\u73B0\\u6027\\u80FD\\u95EE\\u9898\\uFF0C\\u53EF\\u4EE5\\uFF1A\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u589E\\u52A0 Target Allocator \\u7684\\u8D44\\u6E90\\u9650\\u5236\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u51CF\\u5C11 targets \\u6570\\u91CF\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u4F18\\u5316 Prometheus Custom Resources \\u914D\\u7F6E\")), mdx(\"h2\", {\n    \"id\": \"下一步\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E4%B8%8B%E4%B8%80%E6%AD%A5\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u4E0B\\u4E00\\u6B65\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/docs/kubernetes/operator-overview/\"\n  }, \"Operator \\u6982\\u8FF0\"), \" - \\u4E86\\u89E3 Operator \\u7684\\u57FA\\u672C\\u6982\\u5FF5\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/docs/kubernetes/operator-auto-instrumentation/\"\n  }, \"\\u81EA\\u52A8\\u6CE8\\u5165\"), \" - \\u4E86\\u89E3\\u81EA\\u52A8\\u6CE8\\u5165\\u529F\\u80FD\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/docs/kubernetes/operator-hpa/\"\n  }, \"\\u6C34\\u5E73 Pod \\u81EA\\u52A8\\u6269\\u7F29\\u5BB9\"), \" - \\u914D\\u7F6E Collector \\u7684\\u81EA\\u52A8\\u6269\\u7F29\\u5BB9\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/docs/kubernetes/operator-troubleshooting/\"\n  }, \"\\u6545\\u969C\\u6392\\u67E5\"), \" - \\u89E3\\u51B3 Target Allocator \\u76F8\\u5173\\u95EE\\u9898\")), mdx(\"h2\", {\n    \"id\": \"参考资源\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E5%8F%82%E8%80%83%E8%B5%84%E6%BA%90\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\n    fillRule: \"evenodd\",\n    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\"\n  }))), \"\\u53C2\\u8003\\u8D44\\u6E90\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://opentelemetry.io/docs/platforms/kubernetes/operator/target-allocator/\"\n  }, \"OpenTelemetry Operator Target Allocator \\u5B98\\u65B9\\u6587\\u6863\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://github.com/open-telemetry/opentelemetry-operator/tree/main/cmd/otel-allocator\"\n  }, \"Target Allocator GitHub\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://prometheus.io/docs/prometheus/latest/http_sd/\"\n  }, \"Prometheus HTTP SD \\u6587\\u6863\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://github.com/prometheus-operator/prometheus-operator\"\n  }, \"Prometheus Operator \\u6587\\u6863\"))));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#target-allocator","title":"Target Allocator","items":[{"url":"#概述","title":"概述","items":[{"url":"#什么是-target-allocator","title":"什么是 Target Allocator？"},{"url":"#为什么需要-target-allocator","title":"为什么需要 Target Allocator？"},{"url":"#target-allocator-的优势","title":"Target Allocator 的优势"}]},{"url":"#核心功能","title":"核心功能","items":[{"url":"#1-prometheus-targets-分发","title":"1. Prometheus Targets 分发"},{"url":"#2-prometheus-custom-resources-发现","title":"2. Prometheus Custom Resources 发现"}]},{"url":"#工作原理","title":"工作原理","items":[{"url":"#架构图","title":"架构图"},{"url":"#工作流程","title":"工作流程"},{"url":"#http-服务发现配置","title":"HTTP 服务发现配置"}]},{"url":"#启用-target-allocator","title":"启用 Target Allocator","items":[{"url":"#基本配置","title":"基本配置"},{"url":"#配置说明","title":"配置说明","items":[{"url":"#targetallocatorenabled","title":"targetAllocator.enabled"},{"url":"#prometheus-receiver-配置","title":"Prometheus Receiver 配置"}]},{"url":"#完整配置示例","title":"完整配置示例"},{"url":"#应用配置","title":"应用配置"}]},{"url":"#配置转换说明","title":"配置转换说明","items":[{"url":"#转换规则","title":"转换规则"},{"url":"#转换示例","title":"转换示例","items":[{"url":"#原始配置","title":"原始配置"},{"url":"#转换后的配置","title":"转换后的配置"}]},{"url":"#查看实际配置","title":"查看实际配置"}]},{"url":"#高级配置","title":"高级配置","items":[{"url":"#target-allocator-资源配置","title":"Target Allocator 资源配置"},{"url":"#target-allocator-副本数","title":"Target Allocator 副本数"},{"url":"#自定义-target-allocator-镜像","title":"自定义 Target Allocator 镜像"},{"url":"#环境变量配置","title":"环境变量配置"},{"url":"#prometheus-custom-resources-发现","title":"Prometheus Custom Resources 发现"}]},{"url":"#实战示例","title":"实战示例","items":[{"url":"#示例-1监控-kubernetes-服务","title":"示例 1：监控 Kubernetes 服务","items":[{"url":"#1-创建-servicemonitor","title":"1. 创建 ServiceMonitor"},{"url":"#2-配置-collector-使用-target-allocator","title":"2. 配置 Collector 使用 Target Allocator"},{"url":"#3-验证","title":"3. 验证"}]},{"url":"#示例-2监控多个应用","title":"示例 2：监控多个应用","items":[{"url":"#1-创建多个-servicemonitor","title":"1. 创建多个 ServiceMonitor"},{"url":"#2-配置-collector","title":"2. 配置 Collector"}]},{"url":"#示例-3使用静态配置","title":"示例 3：使用静态配置"}]},{"url":"#故障排查","title":"故障排查","items":[{"url":"#1-target-allocator-无法启动","title":"1. Target Allocator 无法启动？"},{"url":"#2-collector-无法从-target-allocator-获取-targets","title":"2. Collector 无法从 Target Allocator 获取 targets？"},{"url":"#3-targets-未分发","title":"3. Targets 未分发？"},{"url":"#4-如何查看-target-allocator-分发的-targets","title":"4. 如何查看 Target Allocator 分发的 targets？"},{"url":"#5-target-allocator-发现不了-prometheus-custom-resources","title":"5. Target Allocator 发现不了 Prometheus Custom Resources？"}]},{"url":"#最佳实践","title":"最佳实践","items":[{"url":"#1-合理设置-collector-副本数","title":"1. 合理设置 Collector 副本数"},{"url":"#2-使用-prometheus-custom-resources","title":"2. 使用 Prometheus Custom Resources"},{"url":"#3-监控-target-allocator","title":"3. 监控 Target Allocator"},{"url":"#4-配置资源限制","title":"4. 配置资源限制"},{"url":"#5-使用版本固定的镜像","title":"5. 使用版本固定的镜像"},{"url":"#6-测试-target-分发","title":"6. 测试 Target 分发"}]},{"url":"#常见问题","title":"常见问题","items":[{"url":"#1-target-allocator-和-prometheus-的区别","title":"1. Target Allocator 和 Prometheus 的区别？"},{"url":"#2-可以同时使用-target-allocator-和直接配置吗","title":"2. 可以同时使用 Target Allocator 和直接配置吗？"},{"url":"#3-target-allocator-支持哪些服务发现方式","title":"3. Target Allocator 支持哪些服务发现方式？"},{"url":"#4-如何调试-target-allocator","title":"4. 如何调试 Target Allocator？"},{"url":"#5-target-allocator-的性能如何","title":"5. Target Allocator 的性能如何？"}]},{"url":"#下一步","title":"下一步"},{"url":"#参考资源","title":"参考资源"}]}]}}},"pageContext":{"id":"aae735ca-70e9-5fb8-85a4-672611dfbea9"}},
    "staticQueryHashes": ["1122327541","1339625561","148928582","2007862104","2140385554","3442269102","4275725850"]}