Support

Open Telemetry Functions

Drop OTLP Logs

The Drop OTLP Logs function drops logs sent via the OpenTelemetry Protocol (OTLP).


Usage

  • Operates On: OTLP Logs
  • Label: Optional
  • Filter: Optional

Required Configuration

  • Match Conditions: A set of matching conditions to apply to each log record, the set may either match any or all of the conditions. If the result is true the log record will be dropped.

OTLP Log Payload Unrolling

If you sample OTLP log payloads you will notice they are batched and highly nested. Starting with an array of resourceLogs, each resource contains an array of scopeLogs, and each scope contains an array of logRecords.

For your convenience Streamfold automatically unrolls and flattens this nested structure, allowing you to easily construct matching conditions as if each log were processed as a single event.

The fields for the parent scope and resource are also available to you for constructing match conditions. For example...

Example: Raw OTLP Payload

{
 "resourceLogs": [
  {
   "resource": {
    "attributes": [
     {
      "key": "telemetry.sdk.language",
      "value": {
       "stringValue": "python"
      }
     },
     {
      "value": {
       "stringValue": "opentelemetry-demo"
      },
      "key": "service.namespace"
     }
    ]
   },
   "scopeLogs": [
    {
     "scope": {
      "attributes": [
       {
        "key": "subcomponent",
        "value": {
         "stringValue": "recommend"
        }
       }
      ],
      "name": "opentelemetry.sdk._logs._internal"
     },
     "logRecords": [
      {
       "attributes": [
        {
         "key": "otelSpanID",
         "value": {
          "stringValue": "0625c4eed831c32a"
         }
        },
        {
         "key": "otelTraceID",
         "value": {
          "stringValue": "7355ebd57bd2d52cc9aae382fb98ba93"
         }
        }
       ],
       "flags": 1,
       "body": {
        "stringValue": "Receive ListRecommendations for product..."
       },
       "traceId": "c1Xr1XvS1SzJquOC+5i6kw==",
       "severityText": "INFO",
       "timeUnixNano": "1697846411347454976",
       "severityNumber": "SEVERITY_NUMBER_INFO",
       "spanId": "BiXE7tgxwyo="
      }
     ]
    }
   ]
  }
 ]
}

Example: Flattened OTLP Log Record

{
  "flags": 1,
  "spanId": "BiXE7tgxwyo=",
  "severityText": "INFO",
  "resource": {
    "schemaUrl": null,
    "attributes": {
      "telemetry.sdk.language": "python",
      "service.namespace": "opentelemetry-demo"
    }
  },
  "instrumentation_scope": {
    "name": "opentelemetry.sdk._logs._internal",
    "attributes": {
      "subcomponent": "recommend"
    }
  },
  "traceId": "c1Xr1XvS1SzJquOC+5i6kw==",
  "timeUnixNano": "1697846411347454976",
  "severityNumber": "SEVERITY_NUMBER_INFO",
  "body": "Receive ListRecommendations for product...",
  "attributes": {
    "otelSpanID": "0625c4eed831c32a",
    "otelTraceID": "7355ebd57bd2d52cc9aae382fb98ba93",
    "otelTraceSampled": true,
    "otelServiceName": "recommendationservice"
  }
}

Log Record Fields

PathField AccessedType
resourceresource of the log being processedmap
resource.schemaUrlresource schemaUrl of the log being processedstring
resource.attributesresource attributes of the log being processedmap
resource.attributes[""]the value of the resource attribute for the log being processedany
instrumentation_scopeinstrumentation scope of the log being processedmap
instrumentation_scope.namename of the instrumentation scope of the log being processedstring
instrumentation_scope.versionversion of the instrumentation scope of the log being processedstring
instrumentation_scope.attributesattributes of the instrumentation scope of the log being processedmap
instrumentation_scope.attributes[""]the value of the instrumentation scope attribute of the log being processedany
timeUnixNanothe unix time in nanoseconds of the log being processedstring
observedTimeUnixNanothe observered unix time in nanoseconds of the log being processedstring
spanIdstring representation of the span id of the log being processedstring
traceIdstring representation of the trace id of the log being processedstring
severityNumberstring representation of the severity number of the log being processedstring
severityTextthe severity of the log being processedstring
bodythe body of the log being processedstring
flagsthe flags of the log being processedinteger
attributesthe attributes of the log being processedmap
attributes[""]the value of the attribute for the log being processedany

Example

Drop any log where the resource.attributes map contains the key service.namespace and its value is "opentelemetry-demo"

{resource.attributes["service.namespace"]} == "opentelemetry-demo".

Previous
Unroll Metrics