Skip to content
Draft
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
7 changes: 7 additions & 0 deletions charts/nr-ebpf-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Options that can be defined globally include `affinity`, `nodeSelector`, `tolera
| apmDataFilters.dropPodLabels | object | `{}` | Pod labels to match for filtering APM data. Empty map means no label-based filtering. (Example: dropPodLabels: `{ "app": "frontend", "env": "production" }`) |
| apmDataFilters.dropEntityName | list | `[]` | List of entity names to drop ebpf APM data.|
| apmDataFilters.keepEntityName | list | `[]` | List of entity names to always keep APM data. By default all entities are kept/enabled. This config bypasses `dropEntityName` filter. |
| apmDataFilters.jvmMetricsReporting | bool | `true` | Enable JVM Metrics Reporting. |
| cluster | string | `""` | Name of the Kubernetes cluster to be monitored. Mandatory. Can be configured with `global.cluster` |
| containerSecurityContext | object | `{}` | Sets all pods' containerSecurityContext. Can be configured also with `global.securityContext.container` |
| customSecretLicenseKey | string | `""` | In case you don't want to have the license key in your values, this allows you to point to which secret key is the license key located. Can be configured also with `global.customSecretLicenseKey` |
Expand All @@ -129,6 +130,12 @@ Options that can be defined globally include `affinity`, `nodeSelector`, `tolera
| kubernetesClusterDomain | string | `"cluster.local"` | Kubernetes cluster domain. |
| labels | object | `{}` | Additional labels for chart objects. |
| licenseKey | string | `""` | The license key to use. Can be configured with `global.licenseKey` |
| logDataFilters.applicationReporting.enabled | bool | `true` | Enable logs collection from the entities matching the filters below. |
| logDataFilters.applicationReporting.fileRegex | string | `".*\\.log$"` | Regex to match log file names to include. |
| logDataFilters.applicationReporting.keepFileEntityRegex | string | `".*"` | Regex to match entity names to keep logs from log files. |
| logDataFilters.applicationReporting.keepStdEntityRegex | string | `".*"` | Regex to match entity names to keep logs from stdout and stderr. |
| logDataFilters.applicationReporting.maxSamplePerMinute | int | `10000` | Maximum number of log samples to collect per minute from an entity. |
| logReporting | bool | `true` | Enable log reporting. When enabled, the agent collects and reports logs from entities. |
| networkMetricsDataFilter.dropPodLabels | object | `{}` | Pod labels to match for filtering Network metrics data. Empty map means no label-based filtering. (Example: dropPodLabels: `{ "app": "frontend", "env": "production" }`) |
| networkMetricsDataFilter.dropEntityName | list | `[]` | List of entity names to drop Network metrics data for |
| networkMetricsDataFilter.keepEntityName | list | `[]` | List of entity names to always keep Network metrics data. By default all entities are kept/enabled. This config bypasses `dropEntityName` filter. |
Expand Down
31 changes: 29 additions & 2 deletions charts/nr-ebpf-agent/templates/nr-ebpf-agent-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ spec:
{{- end }}
initContainers:
- name: kernel-header-installer
image: {{ .Values.ebpfAgent.image.repository }}:agent-base-image-latest
imagePullPolicy: {{ .Values.ebpfAgent.image.pullPolicy }}
image: {{ .Values.ebpfAgent.image.repository }}:{{ .Values.init.image.tag | default "agent-base-image-latest" }}
imagePullPolicy: {{ .Values.init.image.pullPolicy }}
command: ["/scripts/install-headers.sh"]
securityContext:
privileged: true
Expand Down Expand Up @@ -122,6 +122,13 @@ spec:
value: "{{ .Values.protocols.http.spans.samplingErrorRate | default "0"}}"
{{- end }}
{{- end }}
{{- if (hasKey .Values.protocols.thrift "spans") }}
{{- if .Values.protocols.thrift.spans.samplingErrorRate}}
{{- include "validate.samplingErrorRate" (dict "protocol" "thrift" "errorRate" .Values.protocols.thrift.spans.samplingErrorRate) }}
- name: PROTOCOLS_THRIFT_SPANS_SAMPLING_ERROR_RATE
value: "{{ .Values.protocols.thrift.spans.samplingErrorRate | default "0"}}"
{{- end }}
{{- end }}
- name: NAMESPACE
value: {{ .Release.Namespace }}
- name: AGENT_SERVICE_NAME
Expand All @@ -130,6 +137,8 @@ spec:
value: "{{ if hasKey .Values "apmDataReporting" }}{{ .Values.apmDataReporting }}{{ else }}true{{ end }}"
- name: NETWORK_METRICS_REPORTING
value: "{{ if hasKey .Values "networkMetricsReporting" }}{{ .Values.networkMetricsReporting }}{{ else if hasKey .Values "tcpStatsReporting" }}{{ .Values.tcpStatsReporting }}{{ else }}true{{ end }}"
- name: LOG_REPORTING
value: "{{ if hasKey .Values "logReporting" }}{{ .Values.logReporting }}{{ else }}true{{ end }}"
# ALL Data filtering configuration
{{- if .Values.allDataFilters }}
- name: DROP_ALL_DATA_FOR_NEW_RELIC
Expand All @@ -156,6 +165,8 @@ spec:
value: "{{ .Values.apmDataFilters.dropEntityName | join "," }}"
- name: KEEP_APM_DATA_FOR_ENTITY_NAME
value: "{{ .Values.apmDataFilters.keepEntityName | join "," }}"
- name: JVM_METRICS_REPORTING
value: "{{ if hasKey .Values.apmDataFilters "jvmMetricsReporting" }}{{ .Values.apmDataFilters.jvmMetricsReporting }}{{ else }}true{{ end }}"
{{- end }}

