platforms:
- type: GCE
  launch_stage: GA
  install_documentation_url: https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/third-party/flink
  agent_requirement:
    logs_minimum_supported_version:
      major: 2
      minor: 17
      patch: 0
    metrics_minimum_supported_version:
      major: 2
      minor: 18
      patch: 1
  detections:
  - characteristic_log:
      log_name_regex: flink
  - characteristic_metric:
      metric_type: workload.googleapis.com/flink.jvm.memory.heap.used
  default_logs:
  - name: flink
    fields:
    - name: jsonPayload.message
      type: string
      description: Log message, including detailed stacktrace where provided
    - name: jsonPayload.source
      type: string
      description: The source Java class of the log entry
    - name: jsonPayload.level
      type: string
      description: Log entry level
    - name: severity
      type: string
      description: ''
  default_metrics:
  - name: workload.googleapis.com/flink.jvm.cpu.load
    value_type: DOUBLE
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.cpu.time
    value_type: INT64
    kind: CUMULATIVE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.heap.used
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.heap.committed
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.heap.max
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.nonheap.used
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.nonheap.committed
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.nonheap.max
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.metaspace.used
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.metaspace.committed
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.metaspace.max
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.direct.used
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.direct.total_capacity
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.mapped.used
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.memory.mapped.total_capacity
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.memory.managed.used
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.memory.managed.total
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.threads.count
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.gc.collections.count
    value_type: INT64
    kind: CUMULATIVE
    labels:
    - garbage_collector_name
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.gc.collections.time
    value_type: INT64
    kind: CUMULATIVE
    labels:
    - garbage_collector_name
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.jvm.class_loader.classes_loaded
    value_type: INT64
    kind: CUMULATIVE
    labels:
    - host_name
    - resource_type
    - taskmanager_id
  - name: workload.googleapis.com/flink.job.restart.count
    value_type: INT64
    kind: CUMULATIVE
    labels:
    - host_name
    - job_name
  - name: workload.googleapis.com/flink.job.last_checkpoint.time
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - job_name
  - name: workload.googleapis.com/flink.job.last_checkpoint.size
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - job_name
  - name: workload.googleapis.com/flink.job.checkpoint.count
    value_type: INT64
    kind: CUMULATIVE
    labels:
    - checkpoint
    - host_name
    - job_name
  - name: workload.googleapis.com/flink.job.checkpoint.in_progress
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - job_name
  - name: workload.googleapis.com/flink.task.record.count
    value_type: INT64
    kind: CUMULATIVE
    labels:
    - host_name
    - job_name
    - record
    - subtask_index
    - task_name
    - taskmanager_id
  - name: workload.googleapis.com/flink.operator.record.count
    value_type: INT64
    kind: CUMULATIVE
    labels:
    - host_name
    - job_name
    - operator_name
    - record
    - subtask_index
    - task_name
    - taskmanager_id
  - name: workload.googleapis.com/flink.operator.watermark.output
    value_type: INT64
    kind: GAUGE
    labels:
    - host_name
    - job_name
    - operator_name
    - subtask_index
    - task_name
    - taskmanager_id
