margin-left:6.0pt;margin-bottom:.0001pt"><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">创建一个新的</span><span lang="EN-US" style="font-family:
"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;color:black;mso-fareast-language:
ZH-CN">YAML</span><span style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black;mso-fareast-language:ZH-CN">文件,用来保存</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">Istio</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">将自动生成和收集的新度量标准和日志流的配置。</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">接下来我们就可以验证是否采集到了刚刚的请求数据。在</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">Kubernetes</span><span style="mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman";
color:black;mso-fareast-language:ZH-CN">环境中,通过执行以下命令为</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">Prometheus</span><span style="mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman";
color:black;mso-fareast-language:ZH-CN">设置端口转发:</span><span lang="EN-US" style="mso-fareast-language:ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="font-family:
"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;color:black;mso-fareast-language:
ZH-CN">$ kubectl -n istio-system port-forward $(kubectl -n istio-system get pod
-l app=prometheus -o jsonpath=´{.items[0].metadata.name}´) 9090:9090 &</span><span lang="EN-US" style="mso-fareast-language:ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black">通过</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black">Prometheus UI</span><span lang="EN-US" style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black">查看新指标的值。执行对</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black">istio_double_request_count</span><span lang="EN-US" style="mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman";
color:black">度量值的查询。</span></p><p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="mso-fareast-language:
ZH-CN">
<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="font-family:
"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;color:black;mso-fareast-language:
ZH-CN">2</span>遥测配置</p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US">设置</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">mixer</span><span lang="EN-US">的三个功能:</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:48.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span lang="EN-US" style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol;mso-fareast-language:ZH-CN"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black;mso-fareast-language:ZH-CN">从</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">Istio</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">的属性中生成实例信息,比如在我们上面的实践中打印的</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">metric</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">和日志信息。</span><span lang="EN-US" style="mso-fareast-language:
ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:48.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span lang="EN-US" style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol;mso-fareast-language:ZH-CN"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black;mso-fareast-language:ZH-CN">创建出</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">adapter</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">适配器,可以帮助我们处理生成的实例。</span><span lang="EN-US" style="mso-fareast-language:ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:48.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span lang="EN-US" style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol;mso-fareast-language:ZH-CN"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black;mso-fareast-language:ZH-CN">根据定义的规则向</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">adapter</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">发送实例信息。</span><span lang="EN-US" style="mso-fareast-language:
ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="mso-fareast-language:
ZH-CN"><span style="font-family: "Times New Roman", serif;">3</span></span><span lang="EN-US" style="font-family: "Times New Roman", serif;">metrics</span><span lang="EN-US">配置</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="font-family: "Times New Roman", serif;">metric</span><span lang="EN-US">配置的模块定义了用于生成</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">metric</span><span lang="EN-US">。此实例配置根据</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">Envoy</span><span lang="EN-US">报告的属性(由</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">Mixer</span><span lang="EN-US">自身生成)告诉</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">Mixer </span><span lang="EN-US">如何为任何给定请求生成</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">metric</span><span lang="EN-US">。</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span style="font-family: "Times New Roman", serif;">4</span>日志配置</p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black">日志配置指示</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black">Mixer</span><span lang="EN-US" style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black">将日志条目发送到</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black">stdout</span><span lang="EN-US" style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black">。它同样使用三个模块来进行配置:实例配置,处理程序</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black"> </span><span lang="EN-US" style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black">配置和规则配置。</span></p>"/>
margin-left:6.0pt;margin-bottom:.0001pt"><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">创建一个新的</span><span lang="EN-US" style="font-family:
"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;color:black;mso-fareast-language:
ZH-CN">YAML</span><span style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black;mso-fareast-language:ZH-CN">文件,用来保存</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">Istio</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">将自动生成和收集的新度量标准和日志流的配置。</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">接下来我们就可以验证是否采集到了刚刚的请求数据。在</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">Kubernetes</span><span style="mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman";
color:black;mso-fareast-language:ZH-CN">环境中,通过执行以下命令为</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">Prometheus</span><span style="mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman";
color:black;mso-fareast-language:ZH-CN">设置端口转发:</span><span lang="EN-US" style="mso-fareast-language:ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="font-family:
"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;color:black;mso-fareast-language:
ZH-CN">$ kubectl -n istio-system port-forward $(kubectl -n istio-system get pod
-l app=prometheus -o jsonpath=´{.items[0].metadata.name}´) 9090:9090 &</span><span lang="EN-US" style="mso-fareast-language:ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black">通过</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black">Prometheus UI</span><span lang="EN-US" style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black">查看新指标的值。执行对</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black">istio_double_request_count</span><span lang="EN-US" style="mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman";
color:black">度量值的查询。</span></p><p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="mso-fareast-language:
ZH-CN">
<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="font-family:
"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;color:black;mso-fareast-language:
ZH-CN">2</span>遥测配置</p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US">设置</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">mixer</span><span lang="EN-US">的三个功能:</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:48.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span lang="EN-US" style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol;mso-fareast-language:ZH-CN"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black;mso-fareast-language:ZH-CN">从</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">Istio</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">的属性中生成实例信息,比如在我们上面的实践中打印的</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">metric</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">和日志信息。</span><span lang="EN-US" style="mso-fareast-language:
ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:48.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span lang="EN-US" style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol;mso-fareast-language:ZH-CN"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black;mso-fareast-language:ZH-CN">创建出</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">adapter</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">适配器,可以帮助我们处理生成的实例。</span><span lang="EN-US" style="mso-fareast-language:ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:48.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span lang="EN-US" style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol;mso-fareast-language:ZH-CN"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black;mso-fareast-language:ZH-CN">根据定义的规则向</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black;mso-fareast-language:ZH-CN">adapter</span><span style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black;
mso-fareast-language:ZH-CN">发送实例信息。</span><span lang="EN-US" style="mso-fareast-language:
ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="mso-fareast-language:
ZH-CN"><span style="font-family: "Times New Roman", serif;">3</span></span><span lang="EN-US" style="font-family: "Times New Roman", serif;">metrics</span><span lang="EN-US">配置</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="font-family: "Times New Roman", serif;">metric</span><span lang="EN-US">配置的模块定义了用于生成</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">metric</span><span lang="EN-US">。此实例配置根据</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">Envoy</span><span lang="EN-US">报告的属性(由</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">Mixer</span><span lang="EN-US">自身生成)告诉</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">Mixer </span><span lang="EN-US">如何为任何给定请求生成</span><span lang="EN-US" style="font-family: "Times New Roman", serif;">metric</span><span lang="EN-US">。</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span style="font-family: "Times New Roman", serif;">4</span>日志配置</p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:6.0pt;margin-bottom:.0001pt"><span lang="EN-US" style="mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:black">日志配置指示</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black">Mixer</span><span lang="EN-US" style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black">将日志条目发送到</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black">stdout</span><span lang="EN-US" style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black">。它同样使用三个模块来进行配置:实例配置,处理程序</span><span lang="EN-US" style="font-family:"Times New Roman",serif;mso-bidi-theme-font:minor-bidi;
color:black"> </span><span lang="EN-US" style="mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";color:black">配置和规则配置。</span></p>"/>
创建一个新的YAML文件,用来保存Istio将自动生成和收集的新度量标准和日志流的配置。
接下来我们就可以验证是否采集到了刚刚的请求数据。在Kubernetes环境中,通过执行以下命令为Prometheus设置端口转发:
$ kubectl -n istio-system port-forward $(kubectl -n istio-system get pod
-l app=prometheus -o jsonpath='{.items[0].metadata.name}') 9090:9090 &
通过Prometheus UI查看新指标的值。执行对istio_double_request_count度量值的查询。
2遥测配置
设置mixer的三个功能:
·
从Istio的属性中生成实例信息,比如在我们上面的实践中打印的metric和日志信息。
·
创建出adapter适配器,可以帮助我们处理生成的实例。
·
根据定义的规则向adapter发送实例信息。
3metrics配置
metric配置的模块定义了用于生成metric。此实例配置根据Envoy报告的属性(由Mixer自身生成)告诉Mixer 如何为任何给定请求生成metric。
4日志配置
日志配置指示Mixer将日志条目发送到stdout。它同样使用三个模块来进行配置:实例配置,处理程序 配置和规则配置。