Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/check-generated-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- 'charts/nr-k8s-otel-collector/**'
- 'charts/nrdot-plus-collector/**'
- '.github/workflows/nr-k8s-otel-e2e.yml'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TMP_DIRECTORY = ./tmp
CHARTS ?= nr-k8s-otel-collector
CHARTS ?= nr-k8s-otel-collector nrdot-plus-collector

.PHONY: generate-examples
generate-examples:
Expand Down
32 changes: 32 additions & 0 deletions charts/nrdot-plus-collector/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# Don't waste time with Negation.
# | "The confusion around negation in .helmignore is because it technically exists in the Helm codebase
# | but is effectively non-functional for typical allowlist use cases."

.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

# Project files
ci/
e2e/
examples/
tests/
9 changes: 9 additions & 0 deletions charts/nrdot-plus-collector/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: common-library
repository: https://helm-charts.newrelic.com
version: 1.4.0
- name: kube-state-metrics
repository: https://prometheus-community.github.io/helm-charts
version: 6.1.5
digest: sha256:b09b6044a258b9bcf3b55eccb8bd5d2dc12a2b8150468f89940110c76bc84856
generated: "2026-01-13T18:16:43.857498-08:00"
49 changes: 49 additions & 0 deletions charts/nrdot-plus-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: v2
name: nrdot-plus-collector
description: A Helm chart to monitor a Kubernetes Cluster using New Relic NRDOT Plus OpenTelemetry Collector with Adaptive Telemetry Processor (ATP).
home: https://github.com/newrelic/helm-charts
icon: https://newrelic.com/assets/newrelic/source/NewRelic-logo-square.svg

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.9.9


dependencies:
- name: common-library
version: 1.4.0
repository: "https://helm-charts.newrelic.com"
- name: kube-state-metrics
version: 6.1.5
condition: kube-state-metrics.enabled
repository: https://prometheus-community.github.io/helm-charts

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.2.0"

maintainers:
- name: dbudziwojskiNR
url: https://github.com/dbudziwojskiNR
- name: Philip-R-Beckwith
url: https://github.com/Philip-R-Beckwith

keywords:
- infrastructure
- newrelic
- monitoring
- opentelemetry
- kubernetes
18 changes: 18 additions & 0 deletions charts/nrdot-plus-collector/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: generate-examples
install-helm-dependencies:
echo 'Installing Helm Dependencies nrdot-plus-collector-> prometheus-community...'; \
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

NEWRELIC_E2E ?= go run github.com/newrelic/newrelic-integration-e2e-action@latest
.PHONY: e2e-test
e2e-test:
$(NEWRELIC_E2E) \
--commit_sha=test-string \
--retry_attempts=10 \
--retry_seconds=60 \
--account_id=${ACCOUNT_ID} \
--api_key=${API_REST_KEY} \
--license_key=${LICENSE_KEY} \
--spec_path=./e2e/test-specs.yml \
--verbose_mode=true \
--agent_enabled="false"
259 changes: 259 additions & 0 deletions charts/nrdot-plus-collector/README.md

Large diffs are not rendered by default.

181 changes: 181 additions & 0 deletions charts/nrdot-plus-collector/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<a href="https://opensource.newrelic.com/oss-category/#community-plus"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/dark/Community_Plus.png"><source media="(prefers-color-scheme: light)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png"><img alt="New Relic Open Source community plus project banner." src="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png"></picture></a>

