Chapter 2. Installing the Red Hat build of OpenTelemetry Installing the Red Hat build of OpenTelemetry involves the following steps: Installing the Red Hat build of OpenTelemetry Operator. Creating a namespace for an OpenTelemetry Collector instance. Creating an OpenTelemetryCollector custom resource to deploy the OpenTelemetry Collector instance. 2.1. Installing the Red Hat build of OpenTelemetry from the web console You can install the Red Hat build of OpenTelemetry from the Administrator view of the web console. Prerequisites You are logged in to the web console as a cluster administrator with the cluster-admin role. For Red Hat OpenShift Dedicated, you must be logged in using an account with the dedicated-admin role. Procedure Install the Red Hat build of OpenTelemetry Operator: Go to Operators OperatorHub and search for Red Hat build of OpenTelemetry Operator . Select the Red Hat build of OpenTelemetry Operator that is provided by Red Hat Install Install View Operator . Important This installs the Operator with the default presets: Update channel stable Installation mode All namespaces on the cluster Installed Namespace openshift-operators Update approval Automatic In the Details tab of the installed Operator page, under ClusterServiceVersion details , verify that the installation Status is Succeeded . Create a project of your choice for the OpenTelemetry Collector instance that you will create in the step by going to Home Projects Create Project . Create an OpenTelemetry Collector instance. Go to Operators Installed Operators . Select OpenTelemetry Collector Create OpenTelemetry Collector YAML view . In the YAML view , customize the OpenTelemetryCollector custom resource (CR) with the OTLP, Jaeger, Zipkin receivers and the debug exporter. apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector metadata: name: otel namespace: <project_of_opentelemetry_collector_instance> spec: mode: deployment config: | receivers: otlp: protocols: grpc: http: jaeger: protocols: grpc: thrift_binary: thrift_compact: thrift_http: zipkin: processors: batch: memory_limiter: check_interval: 1s limit_percentage: 50 spike_limit_percentage: 30 exporters: debug: service: pipelines: traces: receivers: [otlp,jaeger,zipkin] processors: [memory_limiter,batch] exporters: [debug] Select Create . Verification Use the Project: dropdown list to select the project of the OpenTelemetry Collector instance. Go to Operators Installed Operators to verify that the Status of the OpenTelemetry Collector instance is Condition: Ready . Go to Workloads Pods to verify that all the component pods of the OpenTelemetry Collector instance are running. 2.2. Installing the Red Hat build of OpenTelemetry by using the CLI You can install the Red Hat build of OpenTelemetry from the command line. Prerequisites An active OpenShift CLI ( oc ) session by a cluster administrator with the cluster-admin role. Tip Ensure that your OpenShift CLI ( oc ) version is up to date and matches your OpenShift Container Platform version. Run oc login : USD oc login --username=<your_username> Procedure Install the Red Hat build of OpenTelemetry Operator: Create a project for the Red Hat build of OpenTelemetry Operator by running the following command: USD oc apply -f - << EOF apiVersion: project.openshift.io/v1 kind: Project metadata: labels: kubernetes.io/metadata.name: openshift-opentelemetry-operator openshift.io/cluster-monitoring: "true" name: openshift-opentelemetry-operator EOF Create an Operator group by running the following command: USD oc apply -f - << EOF apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: openshift-opentelemetry-operator namespace: openshift-opentelemetry-operator spec: upgradeStrategy: Default EOF Create a subscription by running the following command: USD oc apply -f - << EOF apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: opentelemetry-product namespace: openshift-opentelemetry-operator spec: channel: stable installPlanApproval: Automatic name: opentelemetry-product source: redhat-operators sourceNamespace: openshift-marketplace EOF Check the Operator status by running the following command: USD oc get csv -n openshift-opentelemetry-operator Create a project of your choice for the OpenTelemetry Collector instance that you will create in a subsequent step: To create a project without metadata, run the following command: USD oc new-project <project_of_opentelemetry_collector_instance> To create a project with metadata, run the following command: USD oc apply -f - << EOF apiVersion: project.openshift.io/v1 kind: Project metadata: name: <project_of_opentelemetry_collector_instance> EOF Create an OpenTelemetry Collector instance in the project that you created for it. Note You can create multiple OpenTelemetry Collector instances in separate projects on the same cluster. Customize the OpenTelemetry Collector custom resource (CR) with the OTLP, Jaeger, and Zipkin receivers and the debug exporter: apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector metadata: name: otel namespace: <project_of_opentelemetry_collector_instance> spec: mode: deployment config: | receivers: otlp: protocols: grpc: http: jaeger: protocols: grpc: thrift_binary: thrift_compact: thrift_http: zipkin: processors: batch: memory_limiter: check_interval: 1s limit_percentage: 50 spike_limit_percentage: 30 exporters: debug: service: pipelines: traces: receivers: [otlp,jaeger,zipkin] processors: [memory_limiter,batch] exporters: [debug] Apply the customized CR by running the following command: USD oc apply -f - << EOF <OpenTelemetryCollector_custom_resource> EOF Verification Verify that the status.phase of the OpenTelemetry Collector pod is Running and the conditions are type: Ready by running the following command: USD oc get pod -l app.kubernetes.io/managed-by=opentelemetry-operator,app.kubernetes.io/instance=<namespace>.<instance_name> -o yaml Get the OpenTelemetry Collector service by running the following command: USD oc get service -l app.kubernetes.io/managed-by=opentelemetry-operator,app.kubernetes.io/instance=<namespace>.<instance_name> 2.3. Additional resources Creating a cluster admin OperatorHub.io Accessing the web console Installing from OperatorHub using the web console Creating applications from installed Operators Getting started with the OpenShift CLI

