Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added otel helm chart #555

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
21 changes: 21 additions & 0 deletions charts/splunk-otel-collector/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmprojmak
34 changes: 34 additions & 0 deletions charts/splunk-otel-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v2
name: splunk-otel-collector
version: 0.109.0
appVersion: 0.109.0
description: Splunk OpenTelemetry Collector for Kubernetes
icon: https://github.com/signalfx/splunk-otel-collector-chart/tree/main/splunk.png
type: application
keywords:
- splunk
- opentelemetry
- observability
- logs
- traces
- metrics
- apm
- instrumentation
maintainers:
- name: dmitryax
- name: jvoravong
- name: emaderer
dependencies:
# Subchart Notes:
# - Avoid uppercase letters in names/aliases, they cause install failure due to subchart resource naming
# - Avoid hyphen characters in names/aliases, they introduce template rendering complications (https://github.com/helm/helm/issues/2192)
- name: cert-manager
version: v1.14.4
alias: certmanager
repository: https://charts.jetstack.io
condition: certmanager.enabled
- name: opentelemetry-operator
version: 0.49.1
alias: operator
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
condition: operator.enabled
11 changes: 11 additions & 0 deletions charts/splunk-otel-collector/ci/basic-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clusterName: fake-cluster
splunkObservability:
realm: fake-realm
accessToken: fake-token

# Logs collection config for Kind cluster
fluentd:
config:
containers:
logFormatType: cri
criTimeFormat: "%Y-%m-%dT%H:%M:%S.%NZ"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
clusterName: fake-cluster
splunkObservability:
realm: fake-realm
accessToken: fake-token
logsEnabled: true
tracesEnabled: false
metricsEnabled: false

splunkPlatform:
endpoint: "fake-endpoint"
token: "fake-token"
index: "main"
logsEnabled: true
metricsEnabled: false

logsEngine: otel
7 changes: 7 additions & 0 deletions charts/splunk-otel-collector/ci/logs-only-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
clusterName: fake-cluster
splunkObservability:
realm: fake-realm
accessToken: fake-token
logsEnabled: true
tracesEnabled: false
metricsEnabled: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
clusterName: fake-cluster
splunkObservability:
realm: fake-realm
accessToken: fake-token
logsEnabled: true

agent:
config:
processors:
probabilistic_sampler:
hash_seed: 22
sampling_percentage: 15.3
service:
pipelines:
traces:
processors:
- memory_limiter
- probabilistic_sampler
- k8sattributes
- batch
- resource
- resourcedetection
extraEnvs:
- name: HTTPS_PROXY
value: "192.168.0.10"

clusterReceiver:
extraEnvs:
- name: HTTPS_PROXY
value: "192.168.0.10"

gateway:
enabled: true
replicaCount: 1
resources:
limits:
cpu: 200m
memory: 400Mi

fluentd:
config:
logs:
java-app:
from:
pod: "java-app"
multiline:
firstline: /\d{4}-\d{1,2}-\d{1,2}/

# Logs collection config for Kind cluster
containers:
logFormatType: cri
criTimeFormat: "%Y-%m-%dT%H:%M:%S.%NZ"
29 changes: 29 additions & 0 deletions charts/splunk-otel-collector/ci/use-custom-gateway-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
clusterName: my-cluster
# Validate backward compatible parameters
splunkRealm: us0
splunkAccessToken: my-access-token

logsEnabled: false

agent:
config:
exporters:
otlp:
endpoint: 192.168.0.10:4317
insecure: true
signalfx:
ingest_url: http://192.168.0.10:9943
api_url: http://192.168.0.10:6060
service:
pipelines:
traces:
exporters: [otlp, signalfx]
metrics:
exporters: [otlp]

clusterReceiver:
config:
exporters:
signalfx:
ingest_url: http://192.168.0.10:9943
api_url: http://192.168.0.10:6060
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#! /usr/bin/bash
set -ex

