newrelic / nri-winservices

Windows services Integration for New Relic Infrastructure
Apache License 2.0
8 stars 8 forks source link

Manual execution failing to pass config file #126

Closed thezackm closed 2 years ago

thezackm commented 2 years ago

Description

Manual execution of nri-winservices.exe fails on known-good configuration files, while normal operations from the NR infra agent work as expected.

Expected Behavior

Manual execution allows for quick testing on the YAML configuration file with output to STDOUT for realtime analysis.

Steps to Reproduce

assuming winservices-config.yml is a good config that works as expected to send data to New Relic under normal operations

.\newrelic-integrations\nri-winservices.exe -pretty -verbose -config_path .\integrations.d\winservices-config.yml

Current output:

[DEBUG] integration version: v0.5.0-beta commit: 56672a58e2324a17f41662b0dd382c8965913bd3
[FATAL] can't continue: failed to parse config: only filter by windowsService.name is allowed

Your Environment

Windows Server 2019 New Relic Infrastructure Agent: v1.27.3 winservices.exe: v0.5.0-beta

tested config:

integrations:
  - name: nri-winservices
    config:
      exporter_bind_address: 127.0.0.1
      exporter_bind_port: 9182
      include_matching_entities:
        windowsService.name:
          # - regex ".*"
          # - regex "app.*"
          - regex "^app.*"
      scrape_interval: 30s
    timeout: 60s
    labels:
      environment: testing
      purpose: validate_regex_carat

Additional context

This config file works perfectly well while allowing the infrastructure agent to execute it during normal operations. These failures only occur during manual execution at the command line.

markdavies71 commented 2 years ago

I noticed this yesterday, but thought it was me as it was the first time that I have used nri-winservices.

carlossscastro commented 2 years ago

Hi @thezackm / @markdavies71

This is the expected behavior. That config file is meant to be read by the infrastructure agent (not directly by the integration) If you want to test the integration manually you need to create another yml config file with just the config block of your configuration and point the config_path to that file. It would look like:

exporter_bind_address: 127.0.0.1
exporter_bind_port: 9182
include_matching_entities:
  windowsService.name:
    # - regex ".*"
    # - regex "app.*"
    - regex "^app.*"
scrape_interval: 30s

That is the part the agent passes to the integration when invoking it. If you run it on a command prompt or powershell window, note that it has to be open as Administrator.

I'll mark this as closed but let us know if you have any other questions.