groups:
  - id: process
    prefix: process
    type: resource
    brief: >
        An operating system process.
    attributes:
      - id: pid
        type: int
        brief: >
          Process identifier (PID).
        examples: [1234]
      - id: parent_pid
        type: int
        brief: >
          Parent Process identifier (PID).
        examples: [111]
      - id: executable.name
        type: string
        requirement_level:
          conditionally_required: See alternative attributes below.
        brief: >
          The name of the process executable. On Linux based systems, can be set
          to the `Name` in `proc/[pid]/status`. On Windows, can be set to the
          base name of `GetProcessImageFileNameW`.
        examples: ['otelcol']
      - id: executable.path
        type: string
        requirement_level:
          conditionally_required: See alternative attributes below.
        brief: >
          The full path to the process executable. On Linux based systems, can
          be set to the target of `proc/[pid]/exe`. On Windows, can be set to the
          result of `GetProcessImageFileNameW`.
        examples: ['/usr/bin/cmd/otelcol']
      - id: command
        type: string
        requirement_level:
          conditionally_required: See alternative attributes below.
        brief: >
          The command used to launch the process (i.e. the command name). On Linux
          based systems, can be set to the zeroth string in `proc/[pid]/cmdline`.
          On Windows, can be set to the first parameter extracted from `GetCommandLineW`.
        examples: ['cmd/otelcol']
      - id: command_line
        type: string
        requirement_level:
          conditionally_required: See alternative attributes below.
        brief: >
          The full command used to launch the process as a single string representing
          the full command. On Windows, can be set to the result of `GetCommandLineW`.
          Do not set this if you have to assemble it just for monitoring; use
          `process.command_args` instead.
        examples: ['C:\cmd\otecol --config="my directory\config.yaml"']
      - id: command_args
        type: string[]
        requirement_level:
          conditionally_required: See alternative attributes below.
        brief: >
          All the command arguments (including the command/executable itself) as
          received by the process. On Linux-based systems (and some other Unixoid
          systems supporting procfs), can be set according to the list of
          null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based
          executables, this would be the full argv vector passed to `main`.
        examples: ['cmd/otecol', '--config=config.yaml']
      - id: owner
        type: string
        brief: >
          The username of the user that owns the process.
        examples: 'root'
    constraints:
      - any_of:
          - process.executable.name
          - process.executable.path
          - process.command
          - process.command_line
          - process.command_args

  - id: process.runtime
    prefix: process.runtime
    type: resource
    brief: >
      The single (language) runtime instance which is monitored.
    attributes:
      - id: name
        type: string
        brief: >
          The name of the runtime of this process. For compiled native binaries,
          this SHOULD be the name of the compiler.
        examples: ['OpenJDK Runtime Environment']
      - id: version
        type: string
        brief: >
          The version of the runtime of this process, as returned by the runtime
          without modification.
        examples: '14.0.2'
      - id: description
        type: string
        brief: >
          An additional description about the runtime of the process, for example
          a specific vendor customization of the runtime environment.
        examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0'
