Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

StatsD and Kubernetes Agent


#1

I’m looking to add the StatsD integration to gather some pod metrics. Are there issues installing the New Relic infrastructure agent alongside the kubernetes agent? Will there be a large amount of duplicate data?


#2

Hi @david.moran,

You will for sure have duplicated data on that scenario.
The Kubernetes agent is an on-host integration like StatsD, so it is associated with an Infrastructure agent.
When deploying the kubernetes integration you are also deploying the agent, 1 agent per node, so i would not suggest doing it that way.
What you could try is deploying only the StatsD integration on each node along side with the K8s agent (which already includes the Infrastructure agent) and use StatsD to collect the additional pod metrics you need.

Please note that this is not a scenario we have tested already.

Anyway, let us know if you need any additional information and/or if you deploy this, we would also love to hear from you.

Cheers,


#3

What’s the best way to enable the HTTP endpoint in the K8s agent (if it’s not already enabled)? From your StatsD instructions:

http_server_enabled: true		
http_server_host: 127.0.0.1 #(default host)
http_server_port: 8001 #(default port)

#4

Hello @david.moran,

As in step 2 of the Kubernetes instructions here, you can set the license key and cluster name through environment variables.

This may also work for the http_server_enabled, http_server_host and http_server_port.

So expanding step 2 to include the required env variables, might look like below:

env:
  - name: NRIA_LICENSE_KEY
    value: YOUR_LICENSE_KEY
  - name: CLUSTER_NAME
    value: YOUR_CLUSTER_NAME
  - name: NRIA_HTTP_SERVER_ENABLED
    value: HTTP_SERVER_ENABLED_VALUE
  - name: NRIA_HTTP_SERVER_HOST
    value: YOUR_HTTP_SERVER_HOST
  - name: NRIA_HTTP_SERVER_PORT
    value: YOUR_HTTP_SERVER_PORT

Again this isn’t something we have tested, however the lines above may work to get these configuration options into the Infrastructure agent. We’d be very interested to hear if this works!