Skip to content

Commit 25e2cd7

Browse files
Merge branch 'main' into otl-3816-otlp-log-ingest
2 parents fb908e3 + 8abb526 commit 25e2cd7

3 files changed

Lines changed: 78 additions & 5 deletions

File tree

helm-charts/splunk-otel-collector/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Create chart name and version as used by the chart label.
3636
Whether to send data to Splunk Platform endpoint
3737
*/}}
3838
{{- define "splunk-otel-collector.splunkPlatformEnabled" -}}
39-
{{- or (not (eq .Values.splunkPlatform.endpoint "")) .Values.splunkPlatform.otlpIngest.enabled }}
39+
{{- not (eq .Values.splunkPlatform.endpoint "") }}
4040
{{- end -}}
4141

4242
{{/*
@@ -113,7 +113,7 @@ Whether traces enabled for any destination.
113113
Whether logs enabled for any destination.
114114
*/}}
115115
{{- define "splunk-otel-collector.logsEnabled" -}}
116-
{{- include "splunk-otel-collector.platformLogsEnabled" . }}
116+
{{- or (eq (include "splunk-otel-collector.platformLogsEnabled" .) "true") (eq (include "splunk-otel-collector.platformLogsViaOtlpEnabled" .) "true") }}
117117
{{- end -}}
118118

119119
{{/*

helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ exporters:
305305
{{- include "splunk-otel-collector.splunkPlatformMetricsExporter" . | nindent 2 }}
306306
{{- end }}
307307

308-
{{- if and (eq (include "splunk-otel-collector.platformLogsEnabled" .) "true") (eq (include "splunk-otel-collector.objectsOrEventsEnabled" .) "true") }}
308+
{{- if and (eq (include "splunk-otel-collector.platformLogsViaOtlpEnabled" .) "true") (eq (include "splunk-otel-collector.objectsOrEventsEnabled" .) "true") }}
309+
{{- include "splunk-otel-collector.otlpPlatformLogsExporter" . | nindent 2 }}
310+
{{- else if and (eq (include "splunk-otel-collector.platformLogsEnabled" .) "true") (eq (include "splunk-otel-collector.objectsOrEventsEnabled" .) "true") }}
309311
{{- include "splunk-otel-collector.splunkPlatformLogsExporter" . | nindent 2 }}
310312
{{- if .Values.clusterReceiver.eventsEnabled }}
311313
sourcetype: kube:events
@@ -439,7 +441,9 @@ service:
439441
{{- end }}
440442
- transform/k8sevents
441443
exporters:
442-
{{- if (eq (include "splunk-otel-collector.platformLogsEnabled" .) "true") }}
444+
{{- if (eq (include "splunk-otel-collector.platformLogsViaOtlpEnabled" .) "true") }}
445+
- {{ if eq .Values.splunkPlatform.otlpIngest.protocol "http" }}otlp_http{{- else }}otlp{{- end }}/platform_logs
446+
{{- else if (eq (include "splunk-otel-collector.platformLogsEnabled" .) "true") }}
443447
- splunk_hec/platform_logs
444448
{{- end }}
445449
{{- if eq (include "splunk-otel-collector.splunkO11yEventsEndpointEnabled" .) "true" }}
@@ -464,7 +468,9 @@ service:
464468
- resource/add_environment
465469
{{- end }}
466470
exporters:
467-
{{- if (eq (include "splunk-otel-collector.platformLogsEnabled" .) "true") }}
471+
{{- if (eq (include "splunk-otel-collector.platformLogsViaOtlpEnabled" .) "true") }}
472+
- {{ if eq .Values.splunkPlatform.otlpIngest.protocol "http" }}otlp_http{{- else }}otlp{{- end }}/platform_logs
473+
{{- else if (eq (include "splunk-otel-collector.platformLogsEnabled" .) "true") }}
468474
- splunk_hec/platform_logs
469475
{{- end }}
470476
{{- if (eq (include "splunk-otel-collector.splunkO11yEventsEndpointEnabled" .) "true") }}

helm-charts/splunk-otel-collector/values.schema.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,29 @@
15741574
}
15751575
}
15761576
}
1577+
},
1578+
{
1579+
"properties": {
1580+
"splunkPlatform": {
1581+
"type": "object",
1582+
"required": [
1583+
"otlpIngest"
1584+
],
1585+
"properties": {
1586+
"otlpIngest": {
1587+
"type": "object",
1588+
"required": [
1589+
"enabled"
1590+
],
1591+
"properties": {
1592+
"enabled": {
1593+
"const": true
1594+
}
1595+
}
1596+
}
1597+
}
1598+
}
1599+
}
15771600
}
15781601
]
15791602
},
@@ -1669,6 +1692,50 @@
16691692
}
16701693
}
16711694
},
1695+
{
1696+
"if": {
1697+
"$comment": "if OTLP ingest for platform logs is enabled, require OTLP endpoint",
1698+
"properties": {
1699+
"splunkPlatform": {
1700+
"type": "object",
1701+
"required": [
1702+
"otlpIngest"
1703+
],
1704+
"properties": {
1705+
"logsEnabled": {
1706+
"const": true
1707+
},
1708+
"otlpIngest": {
1709+
"type": "object",
1710+
"required": [
1711+
"enabled"
1712+
],
1713+
"properties": {
1714+
"enabled": {
1715+
"const": true
1716+
}
1717+
}
1718+
}
1719+
}
1720+
}
1721+
}
1722+
},
1723+
"then": {
1724+
"properties": {
1725+
"splunkPlatform": {
1726+
"properties": {
1727+
"otlpIngest": {
1728+
"properties": {
1729+
"endpoint": {
1730+
"minLength": 1
1731+
}
1732+
}
1733+
}
1734+
}
1735+
}
1736+
}
1737+
}
1738+
},
16721739
{
16731740
"if": {
16741741
"$comment": "if splunkPlatform.metricsEnabled is true and splunkPlatform.endpoint is provided",

0 commit comments

Comments
 (0)