10.2. トレース用の APIcast の設定
3scale API のスケーラブルで信頼性の高いゲートウェイインフラストラクチャーを確保するために、トレース用に APIcast を手動で設定できます。これは、API サービスの信頼性とスケーラブルなゲートウェイインフラストラクチャーを確保するのに役立ちます。
手順
APIcast インストルメンテーションの設定ファイルを作成します。
設定ファイルの仕様は、NGINX インストルメンテーションライブラリーリポジトリー で定義されます。
$ oc apply -f - <<EOFapiVersion: 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
openTelemetry属性を指定する APIcast カスタムリソース (CR) を定義します。CR 定義で、openTelemetry.tracingConfigSecretRef.name属性を openTelemetry 設定の詳細を含むシークレットの名前に設定します。以下の例は、openTelemetry の設定に関するコンテンツのみを示しています。apiVersion: apps.3scale.net/v1alpha1 kind: APIcast metadata: name: apicast1 spec: ... openTelemetry: enabled: true tracingConfigSecretRef: name: "$NAME_OF_SECRET"