lib/fluent/plugin/out_google_cloud.rb
def construct_log_entry_in_grpc_format(labels,
                                           resource,
                                           severity,
                                           ts_secs,
                                           ts_nanos)
      entry = Google::Logging::V2::LogEntry.new(
        labels: labels,
        resource: Google::Api::MonitoredResource.new(
          type: resource.type,
          labels: resource.labels.to_h
        ),
        severity: grpc_severity(severity)
      )
      # If "seconds" is null or not an integer, we will omit the timestamp
      # field and defer the decision on how to handle it to the downstream
      # Logging API. If "nanos" is null or not an integer, it will be set
      # to 0.
      if ts_secs.is_a?(Integer)
        ts_nanos = 0 unless ts_nanos.is_a?(Integer)
        entry.timestamp = Google::Protobuf::Timestamp.new(
          seconds: ts_secs,
          nanos: ts_nanos
        )
      end
      entry
    end
# Constants for service names, resource types and etc.
Constants for service names, resource types and etc.
Constants for service names resource types and etc .
def construct_log_entry_in_grpc_format(labels,
                                           resource,
                                           severity,
                                           ts_secs,
                                           ts_nanos)
      entry = Google::Logging::V2::LogEntry.new(
        labels: labels,
        resource: Google::Api::MonitoredResource.new(
          type: resource.type,
          labels: resource.labels.to_h
        ),
        severity: grpc_severity(severity)
      )
      if ts_secs.is_a?(Integer)
        ts_nanos = 0 unless ts_nanos.is_a?(Integer)
        entry.timestamp = Google::Protobuf::Timestamp.new(
          seconds: ts_secs,
          nanos: ts_nanos
        )
      end
      entry
    end
def construct_log_entry_in_grpc_format ( labels , resource , severity , ts_secs , ts_nanos ) entry = Google :: Logging :: V2 :: LogEntry . new ( labels : labels , resource : Google :: Api :: MonitoredResource . new ( type : resource . type , labels : resource . labels . to_h ) , severity : grpc_severity ( severity ) ) if ts_secs . is_a? ( Integer ) ts_nanos = 0 unless ts_nanos . is_a? ( Integer ) entry . timestamp = Google :: Protobuf :: Timestamp . new ( seconds : ts_secs , nanos : ts_nanos ) end entry end
Constants for service names, resource types and etc.
Constants for service names resource types and etc .
# If "seconds" is null or not an integer, we will omit the timestamp # field and defer the decision on how to handle it to the downstream # Logging API. If "nanos" is null or not an integer, it will be set # to 0.
labels
resource
severity
ts_secs
ts_nanos