{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.description" . }}

# Helm installation

Download and Update config [here](https://github.com/newrelic/helm-charts/tree/master/charts/nrdot-plus-collector/values.yaml#L20-L24) to add a cluster name, and New Relic Ingest - License key

Example:
```
licenseKey: "EXAMPLEINGESTLICENSEKEY345878592NRALL"
cluster: "SampleApp"
```

You can install this chart using directly this Helm repository:

```shell
helm repo add newrelic https://helm-charts.newrelic.com
helm upgrade nrdot-plus-collector newrelic/nrdot-plus-collector -f your-custom-values.yaml -n newrelic --create-namespace --install
```

{{ template "chart.sourcesSection" . }}

## Confirm installation
### Watch pods spin up:

```
kubectl get pods -n newrelic --watch
```

### Check logs of opentelemetry pod that spins up:
```
kubectl logs <otel-pod-name> -n newrelic
```

### Confirm data coming through in New Relic
You should see data reporting into New Relic within a couple of seconds to the `OtlpInfrastructureEvent` table, `Metric` table, and `Log` tables.
```
FROM Metric SELECT * WHERE k8s.cluster.name='<CLUSTER_NAME>'
```
```
FROM OtlpInfrastructureEvent SELECT * WHERE k8s.cluster.name='<CLUSTER_NAME>'
```
```
FROM Log SELECT * WHERE k8s.cluster.name='<CLUSTER_NAME>'
```
## Uninstall

Run the following command.

```
helm uninstall nrdot-plus-collector -n newrelic
```

## Values managed globally

This chart implements the [New Relic's common Helm library](https://github.com/newrelic/helm-charts/tree/master/library/common-library) which
means that it honors a wide range of defaults and globals common to most New Relic Helm charts.

Options that can be defined globally include `affinity`, `nodeSelector`, `tolerations` and others. The full list can be found at
[user's guide of the common library](https://github.com/newrelic/helm-charts/blob/master/library/common-library/README.md).

## GKE Autopilot

If using GKE Autopilot, please set the following configuration in your values.yaml file in order for the agent to work with GKE Autopilot.

```
provider: "GKE_AUTOPILOT"
```

## OpenShift

If using OpenShift, please set the following configuration in your values.yaml file in order for the agent to work with OpenShift.

```
provider: "OPEN_SHIFT"
```

## Helmless installation
In the event that you cannot use helm to install this chart we have provided rendered files for you.
The rendered files can be found under [examples/k8s/rendered](examples/k8s/rendered).
Copy the contents of [examples/k8s/rendered](examples/k8s/rendered) to your local workspace.
There's a couple of values you'll need to plug in first, but after you make some quick edits you'll be able to deploy these K8s files as you normally would.

Update the license key in [secret.yaml](examples/k8s/rendered/secret.yaml).
Ensure that you have encoded your license key in base64
```yaml
data:
licenseKey: <Your Base64 encoded License key>
```

You will also have to manually update your cluster name in [daemonset-configmap.yaml](examples/k8s/rendered/daemonset-configmap.yaml), and [deployment-configmap.yaml](examples/k8s/rendered/deployment-configmap.yaml).
Look for uses of `k8s.cluster.name` and replace `<cluster_name>` with your cluster's name.
```yaml
- key: k8s.cluster.name
action: upsert
value: <cluster_name>
```

After these required fields are updated you can use the yamls to install this project onto your cluster with your preferred method.

### Install the chart with kubectl
```bash
kubectl create namespace newrelic
kubectl apply -n newrelic -R -f rendered
```

### Uninstall the chart with kubectl
```bash
kubectl delete -R -f rendered
kubectl delete namespaces newrelic
```
### Adding custom pipelines
The `Values.yaml` accepts configurations for additional receivers, processors, exporters, connectors and pipelines. Configuration added here will be
propagated to the respective configmap.

### Utilizing New Relic maintained pipelines
The pipelines maintained by New Relic accept metrics through the `routing/nr_pipelines` connector. Additional pipelines added in `Values.yaml` can be configured
to export data to this connector which can then be connected to the New Relic maintained pipelines.

{{ template "chart.valuesSection" . }}

**Note:** If all receivers are disabled in the deployment or in the daemonset, the agent will not start.

## Metrics

* [Metrics - Full list](https://github.com/newrelic/helm-charts/tree/master/charts/nrdot-plus-collector/docs/metrics-full.md)
* [Metrics - LowDataMode list](https://github.com/newrelic/helm-charts/tree/master/charts/nrdot-plus-collector/docs/metrics-lowDataMode.md)

## Common Errors

### Exporting Errors

Timeout errors while starting up the collector are expected as the collector attempts to establish a connection with NR.
These timeout errors can also pop up over time as the collector is running but are transient and expected to self-resolve. Further improvements are underway to mitigate the amount of timeout errors we're seeing from the NR1 endpoint.

```
info exporterhelper/retry_sender.go:154 Exporting failed. Will retry the request after interval. {"kind": "exporter", "data_type": "metrics", "name": "otlphttp/newrelic", "error": "failed to make an HTTP request: Post \"https://staging-otlp.nr-data.net/v1/metrics\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)", "interval": "5.445779213s"}
```

### No such file or directory

Sometimes we see failed to open file errors on the `filelog` and `hostmetrics` receiver because of a race condition where the file or directory no longer exists, as the pod or process was ephemeral (e.g. a cronjob, sleep) and the pod or process was terminated before the collector could read the file.

`filelog` error:
```
Failed to open file {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer", "error": "open /var/log/pods/<podname>/<containername>/0.log: no such file or directory"}
```
`hostmetrics` error:
```
Error scraping metrics {"kind": "receiver", "name": "hostmetrics", "data_type": "metrics", "error": "error reading <metric> for process \"<process>\" (pid <PID>): open /hostfs/proc/<PID>/stat: no such file or directory; error reading <metric> info for process \"<process>\" (pid 511766): open /hostfs/proc/<PID>/<metric>: no such file or directory", "scraper": "process"}
```

## Disable Daemonset or Deployment collectors

Warning: Do not modify these values. Changing them can disrupt the Kubernetes monitoring experience and is recommended only for advanced use cases.

```yaml
daemonset:
enabled: true # Set to false to disable DaemonSet creation
deployment:
enabled: true # Set to false to disable Deployment creation
```

If you provide an empty values file, both will default to `true` and be installed. To disable either, set the corresponding flag to `false` in your custom values file.

{{ if .Maintainers }}
## Maintainers
{{ range .Maintainers }}
{{- if .Name }}
{{- if .Url }}
* [{{ .Name }}]({{ .Url }})
{{- else }}
* {{ .Name }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/nrdot-plus-collector/ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cluster: "test-cluster"
licenseKey: "1234567890abcdef1234567890abcdef12345678"
Loading
Loading