# Network metrics data filtering configuration
Expand All @@ -170,6 +181,22 @@ spec:
value: "{{ .Values.networkMetricsDataFilter.keepEntityName | join "," }}"
{{- end }}

# Log data filtering configuration
{{- if .Values.logDataFilters }}
{{- if .Values.logDataFilters.applicationLogReporting }}
- name: APPLICATION_LOG_REPORTING_ENABLED
value: "{{ .Values.logDataFilters.applicationLogReporting.enabled | default true }}"
- name: APPLICATION_LOG_FILE_REGEX
value: {{ .Values.logDataFilters.applicationLogReporting.fileRegex | quote }}
- name: MAX_LOG_SAMPLES_PER_MINUTE
value: "{{ .Values.logDataFilters.applicationLogReporting.maxSamplesPerMinute | default 10000 }}"
- name: KEEP_STDSTREAM_LOG_FOR_ENTITY_REGEX
value: {{ .Values.logDataFilters.applicationLogReporting.keepStdStreamEntityRegex | quote }}
- name: KEEP_FILE_LOG_FOR_ENTITY_REGEX
value: {{ .Values.logDataFilters.applicationLogReporting.keepFileEntityRegex | quote }}
{{- end }}
{{- end }}

# DEPRECATED: The following environment variables are deprecated and kept for backward compatibility.
# If you are using an older configuration file with a newer Helm chart version, these settings will still work.
# However, please update your configuration to use the new filtering mechanisms.
Expand Down
41 changes: 41 additions & 0 deletions charts/nr-ebpf-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ apmDataReporting: true
# -- Enable network metrics reporting. When enabled, the agent collects and reports network metrics including TCP statistics
# RENAMED from 'tcpStatsReporting' for clarity. The old name is deprecated but still supported for backward compatibility.
networkMetricsReporting: true
# -- Enable log reporting. When enabled, the agent collects and reports logs.
logReporting: true

# -- All data drop filters configuration
# Configure filters to drop all types of data (Network Metrics and APM data) based on config provided
Expand Down Expand Up @@ -54,6 +56,8 @@ apmDataFilters:
# -- List of entity names to always keep APM data. By default all entities are kept/enabled
# -- This config bypasses dropEntityName filter.
keepEntityName: []
# -- Enable JVM metrics reporting. When enabled, the agent collects and reports JVM metrics for Java applications
jvmMetricsReporting: true

# -- Network metrics Data filter / TCP stats filters
# Configure filters to drop/keep Network metrics data based on config provided
Expand All @@ -67,6 +71,29 @@ networkMetricsDataFilter:
# -- This config bypasses dropEntityName filter.
keepEntityName: []

# -- Log data filters configuration
# Configure filters to drop/keep log data based on the config provided
logDataFilters:
# -- Application/entity log reporting filters
applicationLogReporting:
# -- Enable log reporting for entity monitored by eBPF Agent
enabled: true
# -- Regex to match log file path to include for entity log reporting
fileRegex: ".*.log$"
# -- Maximum number of log samples to collect per minute from an entity.
# The internal maxSamplesStored is calculated proportionally based on the harvest cycle (5 seconds):
# maxSamplesStored = maxSamplesPerMinute / (60 / 5) = maxSamplesPerMinute / 12
# For the default value of 10000, this results in ~833 samples stored per harvest cycle.
# Once this limit is reached, events are sampled to maintain an even distribution across the harvest cycle.
maxSamplesPerMinute: 10000
# -- The eBPF agent collects and reports STDOUT/STDERR STREAM logs to New Relic for entities that match this regex.
# The entities are identified by their "NEW_RELIC_APP_NAME" (if provided) or their Kubernetes service name.
# To forward logs for all entities, use the regex .*
keepStdStreamEntityRegex: ".*"
# -- The eBPF agent collects and reports FILE logs to New Relic for entities that match this regex.
# The entities are identified by their "NEW_RELIC_APP_NAME" (if provided) or their Kubernetes service name.
# To forward logs for all entities, use the regex .*
keepFileEntityRegex: ".*"

# The protocols to enable for tracing in the socket_tracer. There is an ability to configure span export if it is enabled.
# Each protocol has the flexibility to selectively enable the type of OTLP data to export.
Expand All @@ -85,6 +112,12 @@ protocols:
# -- samplingErrorRate represents the error rate threshold for an HTTP route where surpassing it would mean the corresponds spans of the route are exported.
# Options: 1-100
samplingErrorRate: ""
thrift:
enabled: true
spans:
enabled: true
samplingLatency: "p50"
samplingErrorRate: ""
mysql:
enabled: true
spans:
Expand Down Expand Up @@ -136,6 +169,14 @@ protocols:
enabled: true
samplingLatency: "p50"

# Configuration to apply on the eBPF agent init container
init:
image:
# -- The pull policy is defaulted to IfNotPresent, which skips pulling an image if it already exists. If pullPolicy is defined without a specific value, it is also set to Always.
pullPolicy: IfNotPresent
# -- The tag for eBPF agent init container image.
tag: ""

# Configuration to apply on the eBPF agent daemonset.
ebpfAgent:
image:
Expand Down
Loading