Skip to content

Introduction

Introduction in OTel Collector Upgrade Guide.

6 min read Updated SS RS

Note: This guide upgrades the OpenTelemetry Collector on its own; to upgrade HEAL v2.3.4 to v2.4.1, follow Upgrading to HEAL v2.4.1.

Introduction#

This document outlines the required configuration updates and validation steps for upgrading the OTEL Collector.

Otel Collector Version Details#

The following are the otel collector version details:

Sr. No.Otel Collector VersionDescription
1v1.0.0
  • Initially distributed as a standalone binary and later as a Docker image.
  • The Docker image was incorrectly tagged as latest instead of 1.0.0.
  • Implemented custom rolling file-based logging.
  • Overwrote the built-in Elasticsearch exporter to implement the OpenSearch span exporter in Jaeger JSON format.
  • Customized tail sampling processor to invert the final decision for allowing sampling of successful traces.
  • Bug fix to retain scope attributes (instrumentation library name & version) that were dropped in the upstream implementation.
2v1.1.0
  • Increased default document insertion time in exporter worker channel from 5 seconds to 90 seconds (configurable).
  • Enhanced tail sampling processor to mark root span as errorTrace if any child span contains an error or HTTP status code in the range (400-599).
  • Supports always sample policy to enable error marking without removing non-server spans.
3v1.1.1
  • Released internally to address VAPT vulnerabilities reported at Example Example 2.
  • Some vulnerabilities remained unresolved due to base version limitations.
  • Not released externally.
4v1.2.0
  • Resolved VAPT vulnerabilities reported at Example Example 2.
  • Removed memory_ballast extension.
  • Recommended use of the GOMEMLIMIT environment variable (set to 80% of container memory).
  • Renamed the Elasticsearch exporter to the heal_opensearch exporter.
  • Renamed the tail_sampling processor to the heal_tail_sampling processor.
5v1.3.0
  • Introduced file storage extension for disk-based buffering.
  • Added span metrics connector.
6v1.3.1
  • This version supports user changes for otel-collector instead of user ID 1000 .

Otel-collector_Upgrade v1.0.0 to v1.3.0#

Configuration Changes#

Perform the following configuration changes to update otel-collector_V1.0.0 to V1.3.0:

1. Performance Optimization:

  • The OTEL Collector has been optimized to enhance overall efficiency and runtime performance.
  • For the same data ingestion rate, version v1.3.0 is expected to demonstrate improved memory utilization compared to v1.0.0.

2. Backward Compatibility:

  • The latest build maintains full backward compatibility.
  • All features supported in v1.0.0 will continue to function in v1.3.0.

3. Configuration Changes: The following configuration updates are required:

a. Exporter Renaming: The exporter previously named opensearch_exporter has been renamed to healopensearch_exporter.

b. Extension Removal: The memory_limiter extension has been removed from the configuration.

4. Buffering Mechanism Enhancement: A file-based buffering mechanism has been introduced to improve system resilience.

a. Purpose: The buffering mechanism is designed to handle:

  • Sudden spikes in incoming spans
  • Temporary OpenSearch slowdowns
  • Network latency conditions

b. Behavior:

  • When the sending queue reaches capacity, spans are temporarily stored on disk.
  • This reduces memory pressure on the OTEL Collector.
  • Improves system stability during traffic bursts or downstream delays.

Configure File Storage#

The following are the changes to be performed in the tail.sampling-file-storage.yml file:

1. Navigate as below to access the YAML file.

cat /appnomic/HEAL/Appsone_Service/otel/run-config/config-tailsampling-error-slow.yaml

2. Ensure the following changes are performed in the config-tailsampling-error-slow.yaml file.

a. The parameters in RED are to be removed.

b. The parameters in GREEN are to be added.

c. The parameters in FUCHSIA are to be modified/updated (update the names/parameters as per the comment).

extensions:
  zpages:
    endpoint: ":55671"
  memory_ballast:
    size_in_percentage: 35
  health_check:
    endpoint: ":13131"
  file_storage:
    directory: /var/lib/otelcol/storage
    timeout: 1s
    compaction:
      directory: /tmp
      on_start: true
      on_rebound: true
      rebound_needed_threshold_mib: 100
      rebound_trigger_threshold_mib: 10
      check_interval: 5s
receivers:
  otlp:
     protocols:
        grpc:
          endpoint: 0.0.0.0:13769
          max_recv_msg_size_mib: 32
  jaeger:
    protocols:
        grpc:
          endpoint: 0.0.0.0:13754
          max_recv_msg_size_mib: 32       
processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 87     #Update the value to 84.
    spike_limit_percentage: 12  #Update the value to 13.
  resource/remove_process_attributes:
    attributes:
      - key: host.arch
        action: delete
      - key: host.name
        action: delete
      - key: os.description
        action: delete
      - key: os.type
        action: delete
      - key: process.executable.path
        action: delete
      - key: process.pid
        action: delete
      - key: process.runtime.description
        action: delete
      - key: process.runtime.name
        action: delete
      - key: process.runtime.version
        action: delete
      - key: telemetry.auto.version
        action: delete
      - key: telemetry.sdk.language
        action: delete
      - key: telemetry.sdk.name
        action: delete
      - key: telemetry.sdk.version
        action: delete
      - key: otel.scope.name
        action: delete
      - key: otel.scope.version
        action: delete
 tail_sampling/error_or_slow:     
    decision_wait: 7s     
    num_traces: 100000     
    expected_new_traces_per_sec: 0     
policies:       
  [         
     {           
        name: status_error_policy,           
        type: status_code,           
        status_code: {status_codes: [ERROR]}         
     },         
     {           
        name: latency_policy,           
        type: latency,           
        latency: {threshold_ms: 5000}         
      }       
   ]
  heal_tail_sampling/error_or_slow:
    decision_wait: 10s
    num_traces: 100000
    expected_new_traces_per_sec: 0
    policies:
      [
        {
          name: http_status_policy,
          type: numeric_attribute,
          numeric_attribute: {key: http.status_code, min_value: 400, max_value: 599}
        }
      ]
tail_sampling/success:     
   decision_wait: 7s     
   num_traces: 100000     
   expected_new_traces_per_sec: 0     
   invert_final_decision: true     
   policies:       
     [         
       {           
          name: status_error_policy_inv,           
          type: status_code,           
          status_code: {status_codes: [ERROR]}         
       },         
       {           
          name: latency_policy_inv,           
          type: latency,           
          latency: {threshold_ms: 5000}         
       }       
     ]
  heal_tail_sampling/success:
    decision_wait: 10s
    num_traces: 100000
    expected_new_traces_per_sec: 0
    invert_final_decision: true
    policies:
      [
        {
          name: http_status_policy,
          type: numeric_attribute,
          numeric_attribute: {key: http.status_code, min_value: 400, max_value: 599}
        }
      ]
 filter/include_only_server_spans:     
     spans:       
       include:         
          match_type: strict         
span_kinds: [SPAN_KIND_SERVER, SPAN_KIND_CONSUMER]
  filter/http_server_client:
    error_mode: ignore
    traces:
      span:
        - |
          attributes["http.method"] == nil
 batch:
    send_batch_size: 8192
    timeout: 5s
exporters:
  logging:   #Update the name to debug.
    verbosity: normal   #Update the value to basic.
  elasticsearch/trace:  #Update the name to heal_opensearch.
    endpoints:
