Este contenido no está disponible en el idioma seleccionado.
Chapter 8. Forwarding telemetry data
You can use the OpenTelemetry Collector to forward your telemetry data.
8.1. Forwarding traces to a TempoStack instance Copiar enlaceEnlace copiado en el portapapeles!
To configure forwarding traces to a TempoStack instance, you can deploy and configure the OpenTelemetry Collector. You can deploy the OpenTelemetry Collector in the deployment mode by using the specified processors, receivers, and exporters. For other modes, see the OpenTelemetry Collector documentation linked in Additional resources.
Prerequisites
- The Red Hat build of OpenTelemetry Operator is installed.
- The Tempo Operator is installed.
- A TempoStack instance is deployed on the cluster.
Procedure
Create a service account for the OpenTelemetry Collector.
Example ServiceAccount
apiVersion: v1 kind: ServiceAccount metadata: name: otel-collector-deployment
apiVersion: v1 kind: ServiceAccount metadata: name: otel-collector-deployment
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a cluster role for the service account.
Example ClusterRole
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- This example uses the Kubernetes Attributes Processor, which requires these permissions for the
pods
andnamespaces
resources. - 2
- Also due to the Kubernetes Attributes Processor, these permissions are required for the
replicasets
resources. - 3
- This example also uses the Resource Detection Processor, which requires these permissions for the
infrastructures
andstatus
resources.
Bind the cluster role to the service account.
Example ClusterRoleBinding
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the YAML file to define the
OpenTelemetryCollector
custom resource (CR).Example OpenTelemetryCollector
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The Collector exporter is configured to export OTLP and points to the Tempo distributor endpoint,
"tempo-simplest-distributor:4317"
in this example, which is already created. - 2
- The Collector is configured with a receiver for Jaeger traces, OpenCensus traces over the OpenCensus protocol, Zipkin traces over the Zipkin protocol, and OTLP traces over the gRPC protocol.
You can deploy telemetrygen
as a test:
8.2. Forwarding logs to a LokiStack instance Copiar enlaceEnlace copiado en el portapapeles!
You can deploy the OpenTelemetry Collector to forward logs to a LokiStack
instance by using the openshift-logging
tenants mode.
Prerequisites
- The Red Hat build of OpenTelemetry Operator is installed.
- The Loki Operator is installed.
-
A supported
LokiStack
instance is deployed on the cluster. For more information about the supportedLokiStack
configuration, see Logging.
Procedure
Create a service account for the OpenTelemetry Collector.
Example
ServiceAccount
objectapiVersion: v1 kind: ServiceAccount metadata: name: otel-collector-deployment namespace: openshift-logging
apiVersion: v1 kind: ServiceAccount metadata: name: otel-collector-deployment namespace: openshift-logging
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a cluster role that grants the Collector’s service account the permissions to push logs to the
LokiStack
application tenant.Example
ClusterRole
objectCopy to Clipboard Copied! Toggle word wrap Toggle overflow Bind the cluster role to the service account.
Example
ClusterRoleBinding
objectCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create an
OpenTelemetryCollector
custom resource (CR) object.Example
OpenTelemetryCollector
CR objectCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Provides the following resource attributes to be used by the web console:
kubernetes.namespace_name
,kubernetes.pod_name
,kubernetes.container_name
, andlog_type
. - 2
- Enables the BearerTokenAuth Extension that is required by the OTLP HTTP Exporter.
- 3
- Enables the OTLP HTTP Exporter to export logs from the Collector.
You can deploy telemetrygen
as a test:
8.3. Forwarding telemetry data to third-party systems Copiar enlaceEnlace copiado en el portapapeles!
The OpenTelemetry Collector exports telemetry data by using the OTLP exporter via the OpenTelemetry Protocol (OTLP) that is implemented over the gRPC or HTTP transports. If you need to forward telemetry data to your third-party system and it does not support the OTLP or other supported protocol in the Red Hat build of OpenTelemetry, then you can deploy an unsupported custom OpenTelemetry Collector that can receive telemetry data via the OTLP and export it to your third-party system by using a custom exporter.
Red Hat does not support custom deployments.
Prerequisites
- You have developed your own unsupported custom exporter that can export telemetry data via the OTLP to your third-party system.
Procedure
Deploy a custom Collector either through the OperatorHub or manually:
- If your third-party system supports it, deploy the custom Collector by using the OperatorHub.
Deploy the custom Collector manually by using a config map, deployment, and service.
Example of a custom Collector deployment
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
debug
with the required exporter for your third-party system. - 2
- Replace the image with the required version of the OpenTelemetry Collector that has the required exporter for your third-party system.
- 3
- The service name is used in the Red Hat build of OpenTelemetry Collector CR to configure the OTLP exporter.