Configuration changes for Opentelemetry with ISD

To configure Opentelementry in ISD you need to setup the Opentelementry collector service and integrate Prometheus with the Opentelemetry Collector.

Setting Up OpenTelemetry Collector Service

Follow the steps below to setup Opentelementry collector service.

  1. Create the OpenTelemetry Collector Config (otel-config.yaml)

  2. Deploy the OpenTelemetry Collector

  3. Expose the Collector as a service

  4. Deploy the OpenTelemetry service

  5. Add Secrets

Create the OpenTelemetry Collector Config (otel-config.yaml)

Add the following code to create the Opentelementry collector config.

apiVersion: v1
kind: ConfigMap
metadata:
 name: otel-collector-config
data:
 otel-config.yaml: |
   receivers:
     otlp:
       protocols:
         http:
           endpoint: "0.0.0.0:4318"  
  
   processors:
     batch:
       send_batch_max_size: 100
       send_batch_size: 10
       timeout: 10s

   exporters:
     debug:
       verbosity: detailed
     prometheus:
       endpoint: "0.0.0.0:9464"
       send_timestamps: true
       metric_expiration: 10m
       resource_to_telemetry_conversion:
         enabled: true

   service:
     pipelines:
       metrics:
         receivers: [ otlp ]
         processors: [ batch ]
         exporters: [ prometheus, debug ]  
       traces: 
         receivers: [ otlp ]
         processors: [ batch ]
         exporters: [ debug ] 
       logs:
         receivers: [ otlp ]
         processors: [ batch ]
         exporters: [debug ]

Apply otel-config.yaml into the namesspace using the below command

Deploy the OpenTelemetry Collector

Add the following code to deploy the Opentelementry collector.

Apply the otel-deployment.yaml into the namesspace using the below command

Add the below section in the otel-deployment.yaml file (volumes and volumeMounts section)

Apply otel-deployment.yaml into the namesspace using the below command

Expose the Collector as a Service

To expose the collector as a service, create otel-service.yaml file and add the below configurations

Deploy the OpenTelemetry service

Add the following command to deploy the Opentelemetry service.

Add Secrets

The oes-audit-service-config should include the below config above and parallel to open-telemetry.

To Debug

Export the environment variables for otel-collector if you find any issues with connection after deployment:

Integrating Prometheus with OpenTelemetry Collector

To integrate Prometheus with the OpenTelemetry collector, follow the steps given below:

Update ConfigMap(otel-config.yaml) for OpenTelemetry Collector:

Update the configmap using the following code. Ensure that the following configuration is under the exporters section in otel-config:

Modify Metrics Pipeline:

Modify the metrics pipeline. Ensure that prometheus is added to the list of exporters under the metrics pipeline in the otel-config:

Configure Prometheus Scraping

Update the Prometheus ConfigMap (opsmx-prometheus-server) under the scrape_configs section to replace oes-audit-service:19090 with the OpenTelemetry Collector port to scrape metrics from otel as shown below:

  • Restart the Prometheus service to apply the configuration changes.

  • View the metrics in Prometheus.

  • Remove the 19090 port in the audit service deployment

Last updated