Decrease data ingestion from Metrics

Hi,

I connected a Kubernetes cluster with 5 pods to New Relic. The most important reason for it is to collect the logs and visualize them. Everything is working fine, but when I check the data ingestion 90% of the data is from Metrics. But these are not super important for me. Is there a way to decrease the Metrics data ingestion? I know there are articles on it, but they are not very clear. I used a YAML file to deploy the Kubernetes to New Relic.

Thanks a lot!

Can someone help me?

Hi @robin27 , thanks for your question!

You can reduce the amount of K8s data being sent to New Relic by increasing the polling interval. The polling interval is set in the nri-kubernetes-definition.yml which cannot be manually changed.

It is possible to modify this when using the K8s integration manifest by locating the nri-default-integration-cfg ConfigMap and update it to match the following:

apiVersion: v1
kind: ConfigMap
metadata:
  name: nri-default-integration-cfg # integrations config provided by default
  namespace: default
data:
  nri-kubernetes-config.yml: |
    integrations:
      - name: nri-kubernetes
        interval: 30s

The default interval is 15s, so the setting shown above would half the sampling rate, but this can be adjusted to fit your preferences. Note that setting an interval greater than 60s is not recommended and may result in unintended behavior or inaccurate metrics.

2 Likes

Hi @kmcginley,

Thanks for your answer.

I only have a newrelic-manifest.yaml file that I used to deploy New Relic. In this file no nri-default-integration-cfg is mentioned. Do I need to add these lines or what do I need to do?

Thanks a lot!

Hi @robin27,

It seems that the guided install and automated installer download a version of the newrelic-manifest.yaml file without the integration config. You should be able to add this yourself and mount it to the infrastructure daemonset, likely found under "Source: nri-bundle/charts/newrelic-infrastructure/templates/daemonset.yaml" in your manifest.

The nri-kubernetes/deploy/newrelic-infra.yaml has both the nri-default-integration-cfg and the nri-integration-cfg configured so this is a good reference point for adding this configuration. The nri-integration-cfg is aimed to be safely overridden by users, I describe the steps below that should help you add this.


The steps:

  1. Add the nri-integration-cfg ConfigMap, as described in my previous message (reference):
apiVersion: v1
kind: ConfigMap
metadata:
  name: nri-default-integration-cfg # aimed to be safely overridden by users
  namespace: default
data:
  nri-kubernetes-config.yml: |
    integrations:
      - name: nri-kubernetes
        interval: 30s
  1. Create a volume in the deamonset with this ConfigMap (reference):
      volumes:
      [...]
        - name: nri-integration-cfg-volume
          configMap:
            name: nri-integration-cfg
  1. Mount the volume, in the daemonset (reference):
          volumeMounts:
           [...]
            - mountPath: /etc/newrelic-infra/integrations.d/
              name: nri-integration-cfg-volume
2 Likes