echo "Downloading yq"
curl -L -o yq https://github.com/mikefarah/yq/releases/download/v4.16.2/yq_linux_amd64
ACTUAL=$(sha256sum yq | awk '{print $1}')
if [ "${ACTUAL}" != "5c911c4da418ae64af5527b7ee36e77effb85de20c2ce732ed14c7f72743084d" ]; then
echo "will not attempt to use yq with unexpected sha256 (${ACTUAL} != 5c911c4da418ae64af5527b7ee36e77effb85de20c2ce732ed14c7f72743084d)"
exit 1
fi
chmod a+x yq

# If we are the first pod (cluster receiver), set the kubelet stats node filter to only follow labelled nodes.
# This node label will be set by the second pod.
if [[ "${K8S_POD_NAME}" == *-0 ]]; then
echo "will configure kubelet stats receiver to follow other StatefulSet replica's node, as well as use cluster receiver."
./yq e '.receivers.receiver_creator.receivers.kubeletstats.rule = .receivers.receiver_creator.receivers.kubeletstats.rule + " && labels[\"splunk-otel-eks-fargate-kubeletstats-receiver-node\"] == \"true\""' /conf/relay.yaml >/splunk-messages/config.yaml
./yq e -i '.extensions.k8s_observer.observe_pods = false' /splunk-messages/config.yaml
exit 0
fi

# Else we are the second pod (wide kubelet stats) label our node to be monitored by the first pod and disable the k8s_cluster receiver.
# Update our config to not monitor ourselves
echo "Labelling our fargate node to denote it hosts the cluster receiver"

# download kubectl (verifying checksum)
curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.20.4/2021-04-12/bin/linux/amd64/kubectl
ACTUAL=$(sha256sum kubectl | awk '{print $1}')
if [ "${ACTUAL}" != "e84ff8c607b2a10f635c312403f9ede40a045404957e55adcf3d663f9e32c630" ]; then
echo "will not attempt to use kubectl with unexpected sha256 (${ACTUAL} != e84ff8c607b2a10f635c312403f9ede40a045404957e55adcf3d663f9e32c630)"
exit 1
fi
chmod a+x kubectl
# label node
./kubectl label nodes "$K8S_NODE_NAME" splunk-otel-eks-fargate-kubeletstats-receiver-node=true

echo "Disabling k8s_cluster receiver for this instance"
# strip k8s_cluster and its pipeline
./yq e 'del(.service.pipelines.metrics)' /conf/relay.yaml >/splunk-messages/config.yaml
./yq e -i 'del(.receivers.k8s_cluster)' /splunk-messages/config.yaml

# set kubelet stats to not monitor ourselves (all other kubelets)
echo "Ensuring k8s_observer-based kubeletstats receivers won't monitor own node to avoid Fargate network limitation."
# shellcheck disable=SC2016
./yq e -i '.receivers.receiver_creator.receivers.kubeletstats.rule = .receivers.receiver_creator.receivers.kubeletstats.rule + " && not ( name contains \"${K8S_NODE_NAME}\" )"' /splunk-messages/config.yaml
83 changes: 83 additions & 0 deletions charts/splunk-otel-collector/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{{/* Current jsonschema doesn't enforce below requirement while `splunkRealm` not provided as (an undesired) default value. */}}
{{- if and (eq (include "splunk-otel-collector.splunkPlatformEnabled" .) "false") (eq (include "splunk-otel-collector.splunkO11yEnabled" .) "false") -}}
{{ fail "[ERROR] Please set at least one of required `splunkObservability.realm` or `splunkPlatform.endpoint` and corresponding token values to specify the platform(s) to send data." }}
{{- end -}}

{{- if eq (include "splunk-otel-collector.splunkPlatformEnabled" .) "true" }}
Splunk OpenTelemetry Collector is installed and configured to send data to Splunk Platform endpoint "{{ .Values.splunkPlatform.endpoint }}".
{{ end }}
{{- if eq (include "splunk-otel-collector.splunkO11yEnabled" .) "true" }}
Splunk OpenTelemetry Collector is installed and configured to send data to Splunk Observability realm {{ include "splunk-otel-collector.o11yRealm" . }}.
{{ end }}

