Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-67145

Ability to configure processor.transform to set different TZ on logs from otel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • 4.19.z
    • Logging
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Low
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      
      IHAC where customer wants to configure the `processor.transform` on the log from open telemetry to modify the TZ on the log entries.
      
      So far I've got into this config, however it doesn't work.
      
      """
        transform:
          log_statements:
            - context: log
              statements:
                - set(log.attributes["local.timezone.offset"], FormatTime(Time(), "America/Los_Angeles"))
      """
      
      It fails with error:
      
      """
      Dec 09 19:32:32 host opentelemetry-collector[71111]: Error: invalid configuration: processors::transform: unable to parse OTTL statement "set(log.attributes[\"local.timezone.offset\"], FormatTime(Time(), \"America/Los_Angeles\"))": error while parsing arguments for call to "set": invalid argument at position 1: error while parsing arguments for call to "FormatTime": invalid argument at position 0: error while parsing arguments for call to "Time": incorrect number of arguments. Expected: 4 Received: 0
      Dec 09 19:32:32 host opentelemetry-collector[71111]: 2025/12/09 19:32:32 collector server run finished with error: invalid configuration: processors::transform: unable to parse OTTL statement "set(log.attributes[\"local.timezone.offset\"], FormatTime(Time(), \"America/Los_Angeles\"))": error while parsing arguments for call to "set": invalid argument at position 1: error while parsing arguments for call to "FormatTime": invalid argument at position 0: error while parsing arguments for call to "Time": incorrect number of arguments. Expected: 4 Received: 0
      """
      
      Seeking for help in this.
      
          

      Version-Release number of selected component (if applicable):

      
          

      How reproducible:

      
          

      Steps to Reproduce:

          1.
          2.
          3.
          

      Actual results:

      
          

      Expected results:

      
          

      Additional info:

      
          

              jcantril@redhat.com Jeffrey Cantrill
              rhn-support-vwalek Vladislav Walek
              None
              None
              Junqi Zhao Junqi Zhao
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: