{
    "componentChunkName": "component---node-modules-shenhh-smooth-doc-src-templates-doc-js",
    "path": "/docs/languages/dotnet/",
    "result": {"data":{"mdx":{"fields":{"pageType":"doc","title":".NET 语言接入指南","editLink":"https://gitlab.corp.youdao.com/DevOPS/apm/docs/edit/master/pages/docs/languages/dotnet.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\": \".NET 语言接入指南\",\n  \"section\": \"语言接入指南\",\n  \"slug\": \"/docs/languages/dotnet/\",\n  \"order\": 5\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\": \"net-opentelemetry-接入指南\"\n  }, mdx(\"a\", {\n    parentName: \"h1\",\n    \"href\": \"#net-opentelemetry-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%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  }))), \".NET OpenTelemetry \\u63A5\\u5165\\u6307\\u5357\"), mdx(\"p\", null, \"\\u672C\\u6587\\u6863\\u63D0\\u4F9B .NET \\u5E94\\u7528\\u63A5\\u5165 OpenTelemetry \\u7684\\u5B8C\\u6574\\u6307\\u5357\\uFF0C\\u5305\\u62EC\\u96F6\\u4EE3\\u7801\\u63A5\\u5165\\u548C SDK \\u624B\\u52A8\\u63A5\\u5165\\u4E24\\u79CD\\u65B9\\u5F0F\\uFF0C\\u652F\\u6301 C#\\u3001F# \\u548C VB.NET\\u3002\"), mdx(\"h2\", {\n    \"id\": \"目录\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E7%9B%AE%E5%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  }))), \"\\u76EE\\u5F55\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"#%E6%A6%82%E8%BF%B0\"\n  }, \"\\u6982\\u8FF0\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"#%E9%9B%B6%E4%BB%A3%E7%A0%81%E6%8E%A5%E5%85%A5%E6%8E%A8%E8%8D%90\"\n  }, \"\\u96F6\\u4EE3\\u7801\\u63A5\\u5165\\uFF08\\u63A8\\u8350\\uFF09\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"#sdk-%E6%89%8B%E5%8A%A8%E6%8E%A5%E5%85%A5\"\n  }, \"SDK \\u624B\\u52A8\\u63A5\\u5165\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"#%E6%A1%86%E6%9E%B6%E9%9B%86%E6%88%90%E7%A4%BA%E4%BE%8B\"\n  }, \"\\u6846\\u67B6\\u96C6\\u6210\\u793A\\u4F8B\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"#%E9%AB%98%E7%BA%A7%E9%85%8D%E7%BD%AE\"\n  }, \"\\u9AD8\\u7EA7\\u914D\\u7F6E\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"#%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5\"\n  }, \"\\u6700\\u4F73\\u5B9E\\u8DF5\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"#%E6%95%85%E9%9A%9C%E6%8E%92%E6%9F%A5\"\n  }, \"\\u6545\\u969C\\u6392\\u67E5\"))), mdx(\"hr\", null), 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\": \"net-语言特性\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#net-%E8%AF%AD%E8%A8%80%E7%89%B9%E6%80%A7\",\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  }))), \".NET \\u8BED\\u8A00\\u7279\\u6027\"), mdx(\"p\", null, \".NET \\u7684 OpenTelemetry \\u652F\\u6301\\u5177\\u6709\\u4EE5\\u4E0B\\u7279\\u70B9:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u6210\\u719F\\u7A33\\u5B9A\"), \": API \\u548C SDK \\u5DF2\\u8FBE\\u5230 1.0 \\u7A33\\u5B9A\\u7248\\u672C\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u96F6\\u4EE3\\u7801\\u63A5\\u5165\"), \": \\u901A\\u8FC7\\u81EA\\u52A8\\u57CB\\u70B9\\u5B9E\\u73B0\\u96F6\\u4FB5\\u5165\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u591A\\u8BED\\u8A00\\u652F\\u6301\"), \": \\u652F\\u6301 C#\\u3001F#\\u3001VB.NET\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u4E30\\u5BCC\\u7684\\u57CB\\u70B9\\u5E93\"), \": \\u652F\\u6301 30+ \\u4E3B\\u6D41\\u6846\\u67B6\\u548C\\u5E93\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"ASP.NET Core \\u96C6\\u6210\"), \": \\u539F\\u751F\\u652F\\u6301 ASP.NET Core\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u6027\\u80FD\\u4F18\\u5F02\"), \": \\u4F4E\\u5F00\\u9500\\uFF0C\\u9AD8\\u6027\\u80FD\")), mdx(\"h3\", {\n    \"id\": \"版本要求\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82\",\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  }))), \"\\u7248\\u672C\\u8981\\u6C42\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \".NET \\u7248\\u672C\"), \": .NET 6.0+ (\\u63A8\\u8350 .NET 8.0+)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"OpenTelemetry .NET\"), \": v1.0.0+\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"\\u652F\\u6301\\u67B6\\u6784\"), \": x64, arm64\")), mdx(\"h3\", {\n    \"id\": \"支持的信号\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E6%94%AF%E6%8C%81%E7%9A%84%E4%BF%A1%E5%8F%B7\",\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  }))), \"\\u652F\\u6301\\u7684\\u4FE1\\u53F7\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u2705 \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Traces\"), \": \\u5B8C\\u5168\\u652F\\u6301\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u2705 \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Metrics\"), \": \\u5B8C\\u5168\\u652F\\u6301\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u2705 \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Logs\"), \": \\u5B8C\\u5168\\u652F\\u6301\")), mdx(\"h3\", {\n    \"id\": \"适用场景\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E9%80%82%E7%94%A8%E5%9C%BA%E6%99%AF\",\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  }))), \"\\u9002\\u7528\\u573A\\u666F\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"ASP.NET Core Web \\u5E94\\u7528\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"gRPC \\u670D\\u52A1\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u63A7\\u5236\\u53F0\\u5E94\\u7528\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u540E\\u53F0\\u670D\\u52A1\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\\u5FAE\\u670D\\u52A1\\u67B6\\u6784\")), mdx(\"hr\", null), mdx(\"h2\", {\n    \"id\": \"零代码接入推荐\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E9%9B%B6%E4%BB%A3%E7%A0%81%E6%8E%A5%E5%85%A5%E6%8E%A8%E8%8D%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  }))), \"\\u96F6\\u4EE3\\u7801\\u63A5\\u5165\\uFF08\\u63A8\\u8350\\uFF09\"), mdx(\"h3\", {\n    \"id\": \"方式-1-使用-opentelemetry-net-automatic-instrumentation\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E6%96%B9%E5%BC%8F-1-%E4%BD%BF%E7%94%A8-opentelemetry-net-automatic-instrumentation\",\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  }))), \"\\u65B9\\u5F0F 1: \\u4F7F\\u7528 OpenTelemetry .NET Automatic Instrumentation\"), mdx(\"p\", null, \"OpenTelemetry .NET \\u63D0\\u4F9B\\u4E86\\u81EA\\u52A8\\u57CB\\u70B9\\u5DE5\\u5177\\uFF0C\\u65E0\\u9700\\u4FEE\\u6539\\u4EE3\\u7801\\u5373\\u53EF\\u63A5\\u5165\\u3002\"), mdx(\"h4\", {\n    \"id\": \"安装\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E5%AE%89%E8%A3%85\",\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  }))), \"\\u5B89\\u88C5\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Windows\"), \":\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-powershell\"\n  }, \"# \\u4E0B\\u8F7D\\u5B89\\u88C5\\u811A\\u672C\\nInvoke-WebRequest -Uri \\\"https://raw.githubusercontent.com/open-telemetry/opentelemetry-dotnet-instrumentation/main/docs/install.ps1\\\" -OutFile install.ps1\\n\\n# \\u8FD0\\u884C\\u5B89\\u88C5\\u811A\\u672C\\n.\\\\install.ps1\\n\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Linux/macOS\"), \":\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u4E0B\\u8F7D\\u5B89\\u88C5\\u811A\\u672C\\ncurl -L https://raw.githubusercontent.com/open-telemetry/opentelemetry-dotnet-instrumentation/main/docs/install.sh | sh\\n\")), mdx(\"h4\", {\n    \"id\": \"配置环境变量\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E9%85%8D%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%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  }))), \"\\u914D\\u7F6E\\u73AF\\u5883\\u53D8\\u91CF\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u670D\\u52A1\\u4FE1\\u606F\\nexport OTEL_SERVICE_NAME=my-dotnet-service\\nexport OTEL_RESOURCE_ATTRIBUTES=service.version=1.0.0,deployment.environment=production\\n\\n# OTLP Exporter\\nexport OTEL_EXPORTER_OTLP_ENDPOINT=uptrace-grpc.yodao.cn:4317\\nexport OTEL_EXPORTER_OTLP_PROTOCOL=grpc\\nexport OTEL_EXPORTER_OTLP_HEADERS=uptrace-dsn=http://token@uptrace-grpc.yodao.cn/project\\n\\n# Traces \\u914D\\u7F6E\\nexport OTEL_TRACES_EXPORTER=otlp\\nexport OTEL_TRACES_SAMPLER=parentbased_traceidratio\\nexport OTEL_TRACES_SAMPLER_ARG=0.1\\n\\n# Metrics \\u914D\\u7F6E\\nexport OTEL_METRICS_EXPORTER=otlp\\nexport OTEL_METRIC_EXPORT_INTERVAL=60000\\n\\n# Logs \\u914D\\u7F6E\\nexport OTEL_LOGS_EXPORTER=otlp\\n\")), mdx(\"h4\", {\n    \"id\": \"启动应用\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E5%90%AF%E5%8A%A8%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  }))), \"\\u542F\\u52A8\\u5E94\\u7528\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u4F7F\\u7528 dotnet-instrument \\u542F\\u52A8\\ndotnet-instrument --output myapp.dll\\n\\n# \\u6216\\u4F7F\\u7528\\u73AF\\u5883\\u53D8\\u91CF\\nexport OTEL_DOTNET_AUTO_ENABLED=true\\ndotnet run\\n\")), mdx(\"h3\", {\n    \"id\": \"方式-2-使用-nuget-包自动配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E6%96%B9%E5%BC%8F-2-%E4%BD%BF%E7%94%A8-nuget-%E5%8C%85%E8%87%AA%E5%8A%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  }))), \"\\u65B9\\u5F0F 2: \\u4F7F\\u7528 NuGet \\u5305\\u81EA\\u52A8\\u914D\\u7F6E\"), mdx(\"h4\", {\n    \"id\": \"安装-nuget-包\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E5%AE%89%E8%A3%85-nuget-%E5%8C%85\",\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  }))), \"\\u5B89\\u88C5 NuGet \\u5305\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u5B89\\u88C5 OpenTelemetry \\u81EA\\u52A8\\u914D\\u7F6E\\u5305\\ndotnet add package OpenTelemetry.Instrumentation.AspNetCore\\ndotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol\\ndotnet add package OpenTelemetry.Extensions.Hosting\\n\")), mdx(\"h4\", {\n    \"id\": \"配置-programcs\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E9%85%8D%E7%BD%AE-programcs\",\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 Program.cs\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"using OpenTelemetry.Resources;\\nusing OpenTelemetry.Trace;\\nusing OpenTelemetry.Metrics;\\nusing OpenTelemetry.Logs;\\n\\nvar builder = WebApplication.CreateBuilder(args);\\n\\n// \\u6DFB\\u52A0 OpenTelemetry\\nbuilder.Services.AddOpenTelemetry()\\n    .ConfigureResource(resource => resource\\n        .AddService(serviceName: \\\"my-dotnet-service\\\",\\n            serviceVersion: \\\"1.0.0\\\"))\\n    .WithTracing(tracing => tracing\\n        .AddAspNetCoreInstrumentation()\\n        .AddHttpClientInstrumentation()\\n        .AddOtlpExporter(options =>\\n        {\\n            options.Endpoint = new Uri(\\\"uptrace-grpc.yodao.cn:4317\\\");\\n            options.Headers = \\\"uptrace-dsn=http://token@uptrace-grpc.yodao.cn/project\\\";\\n        }))\\n    .WithMetrics(metrics => metrics\\n        .AddAspNetCoreInstrumentation()\\n        .AddHttpClientInstrumentation()\\n        .AddOtlpExporter(options =>\\n        {\\n            options.Endpoint = new Uri(\\\"uptrace-grpc.yodao.cn:4317\\\");\\n            options.Headers = \\\"uptrace-dsn=http://token@uptrace-grpc.yodao.cn/project\\\";\\n        }));\\n\\n// \\u6DFB\\u52A0\\u65E5\\u5FD7\\nbuilder.Logging.AddOpenTelemetry(options =>\\n{\\n    options.AddOtlpExporter(otlpOptions =>\\n    {\\n        otlpOptions.Endpoint = new Uri(\\\"uptrace-grpc.yodao.cn:4317\\\");\\n        otlpOptions.Headers = \\\"uptrace-dsn=http://token@uptrace-grpc.yodao.cn/project\\\";\\n    });\\n});\\n\\nvar app = builder.Build();\\n\\napp.MapGet(\\\"/\\\", () => \\\"Hello World!\\\");\\n\\napp.Run();\\n\")), mdx(\"h3\", {\n    \"id\": \"方式-3-使用-kubernetes-operator\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E6%96%B9%E5%BC%8F-3-%E4%BD%BF%E7%94%A8-kubernetes-operator\",\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  }))), \"\\u65B9\\u5F0F 3: \\u4F7F\\u7528 Kubernetes Operator\"), mdx(\"p\", null, \"\\u5982\\u679C\\u5E94\\u7528\\u8FD0\\u884C\\u5728 Kubernetes \\u4E2D\\uFF0C\\u53EF\\u4EE5\\u4F7F\\u7528 OpenTelemetry Operator\\u3002\"), mdx(\"h4\", {\n    \"id\": \"安装-operator\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E5%AE%89%E8%A3%85-operator\",\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  }))), \"\\u5B89\\u88C5 Operator\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml\\n\")), mdx(\"h4\", {\n    \"id\": \"创建-instrumentation-资源\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E5%88%9B%E5%BB%BA-instrumentation-%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  }))), \"\\u521B\\u5EFA Instrumentation \\u8D44\\u6E90\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"apiVersion: opentelemetry.io/v1alpha1\\nkind: Instrumentation\\nmetadata:\\n  name: my-instrumentation\\n  namespace: default\\nspec:\\n  exporter:\\n    endpoint: uptrace-grpc.yodao.cn:4317\\n  env:\\n    - name: OTEL_EXPORTER_OTLP_HEADERS\\n      value: uptrace-dsn=http://token@uptrace-grpc.yodao.cn/project\\n  propagators:\\n    - tracecontext\\n    - baggage\\n  sampler:\\n    type: parentbased_traceidratio\\n    argument: \\\"0.1\\\"\\n\")), mdx(\"h4\", {\n    \"id\": \"部署应用\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E9%83%A8%E7%BD%B2%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  }))), \"\\u90E8\\u7F72\\u5E94\\u7528\"), mdx(\"p\", null, \"\\u5728 Pod \\u4E0A\\u6DFB\\u52A0 annotation:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-yaml\"\n  }, \"apiVersion: apps/v1\\nkind: Deployment\\nmetadata:\\n  name: my-app\\nspec:\\n  template:\\n    metadata:\\n      annotations:\\n        instrumentation.opentelemetry.io/inject-dotnet: \\\"true\\\"\\n    spec:\\n      containers:\\n      - name: app\\n        image: my-dotnet-app:latest\\n\")), mdx(\"h3\", {\n    \"id\": \"验证零代码接入\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E9%AA%8C%E8%AF%81%E9%9B%B6%E4%BB%A3%E7%A0%81%E6%8E%A5%E5%85%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  }))), \"\\u9A8C\\u8BC1\\u96F6\\u4EE3\\u7801\\u63A5\\u5165\"), mdx(\"p\", null, \"\\u542F\\u52A8\\u5E94\\u7528\\u540E\\uFF0C\\u8BBF\\u95EE\\u670D\\u52A1\\u7AEF\\u70B9\\uFF0C\\u7136\\u540E\\u5728 APM \\u5E73\\u53F0\\u67E5\\u770B\\u6570\\u636E\\u3002\"), mdx(\"hr\", null), mdx(\"h2\", {\n    \"id\": \"sdk-手动接入\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#sdk-%E6%89%8B%E5%8A%A8%E6%8E%A5%E5%85%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  }))), \"SDK \\u624B\\u52A8\\u63A5\\u5165\"), mdx(\"h3\", {\n    \"id\": \"安装依赖\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E5%AE%89%E8%A3%85%E4%BE%9D%E8%B5%96\",\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  }))), \"\\u5B89\\u88C5\\u4F9D\\u8D56\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"# \\u6838\\u5FC3 SDK\\ndotnet add package OpenTelemetry\\ndotnet add package OpenTelemetry.Api\\n\\n# OTLP Exporter\\ndotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol\\n\\n# \\u57CB\\u70B9\\u5E93\\ndotnet add package OpenTelemetry.Instrumentation.AspNetCore\\ndotnet add package OpenTelemetry.Instrumentation.Http\\ndotnet add package OpenTelemetry.Instrumentation.GrpcNetClient\\n\")), mdx(\"h3\", {\n    \"id\": \"基础初始化\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E5%9F%BA%E7%A1%80%E5%88%9D%E5%A7%8B%E5%8C%96\",\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\\u7840\\u521D\\u59CB\\u5316\"), mdx(\"h4\", {\n    \"id\": \"programcs-配置\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#programcs-%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  }))), \"Program.cs \\u914D\\u7F6E\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"using OpenTelemetry;\\nusing OpenTelemetry.Resources;\\nusing OpenTelemetry.Trace;\\nusing OpenTelemetry.Metrics;\\nusing OpenTelemetry.Logs;\\nusing System.Diagnostics;\\n\\nvar builder = WebApplication.CreateBuilder(args);\\n\\n// \\u521B\\u5EFA Resource\\nvar resource = ResourceBuilder.CreateDefault()\\n    .AddService(\\n        serviceName: \\\"my-dotnet-service\\\",\\n        serviceVersion: \\\"1.0.0\\\")\\n    .AddAttributes(new Dictionary<string, object>\\n    {\\n        [\\\"deployment.environment\\\"] = \\\"production\\\",\\n        [\\\"cloud.provider\\\"] = \\\"aws\\\",\\n        [\\\"cloud.region\\\"] = \\\"us-east-1\\\",\\n    });\\n\\n// \\u914D\\u7F6E Traces\\nbuilder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing =>\\n    {\\n        tracing\\n            .SetResourceBuilder(resource)\\n            .AddAspNetCoreInstrumentation()\\n            .AddHttpClientInstrumentation()\\n            .AddSource(\\\"my-service\\\")\\n            .AddOtlpExporter(options =>\\n            {\\n                options.Endpoint = new Uri(\\\"uptrace-grpc.yodao.cn:4317\\\");\\n                options.Headers = \\\"uptrace-dsn=http://token@uptrace-grpc.yodao.cn/project\\\";\\n                options.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.Grpc;\\n            });\\n    })\\n    .WithMetrics(metrics =>\\n    {\\n        metrics\\n            .SetResourceBuilder(resource)\\n            .AddAspNetCoreInstrumentation()\\n            .AddHttpClientInstrumentation()\\n            .AddMeter(\\\"my-service\\\")\\n            .AddOtlpExporter(options =>\\n            {\\n                options.Endpoint = new Uri(\\\"uptrace-grpc.yodao.cn:4317\\\");\\n                options.Headers = \\\"uptrace-dsn=http://token@uptrace-grpc.yodao.cn/project\\\";\\n                options.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.Grpc;\\n            });\\n    });\\n\\n// \\u914D\\u7F6E Logs\\nbuilder.Logging.AddOpenTelemetry(options =>\\n{\\n    options\\n        .SetResourceBuilder(resource)\\n        .AddOtlpExporter(otlpOptions =>\\n        {\\n            otlpOptions.Endpoint = new Uri(\\\"uptrace-grpc.yodao.cn:4317\\\");\\n            otlpOptions.Headers = \\\"uptrace-dsn=http://token@uptrace-grpc.yodao.cn/project\\\";\\n            otlpOptions.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.Grpc;\\n        });\\n});\\n\\nvar app = builder.Build();\\n\\napp.MapGet(\\\"/\\\", () => \\\"Hello World!\\\");\\n\\napp.Run();\\n\")), mdx(\"h3\", {\n    \"id\": \"traces---手动埋点\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#traces---%E6%89%8B%E5%8A%A8%E5%9F%8B%E7%82%B9\",\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  }))), \"Traces - \\u624B\\u52A8\\u57CB\\u70B9\"), mdx(\"h4\", {\n    \"id\": \"创建和使用-activity\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8-activity\",\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  }))), \"\\u521B\\u5EFA\\u548C\\u4F7F\\u7528 Activity\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"using System.Diagnostics;\\n\\npublic class OrderService\\n{\\n    private static readonly ActivitySource ActivitySource = new(\\\"my-service\\\");\\n\\n    public async Task ProcessOrderAsync(string orderId)\\n    {\\n        using var activity = ActivitySource.StartActivity(\\\"process_order\\\");\\n        activity?.SetTag(\\\"order.id\\\", orderId);\\n        activity?.SetTag(\\\"operation\\\", \\\"process\\\");\\n\\n        try\\n        {\\n            activity?.AddEvent(new ActivityEvent(\\\"order_validation_started\\\"));\\n\\n            // \\u9A8C\\u8BC1\\u8BA2\\u5355\\n            await ValidateOrderAsync(orderId);\\n\\n            activity?.AddEvent(new ActivityEvent(\\\"order_validated\\\"));\\n\\n            // \\u5904\\u7406\\u652F\\u4ED8\\n            await ProcessPaymentAsync(orderId);\\n\\n            activity?.AddEvent(new ActivityEvent(\\\"payment_processed\\\"));\\n\\n            activity?.SetStatus(ActivityStatusCode.Ok);\\n        }\\n        catch (Exception ex)\\n        {\\n            activity?.RecordException(ex);\\n            activity?.SetStatus(ActivityStatusCode.Error, ex.Message);\\n            throw;\\n        }\\n    }\\n\\n    private async Task ValidateOrderAsync(string orderId)\\n    {\\n        using var activity = ActivitySource.StartActivity(\\\"validate_order\\\");\\n        activity?.SetTag(\\\"order.id\\\", orderId);\\n\\n        // \\u4E1A\\u52A1\\u903B\\u8F91\\n        await Task.Delay(100);\\n    }\\n\\n    private async Task ProcessPaymentAsync(string orderId)\\n    {\\n        using var activity = ActivitySource.StartActivity(\\\"process_payment\\\");\\n        activity?.SetTag(\\\"order.id\\\", orderId);\\n        activity?.SetTag(\\\"payment.method\\\", \\\"credit_card\\\");\\n\\n        // \\u652F\\u4ED8\\u903B\\u8F91\\n        await Task.Delay(200);\\n    }\\n}\\n\")), mdx(\"h4\", {\n    \"id\": \"activity-属性和事件\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#activity-%E5%B1%9E%E6%80%A7%E5%92%8C%E4%BA%8B%E4%BB%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  }))), \"Activity \\u5C5E\\u6027\\u548C\\u4E8B\\u4EF6\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"using var activity = ActivitySource.StartActivity(\\\"example_operation\\\");\\n\\n// \\u8BBE\\u7F6E\\u5C5E\\u6027\\nactivity?.SetTag(\\\"user.id\\\", \\\"12345\\\");\\nactivity?.SetTag(\\\"user.email\\\", \\\"user@example.com\\\");\\nactivity?.SetTag(\\\"user.age\\\", 30);\\nactivity?.SetTag(\\\"user.premium\\\", true);\\n\\n// \\u6DFB\\u52A0\\u4E8B\\u4EF6\\nactivity?.AddEvent(new ActivityEvent(\\\"cache_miss\\\",\\n    tags: new ActivityTagsCollection\\n    {\\n        { \\\"cache.key\\\", \\\"user:12345\\\" },\\n        { \\\"cache.type\\\", \\\"redis\\\" },\\n    }));\\n\\n// \\u6DFB\\u52A0\\u5E26\\u65F6\\u95F4\\u6233\\u7684\\u4E8B\\u4EF6\\nactivity?.AddEvent(new ActivityEvent(\\\"retry_attempt\\\",\\n    timestamp: DateTimeOffset.UtcNow,\\n    tags: new ActivityTagsCollection\\n    {\\n        { \\\"retry.count\\\", 2 },\\n        { \\\"retry.reason\\\", \\\"timeout\\\" },\\n    }));\\n\")), mdx(\"h3\", {\n    \"id\": \"metrics---指标采集\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#metrics---%E6%8C%87%E6%A0%87%E9%87%87%E9%9B%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  }))), \"Metrics - \\u6307\\u6807\\u91C7\\u96C6\"), mdx(\"h4\", {\n    \"id\": \"counter计数器\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#counter%E8%AE%A1%E6%95%B0%E5%99%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  }))), \"Counter\\uFF08\\u8BA1\\u6570\\u5668\\uFF09\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"using System.Diagnostics.Metrics;\\n\\npublic class MetricsService\\n{\\n    private static readonly Meter Meter = new(\\\"my-service\\\");\\n    private static readonly Counter<long> RequestCounter = Meter.CreateCounter<long>(\\n        \\\"http.server.requests\\\",\\n        description: \\\"Total number of HTTP requests\\\");\\n\\n    public void RecordRequest(string method, string route, int statusCode)\\n    {\\n        RequestCounter.Add(1, new KeyValuePair<string, object?>[]\\n        {\\n            new(\\\"http.method\\\", method),\\n            new(\\\"http.route\\\", route),\\n            new(\\\"http.status_code\\\", statusCode),\\n        });\\n    }\\n}\\n\")), mdx(\"h4\", {\n    \"id\": \"histogram直方图\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#histogram%E7%9B%B4%E6%96%B9%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  }))), \"Histogram\\uFF08\\u76F4\\u65B9\\u56FE\\uFF09\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"private static readonly Histogram<double> RequestDuration = Meter.CreateHistogram<double>(\\n    \\\"http.server.duration\\\",\\n    unit: \\\"ms\\\",\\n    description: \\\"HTTP request duration\\\");\\n\\npublic void RecordDuration(double duration, string method, string route)\\n{\\n    RequestDuration.Record(duration, new KeyValuePair<string, object?>[]\\n    {\\n        new(\\\"http.method\\\", method),\\n        new(\\\"http.route\\\", route),\\n    });\\n}\\n\")), mdx(\"h4\", {\n    \"id\": \"observable-gauge可观察仪表\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#observable-gauge%E5%8F%AF%E8%A7%82%E5%AF%9F%E4%BB%AA%E8%A1%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  }))), \"Observable Gauge\\uFF08\\u53EF\\u89C2\\u5BDF\\u4EEA\\u8868\\uFF09\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"private static readonly ObservableGauge<long> MemoryUsage = Meter.CreateObservableGauge<long>(\\n    \\\"runtime.memory.heap_used\\\",\\n    unit: \\\"bytes\\\",\\n    description: \\\"Heap memory used\\\");\\n\\n// \\u6CE8\\u518C\\u56DE\\u8C03\\nMeter.CreateObservableGauge(\\\"runtime.memory.heap_used\\\", () =>\\n{\\n    return new Measurement<long>(\\n        GC.GetTotalMemory(false),\\n        new KeyValuePair<string, object?>(\\\"memory.type\\\", \\\"heap\\\"));\\n});\\n\")), mdx(\"h3\", {\n    \"id\": \"logs---日志集成\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#logs---%E6%97%A5%E5%BF%97%E9%9B%86%E6%88%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  }))), \"Logs - \\u65E5\\u5FD7\\u96C6\\u6210\"), mdx(\"h4\", {\n    \"id\": \"使用-ilogger\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E4%BD%BF%E7%94%A8-ilogger\",\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  }))), \"\\u4F7F\\u7528 ILogger\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"public class UserController : ControllerBase\\n{\\n    private readonly ILogger<UserController> _logger;\\n\\n    public UserController(ILogger<UserController> logger)\\n    {\\n        _logger = logger;\\n    }\\n\\n    [HttpGet(\\\"{id}\\\")]\\n    public async Task<IActionResult> GetUser(string id)\\n    {\\n        // \\u65E5\\u5FD7\\u81EA\\u52A8\\u5173\\u8054 Trace ID\\n        _logger.LogInformation(\\\"Getting user {UserId}\\\", id);\\n\\n        var user = await _userService.GetUserAsync(id);\\n        \\n        if (user == null)\\n        {\\n            _logger.LogWarning(\\\"User {UserId} not found\\\", id);\\n            return NotFound();\\n        }\\n\\n        _logger.LogInformation(\\\"User {UserId} retrieved successfully\\\", id);\\n        return Ok(user);\\n    }\\n}\\n\")), mdx(\"h4\", {\n    \"id\": \"结构化日志\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E7%BB%93%E6%9E%84%E5%8C%96%E6%97%A5%E5%BF%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  }))), \"\\u7ED3\\u6784\\u5316\\u65E5\\u5FD7\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"_logger.LogInformation(\\n    \\\"Processing order {OrderId} for user {UserId}\\\",\\n    orderId,\\n    userId);\\n\\n// \\u4F7F\\u7528\\u8303\\u56F4\\nusing (_logger.BeginScope(new Dictionary<string, object>\\n{\\n    [\\\"OrderId\\\"] = orderId,\\n    [\\\"UserId\\\"] = userId,\\n}))\\n{\\n    _logger.LogInformation(\\\"Processing order\\\");\\n    // \\u6240\\u6709\\u65E5\\u5FD7\\u90FD\\u4F1A\\u81EA\\u52A8\\u5305\\u542B OrderId \\u548C UserId\\n}\\n\")), mdx(\"hr\", null), mdx(\"h2\", {\n    \"id\": \"框架集成示例\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#%E6%A1%86%E6%9E%B6%E9%9B%86%E6%88%90%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  }))), \"\\u6846\\u67B6\\u96C6\\u6210\\u793A\\u4F8B\"), mdx(\"h3\", {\n    \"id\": \"aspnet-core\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#aspnet-core\",\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  }))), \"ASP.NET Core\"), mdx(\"h4\", {\n    \"id\": \"基础集成\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E5%9F%BA%E7%A1%80%E9%9B%86%E6%88%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  }))), \"\\u57FA\\u7840\\u96C6\\u6210\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"var builder = WebApplication.CreateBuilder(args);\\n\\nbuilder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing => tracing\\n        .AddAspNetCoreInstrumentation()\\n        .AddOtlpExporter())\\n    .WithMetrics(metrics => metrics\\n        .AddAspNetCoreInstrumentation()\\n        .AddOtlpExporter());\\n\\nvar app = builder.Build();\\n\\napp.MapGet(\\\"/users/{id}\\\", async (string id) =>\\n{\\n    // \\u81EA\\u52A8\\u521B\\u5EFA Span\\n    return await GetUserAsync(id);\\n});\\n\\napp.Run();\\n\")), mdx(\"h4\", {\n    \"id\": \"自定义中间件\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%AD%E9%97%B4%E4%BB%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  }))), \"\\u81EA\\u5B9A\\u4E49\\u4E2D\\u95F4\\u4EF6\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"public class TracingMiddleware\\n{\\n    private readonly RequestDelegate _next;\\n    private static readonly ActivitySource ActivitySource = new(\\\"my-service\\\");\\n\\n    public TracingMiddleware(RequestDelegate next)\\n    {\\n        _next = next;\\n    }\\n\\n    public async Task InvokeAsync(HttpContext context)\\n    {\\n        using var activity = ActivitySource.StartActivity(\\\"custom_middleware\\\");\\n        activity?.SetTag(\\\"http.method\\\", context.Request.Method);\\n        activity?.SetTag(\\\"http.url\\\", context.Request.Path);\\n\\n        await _next(context);\\n\\n        activity?.SetTag(\\\"http.status_code\\\", context.Response.StatusCode);\\n    }\\n}\\n\\n// \\u6CE8\\u518C\\u4E2D\\u95F4\\u4EF6\\napp.UseMiddleware<TracingMiddleware>();\\n\")), mdx(\"h3\", {\n    \"id\": \"grpc\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#grpc\",\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  }))), \"gRPC\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"using Grpc.Core;\\nusing OpenTelemetry.Trace;\\n\\npublic class UserService : User.UserBase\\n{\\n    private static readonly ActivitySource ActivitySource = new(\\\"my-service\\\");\\n\\n    public override async Task<GetUserResponse> GetUser(\\n        GetUserRequest request,\\n        ServerCallContext context)\\n    {\\n        using var activity = ActivitySource.StartActivity(\\\"GetUser\\\");\\n        activity?.SetTag(\\\"user.id\\\", request.Id);\\n\\n        try\\n        {\\n            var user = await _repository.GetUserAsync(request.Id);\\n            activity?.SetStatus(ActivityStatusCode.Ok);\\n            return new GetUserResponse { Id = user.Id, Name = user.Name };\\n        }\\n        catch (Exception ex)\\n        {\\n            activity?.RecordException(ex);\\n            activity?.SetStatus(ActivityStatusCode.Error, ex.Message);\\n            throw;\\n        }\\n    }\\n}\\n\\n// \\u914D\\u7F6E gRPC\\nbuilder.Services.AddGrpc();\\nbuilder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing => tracing\\n        .AddGrpcClientInstrumentation()\\n        .AddOtlpExporter());\\n\")), mdx(\"h3\", {\n    \"id\": \"entity-framework-core\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#entity-framework-core\",\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  }))), \"Entity Framework Core\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"builder.Services.AddDbContext<ApplicationDbContext>(options =>\\n    options.UseSqlServer(connectionString));\\n\\nbuilder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing => tracing\\n        .AddEntityFrameworkCoreInstrumentation()\\n        .AddOtlpExporter());\\n\\n// \\u4F7F\\u7528\\u793A\\u4F8B\\npublic class UserService\\n{\\n    private readonly ApplicationDbContext _context;\\n\\n    public async Task<User> GetUserAsync(string id)\\n    {\\n        // \\u81EA\\u52A8\\u8FFD\\u8E2A\\u6570\\u636E\\u5E93\\u67E5\\u8BE2\\n        return await _context.Users\\n            .FirstOrDefaultAsync(u => u.Id == id);\\n    }\\n}\\n\")), mdx(\"h3\", {\n    \"id\": \"http-客户端\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#http-%E5%AE%A2%E6%88%B7%E7%AB%AF\",\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 \\u5BA2\\u6237\\u7AEF\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"builder.Services.AddHttpClient();\\n\\nbuilder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing => tracing\\n        .AddHttpClientInstrumentation()\\n        .AddOtlpExporter());\\n\\n// \\u4F7F\\u7528\\u793A\\u4F8B\\npublic class PaymentService\\n{\\n    private readonly HttpClient _httpClient;\\n\\n    public async Task ProcessPaymentAsync(string orderId)\\n    {\\n        // \\u81EA\\u52A8\\u8FFD\\u8E2A HTTP \\u8BF7\\u6C42\\n        var response = await _httpClient.PostAsync(\\n            \\\"https://payment-gateway.com/charge\\\",\\n            new StringContent(orderId));\\n    }\\n}\\n\")), mdx(\"h3\", {\n    \"id\": \"redis\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#redis\",\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  }))), \"Redis\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"builder.Services.AddStackExchangeRedisCache(options =>\\n{\\n    options.Configuration = \\\"localhost:6379\\\";\\n});\\n\\nbuilder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing => tracing\\n        .AddRedisInstrumentation()\\n        .AddOtlpExporter());\\n\\n// \\u4F7F\\u7528\\u793A\\u4F8B\\npublic class CacheService\\n{\\n    private readonly IDistributedCache _cache;\\n\\n    public async Task<string> GetAsync(string key)\\n    {\\n        // \\u81EA\\u52A8\\u8FFD\\u8E2A Redis \\u64CD\\u4F5C\\n        return await _cache.GetStringAsync(key);\\n    }\\n}\\n\")), mdx(\"hr\", null), 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\": \"自定义采样策略\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E8%87%AA%E5%AE%9A%E4%B9%89%E9%87%87%E6%A0%B7%E7%AD%96%E7%95%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  }))), \"\\u81EA\\u5B9A\\u4E49\\u91C7\\u6837\\u7B56\\u7565\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"builder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing => tracing\\n        .SetSampler(new ParentBasedSampler(\\n            new TraceIdRatioBasedSampler(0.1)))\\n        .AddOtlpExporter());\\n\")), mdx(\"h3\", {\n    \"id\": \"多-exporter-配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E5%A4%9A-exporter-%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  }))), \"\\u591A Exporter \\u914D\\u7F6E\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"builder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing => tracing\\n        .AddOtlpExporter() // \\u4E3B\\u8981\\u540E\\u7AEF\\n        .AddConsoleExporter() // \\u63A7\\u5236\\u53F0\\u8F93\\u51FA\\n        .AddJaegerExporter()); // Jaeger\\n\")), mdx(\"h3\", {\n    \"id\": \"性能优化配置\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96%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  }))), \"\\u6027\\u80FD\\u4F18\\u5316\\u914D\\u7F6E\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"builder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing => tracing\\n        .AddOtlpExporter(options =>\\n        {\\n            options.Endpoint = new Uri(\\\"uptrace-grpc.yodao.cn:4317\\\");\\n            options.Headers = \\\"uptrace-dsn=http://token@uptrace-grpc.yodao.cn/project\\\";\\n            options.BatchExportProcessorOptions = new BatchExportProcessorOptions<Activity>\\n            {\\n                MaxQueueSize = 2048,\\n                ScheduledDelayMilliseconds = 5000,\\n                MaxExportBatchSize = 512,\\n                ExporterTimeoutMilliseconds = 30000,\\n            };\\n        }));\\n\")), mdx(\"hr\", null), 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-使用-activitysource\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#1-%E4%BD%BF%E7%94%A8-activitysource\",\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. \\u4F7F\\u7528 ActivitySource\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"// \\u2705 \\u6B63\\u786E\\uFF1A\\u5728\\u7C7B\\u7EA7\\u522B\\u521B\\u5EFA ActivitySource\\npublic class OrderService\\n{\\n    private static readonly ActivitySource ActivitySource = new(\\\"my-service\\\");\\n\\n    public async Task ProcessOrderAsync(string orderId)\\n    {\\n        using var activity = ActivitySource.StartActivity(\\\"process_order\\\");\\n        // ...\\n    }\\n}\\n\")), mdx(\"h3\", {\n    \"id\": \"2-错误处理\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#2-%E9%94%99%E8%AF%AF%E5%A4%84%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  }))), \"2. \\u9519\\u8BEF\\u5904\\u7406\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"// \\u2705 \\u6B63\\u786E\\uFF1A\\u8BB0\\u5F55\\u5F02\\u5E38\\u5E76\\u8BBE\\u7F6E\\u72B6\\u6001\\ntry\\n{\\n    await ProcessOrderAsync(orderId);\\n    activity?.SetStatus(ActivityStatusCode.Ok);\\n}\\ncatch (Exception ex)\\n{\\n    activity?.RecordException(ex);\\n    activity?.SetStatus(ActivityStatusCode.Error, ex.Message);\\n    throw;\\n}\\n\")), mdx(\"h3\", {\n    \"id\": \"3-资源管理\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#3-%E8%B5%84%E6%BA%90%E7%AE%A1%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  }))), \"3. \\u8D44\\u6E90\\u7BA1\\u7406\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"// \\u2705 \\u6B63\\u786E\\uFF1A\\u4F7F\\u7528 using \\u786E\\u4FDD Activity \\u7ED3\\u675F\\nusing var activity = ActivitySource.StartActivity(\\\"operation\\\");\\n// \\u4E1A\\u52A1\\u903B\\u8F91\\n\")), mdx(\"hr\", null), 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\": \"常见问题\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\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(\"h4\", {\n    \"id\": \"1-数据未发送到后端\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#1-%E6%95%B0%E6%8D%AE%E6%9C%AA%E5%8F%91%E9%80%81%E5%88%B0%E5%90%8E%E7%AB%AF\",\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. \\u6570\\u636E\\u672A\\u53D1\\u9001\\u5230\\u540E\\u7AEF\"), mdx(\"p\", null, \"\\u68C0\\u67E5\\u914D\\u7F6E:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"builder.Services.AddOpenTelemetry()\\n    .WithTracing(tracing => tracing\\n        .AddConsoleExporter() // \\u4E34\\u65F6\\u6DFB\\u52A0\\uFF0C\\u9A8C\\u8BC1\\u6570\\u636E\\u751F\\u6210\\n        .AddOtlpExporter());\\n\")), mdx(\"h4\", {\n    \"id\": \"2-activity-未关联\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#2-activity-%E6%9C%AA%E5%85%B3%E8%81%94\",\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. Activity \\u672A\\u5173\\u8054\"), mdx(\"p\", null, \"\\u786E\\u4FDD\\u4F7F\\u7528\\u76F8\\u540C\\u7684 ActivitySource:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"private static readonly ActivitySource ActivitySource = new(\\\"my-service\\\");\\n\")), mdx(\"hr\", null), 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/getting-started/environment-variables/\"\n  }, \"\\u73AF\\u5883\\u53D8\\u91CF\\u914D\\u7F6E\"), \" - \\u4E86\\u89E3\\u6240\\u6709\\u914D\\u7F6E\\u9009\\u9879\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/docs/advanced/sampling/\"\n  }, \"\\u9AD8\\u7EA7\\u914D\\u7F6E\"), \" - \\u6DF1\\u5165\\u4E86\\u89E3\\u91C7\\u6837\\u548C\\u6027\\u80FD\\u4F18\\u5316\")), 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/languages/net/\"\n  }, \"OpenTelemetry .NET Documentation\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://github.com/open-telemetry/opentelemetry-dotnet\"\n  }, \"OpenTelemetry .NET SDK\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://opentelemetry.io/docs/specs/semconv/\"\n  }, \".NET Semantic Conventions\"))));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#net-opentelemetry-接入指南","title":".NET OpenTelemetry 接入指南","items":[{"url":"#目录","title":"目录"},{"url":"#概述","title":"概述","items":[{"url":"#net-语言特性","title":".NET 语言特性"},{"url":"#版本要求","title":"版本要求"},{"url":"#支持的信号","title":"支持的信号"},{"url":"#适用场景","title":"适用场景"}]},{"url":"#零代码接入推荐","title":"零代码接入（推荐）","items":[{"url":"#方式-1-使用-opentelemetry-net-automatic-instrumentation","title":"方式 1: 使用 OpenTelemetry .NET Automatic Instrumentation","items":[{"url":"#安装","title":"安装"},{"url":"#配置环境变量","title":"配置环境变量"},{"url":"#启动应用","title":"启动应用"}]},{"url":"#方式-2-使用-nuget-包自动配置","title":"方式 2: 使用 NuGet 包自动配置","items":[{"url":"#安装-nuget-包","title":"安装 NuGet 包"},{"url":"#配置-programcs","title":"配置 Program.cs"}]},{"url":"#方式-3-使用-kubernetes-operator","title":"方式 3: 使用 Kubernetes Operator","items":[{"url":"#安装-operator","title":"安装 Operator"},{"url":"#创建-instrumentation-资源","title":"创建 Instrumentation 资源"},{"url":"#部署应用","title":"部署应用"}]},{"url":"#验证零代码接入","title":"验证零代码接入"}]},{"url":"#sdk-手动接入","title":"SDK 手动接入","items":[{"url":"#安装依赖","title":"安装依赖"},{"url":"#基础初始化","title":"基础初始化","items":[{"url":"#programcs-配置","title":"Program.cs 配置"}]},{"url":"#traces---手动埋点","title":"Traces - 手动埋点","items":[{"url":"#创建和使用-activity","title":"创建和使用 Activity"},{"url":"#activity-属性和事件","title":"Activity 属性和事件"}]},{"url":"#metrics---指标采集","title":"Metrics - 指标采集","items":[{"url":"#counter计数器","title":"Counter（计数器）"},{"url":"#histogram直方图","title":"Histogram（直方图）"},{"url":"#observable-gauge可观察仪表","title":"Observable Gauge（可观察仪表）"}]},{"url":"#logs---日志集成","title":"Logs - 日志集成","items":[{"url":"#使用-ilogger","title":"使用 ILogger"},{"url":"#结构化日志","title":"结构化日志"}]}]},{"url":"#框架集成示例","title":"框架集成示例","items":[{"url":"#aspnet-core","title":"ASP.NET Core","items":[{"url":"#基础集成","title":"基础集成"},{"url":"#自定义中间件","title":"自定义中间件"}]},{"url":"#grpc","title":"gRPC"},{"url":"#entity-framework-core","title":"Entity Framework Core"},{"url":"#http-客户端","title":"HTTP 客户端"},{"url":"#redis","title":"Redis"}]},{"url":"#高级配置","title":"高级配置","items":[{"url":"#自定义采样策略","title":"自定义采样策略"},{"url":"#多-exporter-配置","title":"多 Exporter 配置"},{"url":"#性能优化配置","title":"性能优化配置"}]},{"url":"#最佳实践","title":"最佳实践","items":[{"url":"#1-使用-activitysource","title":"1. 使用 ActivitySource"},{"url":"#2-错误处理","title":"2. 错误处理"},{"url":"#3-资源管理","title":"3. 资源管理"}]},{"url":"#故障排查","title":"故障排查","items":[{"url":"#常见问题","title":"常见问题","items":[{"url":"#1-数据未发送到后端","title":"1. 数据未发送到后端"},{"url":"#2-activity-未关联","title":"2. Activity 未关联"}]}]},{"url":"#下一步","title":"下一步"},{"url":"#参考资源","title":"参考资源"}]}]}}},"pageContext":{"id":"05337730-c519-59e3-ba2e-b1abbc93674e"}},
    "staticQueryHashes": ["1122327541","1339625561","148928582","2007862104","2140385554","3442269102","4275725850"]}