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

Attempt to fix value not found: discovery.ip when using docker discovery #1753

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

das-peter
Copy link

Getting error : level=error msg="can't start integration" component=integrations.runner.Runner env=dev environment=dev error="value not found: discovery.ip" Assume it's caused by not setting default discovery.ip when no ports are exposed.

Getting error : level=error msg="can't start integration" component=integrations.runner.Runner env=dev environment=dev error="value not found: discovery.ip"
Assume it's caused by not setting default discovery.ip when no ports are exposed.
@das-peter das-peter requested a review from a team November 3, 2023 11:12
@CLAassistant
Copy link

CLAassistant commented Nov 3, 2023

CLA assistant check
All committers have signed the CLA.

@josemore
Copy link
Contributor

josemore commented Nov 8, 2023

Hi @das-peter, can you please include an example of an integration config to reproduce the error?

@das-peter
Copy link
Author

@josemore thanks for the feedback and sorry for the noise. Unfortunately I can't spent any more time on it and just went with hard coded values.
So please feel free to disregard - won't close it just now since I'll add some info I got.


However, I can provide a quick example of how it was run:
Infrastructure contain in the compose setup:

  newrelic-infra:
    container_name: ${COMPOSE_PROJECT_NAME}-newrelic-infra
    image: ************/newrelic-infrastructure
    cap_add:
      - SYS_PTRACE
    environment:
      NEWRELIC_KEY: ${NEWRELIC_KEY}
      NRIA_LICENSE_KEY: ${NEWRELIC_KEY}
      COMPOSE_PROJECT_NAME: ${COMPOSE_PROJECT_NAME}
      ENVIRONMENT: ${ENVIRONMENT}
      NRI_MYSQL_USER: "newrelic"
      NRI_MYSQL_USER_PASSWORD: "*******************"
      # Disabled by default but can be handy for debugging.
      NRIA_ENABLE_PROCESS_METRICS: "true"
    # We don't expose all container ports - hence we stay in the container
    # networks. It's more important to collect container info than host network
    # metrics for the moment.
    #network_mode: host
    pid: host
    privileged: true
    volumes:
      - "/:/host:ro"
      - "/var/run/docker.sock:/var/run/docker.sock"
    restart: unless-stopped

Custom image build

FROM newrelic/infrastructure:latest

# Repo: https://download.newrelic.com/infrastructure_agent/binaries/linux/amd64/
# Get all the clients we need.
# DON'T add varnish because it needs version specific varnish binaries and
# volume mappings in order to run. Dedicated image is used.
RUN cd /tmp/ \
    && wget https://download.newrelic.com/infrastructure_agent/binaries/linux/amd64/nri-docker_linux_1.8.27_amd64.tar.gz \
    && tar -xf nri-docker_linux_* -C / \
    && wget https://download.newrelic.com/infrastructure_agent/binaries/linux/amd64/nri-redis_linux_1.11.2_amd64.tar.gz \
    && tar -xf nri-redis_linux_* -C / \
    ....
    

Integration config example:

integration_name: com.newrelic.elasticsearch

# Use autodiscovery within our docker stack.
# Autodiscovery is fucked - always leads to:
# level=error msg="can't start integration" component=integrations.runner.Runner env=dev environment=dev error="value not found: discovery.ip" integration_name=nri-flex project=dobi role=php-fpm runner_uid=358170999e
# Even without using discovery.ip anywhere.
discovery:
  docker:
    match:
      image: /elasticsearch/
integrations:
  - name: nri-elasticsearch
    command: all
    arguments:
      cluster_environment: {{ENVIRONMENT}}
      HOSTNAME: ${discovery.ip}
      LOCAL_HOSTNAME:  ${discovery.ip}
    env:
      METRICS: true
      CLUSTER_ENVIRONMENT: {{ENVIRONMENT}}
      HOSTNAME:  ${discovery.ip}
      LOCAL_HOSTNAME: ${discovery.ip}
    labels:
      role: elasticsearch
      project: {{COMPOSE_PROJECT_NAME}}
      environment: {{ENVIRONMENT}}
      env: {{ENVIRONMENT}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants