搜索

10.2. 配置 APIcast 进行追踪

download PDF

为确保 3scale API 的可扩展且可靠的网关基础架构,您可以手动配置 APIcast 进行追踪。这将有助于确保 API 服务的可靠且可扩展的网关基础架构。

流程

  1. 为 APIcast 工具创建配置文件:

    • 配置文件规格在 NGINX 检测库存储库中定义

      $ oc apply -f - <<EOF
      apiVersion: v1
      kind: Secret
      metadata:
        name: otel-config
      type: Opaque
      stringData:
        config.json: |
          # "otlp" is the only supported exporter in APIcast
          exporter = "otlp"
          processor = "simple"
          [exporters.otlp]
          # Alternatively the OTEL_EXPORTER_OTLP_ENDPOINT environment variable can also be used.
          host = "${COLLECTOR_HOST}"
          port = ${COLLECTOR_PORT}
          # Optional: enable SSL, for endpoints that support it
          # use_ssl = true
          # Optional: set a filesystem path to a pem file to be used for SSL encryption
          # (when use_ssl = true)
          # ssl_cert_path = "/path/to/cert.pem"
          [processors.batch]
          max_queue_size = 2048
          schedule_delay_millis = 5000
          max_export_batch_size = 512
          [service]
          name = "apicast" # Opentelemetry resource name
      EOF
  2. 定义指定 openTelemetry 属性的 APIcast 自定义资源(CR)。在 CR 定义中,将 openTelemetry.tracingConfigSecretRef.name 属性设置为包含 openTelemetry 配置详情的 secret 的名称。以下示例显示有关配置 openTelemetry 的内容:

    apiVersion: apps.3scale.net/v1alpha1
    kind: APIcast
    metadata:
      name: apicast1
    spec:
      ...
      openTelemetry:
        enabled: true
        tracingConfigSecretRef:
          name: "$NAME_OF_SECRET"
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.