Undocumented nginx agent docker image for kubernetes

Hi,i am trying to enable nginx third party integration in a Kubernetes cluster (Google Kubernetes Engine).

The docs are poorly documented. Can you provide a deployment example following this documentaton? https://docs.newrelic.com/docs/integrations/host-integrations/installation/container-auto-discovery

I figure out that at the top of the .yaml file i have to put my license key.

Also, when I run my deployment, i have the following errors:

time="2020-01-10T12:33:10Z" level=error msg="can't get partitions" component=StorageSampler error="open /host/etc/mtab: no such file or directory"
time="2020-01-10T12:33:10Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/etc/mtab: no such file or directory" samplerName=StorageSampler
time="2020-01-10T12:33:15Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc/net/dev: no such file or directory" samplerName=NetworkSampler
time="2020-01-10T12:33:15Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="Panic in CPUMonitor.Sample: runtime error: index out of range\nStack: goroutine 169 [running]:\nruntime/debug.Stack(0xc420653bd0, 0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/debug/stack.go:24 +0xa7\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample.func1(0xc420653e00)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:42 +0x6e\npanic(0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/panic.go:491 +0x283\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample(0xc420073920, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:55 +0x4ce\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*SystemSampler).Sample(0xc4202f4700, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/system_sampler.go:86 +0xc6\ngo.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine.func1(0x111c380, 0xc4202f4700, 0xc42020ece0, 0xc4202efbc0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:37 +0x202\ncreated by go.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:27 +0x161\n" samplerName=SystemSampler
time="2020-01-10T12:33:20Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="Panic in CPUMonitor.Sample: runtime error: index out of range\nStack: goroutine 169 [running]:\nruntime/debug.Stack(0xc420653bd0, 0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/debug/stack.go:24 +0xa7\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample.func1(0xc420653e00)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:42 +0x6e\npanic(0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/panic.go:491 +0x283\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample(0xc420073920, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:55 +0x4ce\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*SystemSampler).Sample(0xc4202f4700, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/system_sampler.go:86 +0xc6\ngo.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine.func1(0x111c380, 0xc4202f4700, 0xc42020ece0, 0xc4202efbc0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:37 +0x202\ncreated by go.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:27 +0x161\n" samplerName=SystemSampler
time="2020-01-10T12:33:20Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc/net/dev: no such file or directory" samplerName=NetworkSampler
time="2020-01-10T12:33:25Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc/net/dev: no such file or directory" samplerName=NetworkSampler
time="2020-01-10T12:33:25Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="Panic in CPUMonitor.Sample: runtime error: index out of range\nStack: goroutine 169 [running]:\nruntime/debug.Stack(0xc4204cebd0, 0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/debug/stack.go:24 +0xa7\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample.func1(0xc4204cee00)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:42 +0x6e\npanic(0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/panic.go:491 +0x283\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample(0xc420073920, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:55 +0x4ce\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*SystemSampler).Sample(0xc4202f4700, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/system_sampler.go:86 +0xc6\ngo.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine.func1(0x111c380, 0xc4202f4700, 0xc42020ece0, 0xc4202efbc0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:37 +0x202\ncreated by go.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:27 +0x161\n" samplerName=SystemSampler
time="2020-01-10T12:33:30Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc: no such file or directory" samplerName=ProcessSampler
time="2020-01-10T12:33:30Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="Panic in CPUMonitor.Sample: runtime error: index out of range\nStack: goroutine 169 [running]:\nruntime/debug.Stack(0xc420577bd0, 0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/debug/stack.go:24 +0xa7\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample.func1(0xc420577e00)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:42 +0x6e\npanic(0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/panic.go:491 +0x283\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample(0xc420073920, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:55 +0x4ce\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*SystemSampler).Sample(0xc4202f4700, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/system_sampler.go:86 +0xc6\ngo.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine.func1(0x111c380, 0xc4202f4700, 0xc42020ece0, 0xc4202efbc0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:37 +0x202\ncreated by go.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:27 +0x161\n" samplerName=SystemSampler
time="2020-01-10T12:33:30Z" level=error msg="can't get partitions" component=StorageSampler error="open /host/etc/mtab: no such file or directory"
time="2020-01-10T12:33:30Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/etc/mtab: no such file or directory" samplerName=StorageSampler
time="2020-01-10T12:33:30Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc/net/dev: no such file or directory" samplerName=NetworkSampler
time="2020-01-10T12:33:30Z" level=error msg="can't open file" error="open /host/proc/sys/kernel/random/boot_id: no such file or directory" path=/host/proc/sys/kernel/random/boot_id
time="2020-01-10T12:33:35Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="Panic in CPUMonitor.Sample: runtime error: index out of range\nStack: goroutine 169 [running]:\nruntime/debug.Stack(0xc420577bd0, 0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/debug/stack.go:24 +0xa7\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample.func1(0xc420577e00)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:42 +0x6e\npanic(0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/panic.go:491 +0x283\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample(0xc420073920, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:55 +0x4ce\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*SystemSampler).Sample(0xc4202f4700, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/system_sampler.go:86 +0xc6\ngo.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine.func1(0x111c380, 0xc4202f4700, 0xc42020ece0, 0xc4202efbc0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:37 +0x202\ncreated by go.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:27 +0x161\n" samplerName=SystemSampler
time="2020-01-10T12:33:35Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc/net/dev: no such file or directory" samplerName=NetworkSampler
time="2020-01-10T12:33:40Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="Panic in CPUMonitor.Sample: runtime error: index out of range\nStack: goroutine 169 [running]:\nruntime/debug.Stack(0xc420577bd0, 0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/debug/stack.go:24 +0xa7\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample.func1(0xc420577e00)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:42 +0x6e\npanic(0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/panic.go:491 +0x283\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample(0xc420073920, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:55 +0x4ce\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*SystemSampler).Sample(0xc4202f4700, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/system_sampler.go:86 +0xc6\ngo.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine.func1(0x111c380, 0xc4202f4700, 0xc42020ece0, 0xc4202efbc0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:37 +0x202\ncreated by go.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:27 +0x161\n" samplerName=SystemSampler
time="2020-01-10T12:33:40Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc/net/dev: no such file or directory" samplerName=NetworkSampler
time="2020-01-10T12:33:45Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc/net/dev: no such file or directory" samplerName=NetworkSampler
time="2020-01-10T12:33:45Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="Panic in CPUMonitor.Sample: runtime error: index out of range\nStack: goroutine 169 [running]:\nruntime/debug.Stack(0xc420577bd0, 0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/debug/stack.go:24 +0xa7\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample.func1(0xc420577e00)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:42 +0x6e\npanic(0xb90de0, 0x1149cc0)\n\t/usr/local/go1.9/src/runtime/panic.go:491 +0x283\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*CPUMonitor).Sample(0xc420073920, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/cpu.go:55 +0x4ce\ngo.datanerd.us/p/meatballs/infra-agent/metrics.(*SystemSampler).Sample(0xc4202f4700, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/system_sampler.go:86 +0xc6\ngo.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine.func1(0x111c380, 0xc4202f4700, 0xc42020ece0, 0xc4202efbc0)\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:37 +0x202\ncreated by go.datanerd.us/p/meatballs/infra-agent/metrics/sender.StartSamplerRoutine\n\t/tmp/tmp.q3bZB9VoKe/src/go.datanerd.us/p/meatballs/infra-agent/metrics/sender/sampler_routine.go:27 +0x161\n" samplerName=SystemSampler
time="2020-01-10T12:33:50Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc: no such file or directory" samplerName=ProcessSampler
time="2020-01-10T12:33:50Z" level=error msg="can't get sample from sampler" component="Metrics Sender" error="open /host/proc/net/dev: no such file or directory" samplerName=NetworkSampler```

Here you are my new-relic-infra.yaml:

license_key: euMYLICENSE
integration_name: com.newrelic.nginx
discovery:
  docker:
    match:
      image: nginx
instances:
  - name: monitoring-all
    command: metrics
    arguments:
      status_url: http://${discovery.ip}:${discovery.port}/status
      status_module: discover
      remote_monitoring: true
    labels:
      env: ${discovery.label.env}
      role: ${discovery.label.role}

Also, the new relic nginx agent does not work well because it requires systemd

Here you are the output from diagnosis tool:


Check Results
-------------------------------------------------

Info     Base/Env/CollectEnvVars [Gathered Environment variables of current shell.] 
Failure  Base/Config/Collect
Error    Base/Env/InitSystem
Success  Base/Config/LicenseKey
Info     Base/Config/RegionDetect [1 unique New Relic region(s) detected from config.] 
Info     Base/Env/HostInfo [app-7d9cbd8dc-9bxbf] 
Failure  Base/Log/Copy
Success  Base/Collector/ConnectEU
Warning  Java/AppServer/WebSphere
67 results not shown: 67 None
See nrdiag-output.json for full results.

Issues Found
-------------------------------------------------
Failure - Base/Config/Collect
Config files not found, please check to ensure you are running this from your project's working directory or specify config file location with -c option
See https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/configure-agent for more information.


Error - Base/Env/InitSystem
Unable to parse init system from: /bin/busybox


Failure - Base/Log/Copy
Log File not found, please check working directory
See https://docs.newrelic.com/docs/new-relic-diagnostics#run-diagnostics for more information.


Warning - Java/AppServer/WebSphere
We suspect this is a WebSphere environment but we're unable to determine the version. Supported status is unknown.
See https://docs.newrelic.com/docs/agents/java-agent/additional-installation/ibm-websphere-application-server for more information.

Hello!

The nginx integration is designed to be run from a host environment, not in a container. The image you found is for possible future work and isn’t a part of our supported products. I would recommend running the Infra agent and integration on a host that targets your nginx environment.

2 Likes

Okey, thanks for your suport!

Hi @oswald_development ,
Thanks for taking the time to write here!
We have an early access program for running this NGinx integration in Kubernetes, contact me in a private message if you would like to try it.

1 Like

Hi, how can I access to the early program? Shall I build the agent from the source code?

Hey @oswald_development - I see you are in a DM Thread with @jjoly - JF will be able to help you out in that DM :smiley:

Due to i dont have any response to DM, i finally found the correct repo for all integrations in Kubernetes: https://github.com/newrelic/k8s-webhook, but I still have some question, the nginx integration for example will appear as standard nginx integration, or may be in Kubernetes integration? Can everyone access to the alfa integrations?

Hey @oswald_development,

Alfa Integrations are not open publicly.
Best course of action here would be engaging your Account Representative to get you on board of the early access program.

He will reach out to you :slight_smile:

Cheers