Commands:
apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector metadata: name: otel namespace: <project_of_opentelemetry_collector_instance> spec: mode: deployment config: | receivers: otlp: protocols: grpc: http: jaeger: protocols: grpc: thrift_binary: thrift_compact: thrift_http: zipkin: processors: batch: memory_limiter: check_interval: 1s limit_percentage: 50 spike_limit_percentage: 30 exporters: debug: service: pipelines: traces: receivers: [otlp,jaeger,zipkin] processors: [memory_limiter,batch] exporters: [debug]
oc login --username=<your_username>
oc apply -f - << EOF apiVersion: project.openshift.io/v1 kind: Project metadata: labels: kubernetes.io/metadata.name: openshift-opentelemetry-operator openshift.io/cluster-monitoring: "true" name: openshift-opentelemetry-operator EOF
oc apply -f - << EOF apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: openshift-opentelemetry-operator namespace: openshift-opentelemetry-operator spec: upgradeStrategy: Default EOF
oc apply -f - << EOF apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: opentelemetry-product namespace: openshift-opentelemetry-operator spec: channel: stable installPlanApproval: Automatic name: opentelemetry-product source: redhat-operators sourceNamespace: openshift-marketplace EOF
oc get csv -n openshift-opentelemetry-operator
oc new-project <project_of_opentelemetry_collector_instance>
oc apply -f - << EOF apiVersion: project.openshift.io/v1 kind: Project metadata: name: <project_of_opentelemetry_collector_instance> EOF
apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector metadata: name: otel namespace: <project_of_opentelemetry_collector_instance> spec: mode: deployment config: | receivers: otlp: protocols: grpc: http: jaeger: protocols: grpc: thrift_binary: thrift_compact: thrift_http: zipkin: processors: batch: memory_limiter: check_interval: 1s limit_percentage: 50 spike_limit_percentage: 30 exporters: debug: service: pipelines: traces: receivers: [otlp,jaeger,zipkin] processors: [memory_limiter,batch] exporters: [debug]
oc apply -f - << EOF <OpenTelemetryCollector_custom_resource> EOF
oc get pod -l app.kubernetes.io/managed-by=opentelemetry-operator,app.kubernetes.io/instance=<namespace>.<instance_name> -o yaml
oc get service -l app.kubernetes.io/managed-by=opentelemetry-operator,app.kubernetes.io/instance=<namespace>.<instance_name>