Skip to content

Commit

Permalink
Change interface to be able to send data to Splunk Platform
Browse files Browse the repository at this point in the history
This change introduces ability to send data to Splunk Enterprise/Cloud and to Splunk Observability. Most of the documentation and configurations are updated but the change set as kept to minimal required changed.
  • Loading branch information
dmitryax committed Oct 6, 2021
1 parent dbae05b commit 4e7f164
Show file tree
Hide file tree
Showing 54 changed files with 718 additions and 239 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Changed

- Change configuration interface to be able to send data to Splunk
Enterprise/Cloud and to Splunk Observability (#209)
- Improve multiline logs configuration for native logs collection (#208)

## [0.35.3] - 2021-09-29
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ render:
helm template \
--namespace default \
--values rendered/values.yaml \
--set metricsEnabled=false,tracesEnabled=false,logsEnabled=false,$${i}Enabled=true \
--set splunkObservability.metricsEnabled=false,splunkObservability.tracesEnabled=false,splunkObservability.logsEnabled=false,splunkObservability.$${i}Enabled=true \
--output-dir "$$dir" \
default helm-charts/splunk-otel-collector; \
mv "$$dir"/splunk-otel-collector/templates/* "$$dir"; \
Expand Down
104 changes: 77 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ The Splunk OpenTelemetry Connector for Kubernetes is a
of OpenTelemetry Collector](https://github.com/signalfx/splunk-otel-collector).
This chart creates a Kubernetes DaemonSet along with other Kubernetes objects
in a Kubernetes cluster and provides a unified way to receive, process and
export metric, trace, and log data for [Splunk Observability
Cloud](https://www.observability.splunk.com/).
export metric, trace, and log data for:

- [Splunk Enterprise](https://www.splunk.com/en_us/software/splunk-enterprise.html)
- [Splunk Cloud Platform](https://www.splunk.com/en_us/software/splunk-cloud-platform.html)
- [Splunk Observability Cloud](https://www.observability.splunk.com/)

**Installations that use this distribution can receive direct help from
Splunk's support teams.** Customers are free to use the core OpenTelemetry OSS
Expand Down Expand Up @@ -99,27 +102,45 @@ require additional configurations applied to

### Prerequisites

The following components required to use the helm chart:
The following prerequisites are required to use the helm chart:

- [Helm 3](https://helm.sh/docs/intro/install/) (Helm 2 is not supported)
- [Kubernetes cluster](https://kubernetes.io/)
- [Splunk Access Token](https://docs.splunk.com/Observability/admin/authentication-tokens/org-tokens.html#admin-org-tokens)
- [Splunk Realm](https://dev.splunk.com/observability/docs/realms_in_endpoints/)

- To send data to [Splunk Enterprise/Cloud](https://docs.splunk.com/Documentation/Splunk/8.2.2/Data/UsetheHTTPEventCollector)
- HEC Token
- HEC Endpoint

- To send data to [Splunk Observability Cloud](https://docs.splunk.com/Observability/gdi/opentelemetry/install-k8s.html)
- [Splunk Access Token](https://docs.splunk.com/Observability/admin/authentication-tokens/org-tokens.html#admin-org-tokens)
- [Splunk Realm](https://dev.splunk.com/observability/docs/realms_in_endpoints/)

### How to install

To install splunk-otel-collector in k8s cluster at least three parameters must be provided:
To install splunk-otel-collector in k8s cluster at one of the configuration groups
`spunkPlatform` or `splunkObservability` has to be fully configured.

For Splunk Enterprise/Cloud the following parameters are required:

- `spunkPlatform.endpoint`: URL to a Splunk instance, e.g.
"http://localhost:8088/services/collector"
- `spunkPlatform.token`: Splunk HTTP Event Collector token

- `splunkRealm` (default `us0`): Splunk realm to send telemetry data to.
- `splunkAccessToken`: Your Splunk org access token.
- `clusterName`: arbitrary value that will identify your Kubernetes cluster in Splunk.
For Splunk Observability Cloud the following parameters are required:

To deploy the chart run the following commands replacing the parameters above
with their appropriate values.
- `splunkObservability.splunkRealm` (default `us0`): Splunk realm to send
telemetry data to.
- `splunkObservability.splunkAccessToken`: Your Splunk Observability org access
token.
- `clusterName`: arbitrary value that will identify your Kubernetes cluster in
Splunk Observability Cloud.

To deploy the chart to send data to Splunk Observability Cloud run the following
commands replacing the parameters above with their appropriate values.

```bash
$ helm repo add splunk-otel-collector-chart https://signalfx.github.io/splunk-otel-collector-chart
$ helm install my-splunk-otel-collector --set="splunkRealm=us0,splunkAccessToken=xxxxxx,clusterName=my-cluster" splunk-otel-collector-chart/splunk-otel-collector
$ helm install my-splunk-otel-collector --set="splunkObservability.splunkRealm=us0,splunkObservability.splunkAccessToken=xxxxxx,clusterName=my-cluster" splunk-otel-collector-chart/splunk-otel-collector
```

Instead of setting helm values as arguments a yaml file can be provided:
Expand Down Expand Up @@ -148,12 +169,23 @@ explanation. Read through it to understand how to configure this chart.

Also check [examples of chart configuration](./examples/README.md). This also includes a guide to deploy for the k8s cluster with the windows worker node.

At the minimum you need to configure the following values.
At the minimum you need to configure the following values to send data to Splunk
Enterprise/Cloud.

```yaml
splunkPlatform:
token: xxxxxx
endpoint: http://localhost:8088/services/collector
```
At the minimum you need to configure the following values to send data to Splunk
Observability Cloud.
```yaml
splunkObservability:
accessToken: xxxxxx
realm: us0
clusterName: my-k8s-cluster
splunkAccessToken: xxxxxx
splunkRealm: us0
```
### Cloud provider
Expand Down Expand Up @@ -192,19 +224,21 @@ environment: production

### Disable particular types of telemetry

By default all telemetry data (metrics, traces and logs) is collected from the Kubernetes cluster.
It's possible to disable any kind of telemetry with the following parameters:

- `metricsEnabled`: `false`
- `tracesEnabled`: `false`
- `logsEnabled`: `false`

For example, to install the connector only for logs:
By default all telemetry data (metrics, traces and logs) is collected from the
Kubernetes cluster and sent to one of (or both) configured destinations. It's
possible to disable any kind of telemetry for a specific destination. For
example, the following configuration will send logs to Splunk Platform and
metrics and traces to Splunk Observability assuming that both destinations are
configured properly.

```bash
$ helm install my-splunk-otel-collector \
--set="splunkRealm=us0,splunkAccessToken=xxxxxx,clusterName=my-cluster,metricsEnabled=false,tracesEnabled=false" \
splunk-otel-collector-chart/splunk-otel-collector
```yaml
splunkObservability:
metricsEnabled: true
tracesEnabled: true
logsEnabled: false
splunkPlatform:
metricsEnabled: false
logsEnabled: true
```

## Logs collection
Expand Down Expand Up @@ -266,6 +300,22 @@ The [rendered directory](rendered) contains pre-rendered Kubernetes resource man

## Upgrade guidelines

### 0.35.3 to 0.36.0

[#208 Configuration interface changed to support both Splunk Enterprise/Cloud and Splunk Observability destinations](https://github.com/signalfx/splunk-otel-collector-chart/pull/208)

The following parameters required to send data to Splunk Observability are now
deprecated and moved under `splunkObservability` group. They need to be updated
in your custom values.yaml files before backward compatibility is discontinued.

- `splunkRealm` changed to `splunkObservability.realm`
- `splunkAccessToken` changed to `splunkObservability.accessToken`
- `ingestUrl` changed to `splunkObservability.ingestUrl`
- `apiUrl` changed to `splunkObservability.ingestUrl`
- `metricsEnabled` changed to `splunkObservability.metricsEnabled`
- `tracesEnabled` changed to `splunkObservability.tracesEnabled`
- `logsEnabled` changed to `splunkObservability.logsEnabled`

### 0.26.4 to 0.27.0

[#163 Auto-detection of prometheus metrics is disabled by default](https://github.com/signalfx/splunk-otel-collector-chart/pull/163):
Expand Down
16 changes: 14 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@ helm install my-splunk-otel-collector --values my-values.yaml splunk-otel-collec
```

All of the provided examples must also include the required parameters:

```yaml
# Splunk Platform required parameters
splunkPlatform:
token: xxxxxx
endpoint: http://localhost:8088/services/collector
```
or
```yaml
# Splunk Observability required parameters
clusterName: my-cluster
splunkRealm: us0
splunkAccessToken: my-access-token
splunkObservability:
realm: us0
accessToken: my-access-token
```
## Deploy for k8s cluster with windows worker node.
Expand Down
5 changes: 3 additions & 2 deletions examples/add-sampler-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: my-cluster
splunkRealm: us0
splunkAccessToken: my-access-token
splunkObservability:
realm: us0
accessToken: my-access-token

otelAgent:
config:
Expand Down
5 changes: 3 additions & 2 deletions examples/crio-logging-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: my-cluster
splunkRealm: us0
splunkAccessToken: my-access-token
splunkObservability:
realm: us0
accessToken: my-access-token

fluentd:
config:
Expand Down
5 changes: 3 additions & 2 deletions examples/enable-gateway-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: my-cluster
splunkRealm: us0
splunkAccessToken: my-access-token
splunkObservability:
realm: us0
accessToken: my-access-token

otelCollector:
enabled: true
Expand Down
5 changes: 3 additions & 2 deletions examples/gateway-only-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: my-cluster
splunkRealm: us0
splunkAccessToken: my-access-token
splunkObservability:
realm: us0
accessToken: my-access-token

otelCollector:
enabled: true
Expand Down
5 changes: 3 additions & 2 deletions examples/parse-java-stacktrace-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: my-cluster
splunkRealm: us0
splunkAccessToken: my-access-token
splunkObservability:
realm: us0
accessToken: my-access-token

fluentd:
config:
Expand Down
5 changes: 3 additions & 2 deletions examples/use-custom-gateway-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: my-cluster
splunkRealm: us0
splunkAccessToken: my-access-token
splunkObservability:
realm: us0
accessToken: my-access-token

otelAgent:
config:
Expand Down
5 changes: 3 additions & 2 deletions examples/use-proxy-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: my-cluster
splunkRealm: us0
splunkAccessToken: my-access-token
splunkObservability:
realm: us0
accessToken: my-access-token

otelAgent:
extraEnvs:
Expand Down
5 changes: 3 additions & 2 deletions helm-charts/splunk-otel-collector/ci/basic-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: fake-cluster
splunkRealm: fake-realm
splunkAccessToken: fake-token
splunkObservability:
realm: fake-realm
accessToken: fake-token

# Logs collection config for Kind cluster
fluentd:
Expand Down
5 changes: 3 additions & 2 deletions helm-charts/splunk-otel-collector/ci/logs-only-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: fake-cluster
splunkRealm: fake-realm
splunkAccessToken: fake-token
splunkObservability:
realm: fake-realm
accessToken: fake-token

tracesEnabled: false
metricsEnabled: false
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clusterName: fake-cluster
splunkRealm: fake-realm
splunkAccessToken: fake-token
splunkObservability:
realm: fake-realm
accessToken: fake-token

otelAgent:
config:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
clusterName: my-cluster
# Validate backward compatible parameters
splunkRealm: us0
splunkAccessToken: my-access-token

Expand Down
35 changes: 35 additions & 0 deletions helm-charts/splunk-otel-collector/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- if eq (include "splunk-otel-collector.splunkPlatformEnabled" .) "true" }}
Splunk OpenTelemetry Connector 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 Connector 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#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#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#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#0353-to-0360
{{ end }}
{{- if not (empty .Values.metricsEnabled) }}
[WARNING] "metricsEnabled" parameter is deprecated, please use "splunkObservability.metricsEnabled" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart#0353-to-0360
{{ end }}
{{- if not (empty .Values.tracesEnabled) }}
[WARNING] "tracesEnabled" parameter is deprecated, please use "splunkObservability.tracesEnabled" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart#0353-to-0360
{{ end }}
{{- if not (empty .Values.logsEnabled) }}
[WARNING] "logsEnabled" parameter is deprecated, please use "splunkObservability.logsEnabled" instead.
Upgrade guidelines: https://github.com/signalfx/splunk-otel-collector-chart#0353-to-0360
{{ end }}
Loading

0 comments on commit 4e7f164

Please sign in to comment.