[https://xx.27.134.6:9250,https://xx.27.134.7:9250,https://xx.27.134.5:9250]  #Update the 
value to [https://localhost:9200].
    user: admin
    password: <base64-password>
    tls:
      #ca_file: /opt/heal-opentelemetry-collector/root-ca.pem
      insecure_skip_verify: true
    retry:
      enabled: true
    sending_queue:
      enabled: true
      num_consumers: 200   #Update the value to 64.
      queue_size: 800    #Update the name to 20000.
      storage: file_storage
    num_workers: 64    #Update the value to 32.
    traces_index_date_layout: hour
    #traces_index_prefix: sample
    flush:
      bytes: 10042880
      interval: 10s
    context_deadline_timeout: 150s
connectors:
  forward:
service:
  extensions: [zpages, memory_ballast, health_check, file_storage]
  telemetry:
    logs:
      level: info
    metrics:
      level: basic    #Update the value to normal.
      address: ":8888"
  pipelines:
    traces/error_or_slow:
      receivers: [otlp,jaeger]
      processors: [memory_limiter, filter/drop-noisy-service,
resource/remove_process_attributes, heal_tail_sampling/error_or_slow]
      exporters: [forward]
    traces/success:
      receivers: [otlp,jaeger]
      processors: [memory_limiter, filter/drop-noisy-service,
resource/remove_process_attributes, heal_tail_sampling/success,
filter/include_only_server_spans]    #Update the name to http_server_client.
      exporters: [forward]
    traces/merge:
      receivers: [forward]
      processors: [batch]
      exporters: [logging, elasticsearch/trace]   #Update the name to logging > debug,
elasticsearch > heal_opensearch.

3. Post the changes, the latest YAML file is as follows:

extensions:
  zpages:
    endpoint: ":55671"
  health_check:
    endpoint: ":13131"
  file_storage:
    directory: /var/lib/otelcol/storage
    timeout: 1s
    compaction:
      directory: /tmp
      on_start: true
      on_rebound: true
      rebound_needed_threshold_mib: 100
      rebound_trigger_threshold_mib: 10
      check_interval: 5s
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:13769
        max_recv_msg_size_mib: 32
  jaeger:
    protocols:
      grpc:
      endpoint: 0.0.0.0:13754
      max_recv_msg_size_mib: 32
processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 84
    spike_limit_percentage: 13
  resource/remove_process_attributes:
    attributes:
      - key: host.arch
        action: delete
      - key: host.name
        action: delete
      - key: os.description
        action: delete
      - key: os.type
        action: delete
      - key: process.executable.path
        action: delete
      - key: process.pid
        action: delete
      - key: process.runtime.description
        action: delete
      - key: process.runtime.name
        action: delete
      - key: process.runtime.version
        action: delete
      - key: telemetry.auto.version
        action: delete
      - key: telemetry.sdk.language
        action: delete
      - key: telemetry.sdk.name
        action: delete
      - key: telemetry.sdk.version
        action: delete
      - key: otel.scope.name
        action: delete
      - key: otel.scope.version
        action: delete
heal_tail_sampling/error_or_slow:
  decision_wait: 10s
  num_traces: 100000
  expected_new_traces_per_sec: 0
  policies:
    [
      {
        name: http_status_policy,
        type: numeric_attribute,
        numeric_attribute: {key: http.status_code, min_value: 400, max_value: 599}
      }
    ]
heal_tail_sampling/success:
  decision_wait: 10s
  num_traces: 100000
  expected_new_traces_per_sec: 0
  invert_final_decision: true
  policies:
    [
      {
        name: http_status_policy,
        type: numeric_attribute,
        numeric_attribute: {key: http.status_code, min_value: 400, max_value: 599}
      }
     ]
filter/http_server_client:
  error_mode: ignore
  traces:
    span:
      - |
        attributes["http.method"] == nil
batch:
  send_batch_size: 8192
  timeout: 5s
exporters:
  debug:
    verbosity: basic
  heal_opensearch/trace:
    endpoints:
[https://192.0.2.21:9250,https://192.0.2.22:9250,https://192.0.2.23:9250]
    user: admin
    password: <base64-password>
tls:
  #ca_file: /opt/heal-opentelemetry-collector/root-ca.pem
  insecure_skip_verify: true
 retry:
   enabled: true
 sending_queue:
   enabled: true
   num_consumers: 64
   queue_size: 20000
   storage: file_storage
 num_workers: 32
 traces_index_date_layout: hour
 flush:
   bytes: 10042880
   interval: 10s
 context_deadline_timeout: 150s
connectors:
  forward:
service:
  extensions: [ zpages, health_check, file_storage ]
  telemetry:
    logs:
      level: info
    metrics:
      level: normal
      address: ":8888"
pipelines:
  traces/error_or_slow:
    receivers: [ otlp, jaeger ]
    processors: [ memory_limiter, resource/remove_process_attributes,
heal_tail_sampling/error_or_slow ]
    exporters: [ forward ]
traces/success:
    receivers: [ otlp, jaeger ]
    processors: [ memory_limiter, resource/remove_process_attributes,
heal_tail_sampling/success, filter/http_server_client ]
    exporters: [ forward ]
traces/merge:
    receivers: [ forward ]
    processors: [ batch ]
    exporters: [ debug, heal_opensearch/trace ]

Post-Deployment Validation#

After deploying the new build, validate the following:

1. File Storage Verification: Confirm that file-based storage is created at the configured host volume mount path.

2. Buffering Behavior Under Load: During high traffic conditions:

  • File storage size will increase temporarily.

a. When traffic stabilizes:

  • Ensure the file size gradually decreases as buffered spans are processed.

3. Data Format Consistency:

  • Verify that there is no change in the data format.
  • Ensure the system functionally behaves the same as the previous OTEL Collector versions.

4. Performance Validation: For the same ingestion rate as v1.0.0/v1.1.0:

  • Memory utilization should be lower or more stable.
  • Overall performance should be improved.