{{- if .Values.splunkRealm }}
[WARNING] "splunkRealm" parameter is deprecated, please use "splunkObservability.realm" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0353-to-0360
{{ end }}
{{- if .Values.splunkAccessToken }}
[WARNING] "splunkAccessToken" parameter is deprecated, please use "splunkObservability.accessToken" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0353-to-0360
{{ end }}
{{- if .Values.ingestUrl }}
[WARNING] "ingestUrl" parameter is deprecated, please use "splunkObservability.ingestUrl" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0353-to-0360
{{ end }}
{{- if .Values.apiUrl }}
[WARNING] "apiUrl" parameter is deprecated, please use "splunkObservability.apiUrl" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0353-to-0360
{{ end }}
{{- if not (eq (toString .Values.metricsEnabled) "<nil>") }}
[WARNING] "metricsEnabled" parameter is deprecated, please use "splunkObservability.metricsEnabled" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0353-to-0360
{{ end }}
{{- if not (eq (toString .Values.tracesEnabled) "<nil>") }}
[WARNING] "tracesEnabled" parameter is deprecated, please use "splunkObservability.tracesEnabled" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0353-to-0360
{{ end }}
{{- if not (eq (toString .Values.logsEnabled) "<nil>") }}
[WARNING] "logsEnabled" parameter is deprecated, please use "splunkObservability.logsEnabled" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0353-to-0360
{{ end }}
{{- if not (eq (toString .Values.distro) "<nil>") }}
[WARNING] "distro" parameter is deprecated, please use "distribution" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0371-to-0380
{{ end }}
{{- if not (eq (toString .Values.provider) "<nil>") }}
[WARNING] "provider" parameter is deprecated, please use "cloudProvider" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0371-to-0380
{{ end }}
{{- if not (eq (toString .Values.extraAttributes.podLabels) "<nil>") }}
[WARNING] ".Values.extraAttributes.podLabels" parameter is deprecated, please use ".Values.extraAttributes.fromLabels" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0371-to-0380
{{ end }}
{{- if not (eq (toString .Values.otelAgent) "<nil>") }}
[WARNING] "otelAgent" parameter group is deprecated, please rename it to "agent" in your custom values.yaml.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0371-to-0380
{{ end }}
{{- if not (eq (toString .Values.otelCollector) "<nil>") }}
[WARNING] "otelCollector" parameter group is deprecated, please rename it to "gateway" in your custom values.yaml.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0371-to-0380
{{ end }}
{{- if not (eq (toString .Values.otelK8sClusterReceiver) "<nil>") }}
[WARNING] "otelK8sClusterReceiver" parameter group is deprecated, please rename it to "clusterReceiver" in your custom values.yaml.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0371-to-0380
{{ end }}
{{- if not (eq (toString .Values.image.fluentd.initContainer) "<nil>") }}
[WARNING] "image.fluentd.initContainer" parameter is deprecated now. Now we use the same splunk/fluentd-hec image in init container.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0371-to-0380
{{ end }}
{{- $clusterReceiver := fromYaml (include "splunk-otel-collector.clusterReceiver" .) }}
{{- if not (eq (toString $clusterReceiver.k8sEventsEnabled) "<nil>") }}
[WARNING] "clusterReceiver.k8sEventsEnabled" parameter is deprecated. Please use clusterReceiver.eventsEnabled and splunkObservability.infrastructureMonitoringEventsEnabled.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0532-to-0540
{{ end }}
{{- $crEventsEnabled := toString $clusterReceiver.eventsEnabled }}
{{- if not (or (eq $crEventsEnabled "<nil>") (eq $crEventsEnabled "false")) }}
[WARNING] "clusterReceiver.eventsEnabled" parameter is deprecated. Soon it will be replaced with "clusterReceiver.k8sObjects".
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#0670-to-0680
{{ end }}
{{- if .Values.operator.enabled }}
[INFO] You've enabled the operator's auto-instrumentation feature (operator.enabled=true)! The operator can automatically instrument Kubernetes hosted applications.
- Status: Instrumentation language maturity varies. See `operator.instrumentation.spec` and documentation for utilized instrumentation details.
- Splunk Support: We offer full support for Splunk distributions and best-effort support for native OpenTelemetry distributions of auto-instrumentation libraries.
{{- end }}
Loading
Loading