7.5. 配置 OpenTelemetry 导出器
使用 OpenTelemetry 导出器服务启用 GuardrailsOrchestrator 服务的可观察性提供的 trace 和指标。
先决条件
- 您已从 OperatorHub 安装 Red Hat OpenShift AI 分布式追踪平台,并使用默认设置创建了一个 Jaeger 实例。
- 您已从 OperatorHub 安装了红帽构建的 OpenTelemetry,并创建了 OpenTelemetry 实例。
流程
定义
GuardrailsOrchestrator自定义资源对象,在名为orchestrator_otel_cr.yaml的 YAML 文件中指定otelExporter配置:配置了 OpenTelemetry 的
orchestrator_otel_cr.yaml对象示例:apiVersion: trustyai.opendatahub.io/v1alpha1 kind: GuardrailsOrchestrator metadata: name: gorch-test spec: orchestratorConfig: "fms-orchestr8-config-nlp"1 replicas: 1 otelExporter: protocol: "http" otlpEndpoint: "localhost:4318" otlpExport: "metrics"- 1
- 这引用了"部署 Guardrails Orchestrator"第 1 步中创建的配置映射。
部署编配器自定义资源:
$ oc apply -f orchestrator_otel_cr.yaml观察 Jaeger 跟踪:
- 在 OpenShift Web 控制台中,将视角从 Administrator 更改为 Developer。
- 进入 Topology 并点 Jaeger url。
- 在 Service 下,选择 jaeger-all-in-one 并点 Find Traces 按钮。