sentrysoftware / metricshub

Universal Metrics Collection for OpenTelemetry
https://metricshub.com
GNU Affero General Public License v3.0
15 stars 4 forks source link

Ability to specify default connector variables in the YAML connector file #374

Closed MedMaalej closed 1 month ago

MedMaalej commented 2 months ago

We need to add a connector variables section in the connector yaml file. The section should contain the description and the default value of each connector variable.

The new variables section should be under the Connector section in the connector yaml file (At the same level of detection and displayName).

The new variables section should look as below:


variables:
  nameMatches:
    description: Regular expression that process names must match to be monitored
    defaultValue: .*
  commandMatches:
    description: Regular expression that the command line of the process must match to be monitored
    defaultValue: .*
etc.

Here is an example of the desired structure of the connector section (in the connector yaml file)

connector:
  displayName: Windows Storage Spaces (WMI)
  platforms: Any system
  reliesOn: Windows Storage Spaces
  information: This connector enables the monitoring of physical disks through the Windows Storage Management's WMI provider. It supports all disk types, including disks on NVMe bus and NVDIMM. When available, temperature sensors are also discovered and monitored.
  detection:
    connectionTypes:
    - remote
    - local
    appliesTo:
    - NT
    supersedes:
    - WBEMGenDiskNT
    - DiskPart
    criteria:
    # Must be Windows
    - type: deviceType
      keep:
      - NT
    # Must be Hardware Sentry KM 11.3 at least
    - type: productRequirements
      kmVersion: 11.3.00
      # Having something in MSFT_Volume is enough to consider that the WMI provider
      # for Windows Storage Spaces is working
    - type: wmi
      namespace: root\Microsoft\Windows\Storage
      query: SELECT ObjectId FROM MSFT_Volume
    tags: [ hardware ]
  variables:
    nameMatches:
      description: Regular expression that process names must match to be monitored
      defaultValue: .*
    commandMatches:
      description: Regular expression that the command line of the process must match to be monitored
      defaultValue: .*

We need to make the necessary updates in MetricsHub to have this new variables section.