Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Parse errors in case if docker discovery doesn't finds any suitable containers #377

Open
tkant opened this issue Aug 29, 2022 · 0 comments
Labels
triage/pending Issue or PR is pending for triage and prioritization.

Comments

@tkant
Copy link

tkant commented Aug 29, 2022

Un-necessary data is getting published to New Relic

Description

Getting Parse errors in case if docker discovery doesn't finds any suitable containers

As per this doc: https://docs.newrelic.com/docs/infrastructure/host-integrations/installation/container-auto-discovery-host-integrations/ An integration will be executed as many times as it finds discovery elements. If discovery doesn't find any containers, the integration won't be executed.
But we are seeing error like following on EC2s which doesn't matches even a single container with the image regex we are using:

time="2022-08-24T12:59:51Z" level=debug msg="Integration stderr (not parsed)." component=integrations.runner.Runner integration_name=nri-flex line="time=\"2022-08-24T12:59:51Z\" level=debug msg=\"http: error\" err=\"parse \\\"http://${discovery.ip}:${discovery.port}/api/7/http/requests\\\": invalid port \\\":${discovery.port}\\\" after host\"" runner_uid=d933e8cf21

Following is the snippet of configuration we are using:

---
discovery:
  docker:
    match:
      image: /cbr/
      label.metrics_scrapable: yes
integrations:
  # Following deals with /api Nginx+ endpoints
  - name: nri-flex
    config:
      name: nginxFlex
      global:
        base_url: http://${discovery.ip}:${discovery.port}/api/7

Wondering how can we say no to parse anything if there's zero matches found by discovery?

Expected Behavior

If discovery doesn't find any containers, the integration won't be executed and should ignore the ${discovery.*} placeholders

Failure Logs which are transmitted as events to New Relic

time="2022-08-24T12:59:51Z" level=debug msg="Integration stderr (not parsed)." component=integrations.runner.Runner integration_name=nri-flex line="time=\"2022-08-24T12:59:51Z\" level=debug msg=\"http: error\" err=\"parse \\\"http://${discovery.ip}:${discovery.port}/api/7/http/requests\\\": invalid port \\\":${discovery.port}\\\" after host\"" runner_uid=d933e8cf21

Steps to Reproduce

Use docker discovery in conjunction with placeholder usage, ex: ${discovery.ip}

Example:

---
discovery:
  docker:
    match:
      image: /cbr/
      label.metrics_scrapable: yes
integrations:
  # Following deals with /api Nginx+ endpoints
  - name: nri-flex
    config:
      name: nginxFlex
      global:
        base_url: http://${discovery.ip}:${discovery.port}/api/7

Your Environment

We are using nr-flex for collecting NGINX metrics, where flex is running on EC2 machines having docker containers running on top.

@davidgit davidgit added the triage/pending Issue or PR is pending for triage and prioritization. label Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/pending Issue or PR is pending for triage and prioritization.
Projects
None yet
Development

No branches or pull requests

2 participants