|
| 1 | +--- |
| 2 | + |
| 3 | +title: Deploy the Splunk OpenTelemetry Collector |
| 4 | +linkTitle: 1. Deploy OpenTelemetry Collector |
| 5 | +weight: 1.1 |
| 6 | +draft: false |
| 7 | +--- |
| 8 | + |
| 9 | +To get Observability signals (**metrics, traces** and **logs**) into **Splunk Observability Cloud** the Splunk OpenTelemetry Collector needs to be deployed into the Kubernetes cluster. |
| 10 | + |
| 11 | +For this workshop, we will be using the Splunk OpenTelemetry Collector Helm Chart. First we need to add the Helm chart repository to Helm and update to ensure the latest version: |
| 12 | + |
| 13 | +{{< tabs >}} |
| 14 | +{{% tab title="Install Helm Chart" %}} |
| 15 | + |
| 16 | +``` bash |
| 17 | +helm repo add splunk-otel-collector-chart https://signalfx.github.io/splunk-otel-collector-chart && helm repo update |
| 18 | +``` |
| 19 | + |
| 20 | +{{% /tab %}} |
| 21 | +{{% tab title="Output" %}} |
| 22 | + |
| 23 | +```text |
| 24 | +Using ACCESS_TOKEN={REDACTED} |
| 25 | +Using REALM=eu0 |
| 26 | +"splunk-otel-collector-chart" has been added to your repositories |
| 27 | +Using ACCESS_TOKEN={REDACTED} |
| 28 | +Using REALM=eu0 |
| 29 | +Hang tight while we grab the latest from your chart repositories... |
| 30 | +...Successfully got an update from the "splunk-otel-collector-chart" chart repository |
| 31 | +Update Complete. ⎈Happy Helming!⎈ |
| 32 | +``` |
| 33 | + |
| 34 | +{{% /tab %}} |
| 35 | +{{< /tabs >}} |
| 36 | + |
| 37 | +**Splunk Observability Cloud** offers wizards in the UI to walk you through the setup of the OpenTelemetry Collector on Kubernetes, but in the interest of time, we will use the Helm install command below. Additional parameters are set to enable the operator and automatic discovery and configuration. |
| 38 | + |
| 39 | +* `--set="operator.enabled=true"` - this will install the Opentelemetry operator that will be used to handle automatic discovery and configuration. |
| 40 | +* `--set="certmanager.enabled=true"` - this will install the required certificate manager for the operator. |
| 41 | +* `--set="splunkObservability.profilingEnabled=true"` - this enables Code Profiling via the operator. |
| 42 | + |
| 43 | +To install the collector run the following command, do **NOT** edit this: |
| 44 | + |
| 45 | +{{< tabs >}} |
| 46 | +{{% tab title="Helm Install" %}} |
| 47 | + |
| 48 | +```bash |
| 49 | +helm install splunk-otel-collector --version {{< otel-version >}} \ |
| 50 | +--set="operator.enabled=true", \ |
| 51 | +--set="certmanager.enabled=true", \ |
| 52 | +--set="splunkObservability.realm=$REALM" \ |
| 53 | +--set="splunkObservability.accessToken=$ACCESS_TOKEN" \ |
| 54 | +--set="clusterName=$INSTANCE-k3s-cluster" \ |
| 55 | +--set="splunkObservability.profilingEnabled=true" \ |
| 56 | +--set="agent.service.enabled=true" \ |
| 57 | +--set="environment=$INSTANCE-workshop" \ |
| 58 | +--set="splunkPlatform.endpoint=$HEC_URL" \ |
| 59 | +--set="splunkPlatform.token=$HEC_TOKEN" \ |
| 60 | +--set="splunkPlatform.index=splunk4rookies-workshop" \ |
| 61 | +splunk-otel-collector-chart/splunk-otel-collector \ |
| 62 | +-f ~/workshop/k3s/otel-collector.yaml |
| 63 | + |
| 64 | +{{% /tab %}} |
| 65 | +{{% tab title="Output" %}} |
| 66 | + |
| 67 | +``` plaintext |
| 68 | +LAST DEPLOYED: Fri Apr 19 09:39:54 2024 |
| 69 | +NAMESPACE: default |
| 70 | +STATUS: deployed |
| 71 | +REVISION: 1 |
| 72 | +NOTES: |
| 73 | +Splunk OpenTelemetry Collector is installed and configured to send data to Splunk Platform endpoint "https://http-inputs-o11y-workshop-eu0.splunkcloud.com:443/services/collector/event". |
| 74 | +
|
| 75 | +Splunk OpenTelemetry Collector is installed and configured to send data to Splunk Observability realm eu0. |
| 76 | +
|
| 77 | +[INFO] You've enabled the operator's auto-instrumentation feature (operator.enabled=true)! The operator can automatically instrument Kubernetes hosted applications. |
| 78 | + - Status: Instrumentation language maturity varies. See `operator.instrumentation.spec` and documentation for utilized instrumentation details. |
| 79 | + - Splunk Support: We offer full support for Splunk distributions and best-effort support for native OpenTelemetry distributions of auto-instrumentation libraries. |
| 80 | +``` |
| 81 | + |
| 82 | +{{% /tab %}} |
| 83 | +{{< /tabs >}} |
| 84 | + |
| 85 | +Ensure the Pods are reported as **Running** before continuing (this typically takes around 30 seconds). |
| 86 | + |
| 87 | +{{< tabs >}} |
| 88 | +{{% tab title="kubectl get pods" %}} |
| 89 | + |
| 90 | +``` bash |
| 91 | +kubectl get pods | grep splunk-otel |
| 92 | +``` |
| 93 | + |
| 94 | +{{% /tab %}} |
| 95 | +{{% tab title="Output" %}} |
| 96 | + |
| 97 | +``` text |
| 98 | +splunk-otel-collector-certmanager-cainjector-5c5dc4ff8f-95z49 1/1 Running 0 10m |
| 99 | +splunk-otel-collector-certmanager-6d95596898-vjxss 1/1 Running 0 10m |
| 100 | +splunk-otel-collector-certmanager-webhook-69f4ff754c-nghxz 1/1 Running 0 10m |
| 101 | +splunk-otel-collector-k8s-cluster-receiver-6bd5567d95-5f8cj 1/1 Running 0 10m |
| 102 | +splunk-otel-collector-agent-tspd2 1/1 Running 0 10m |
| 103 | +splunk-otel-collector-operator-69d476cb7-j7zwd 2/2 Running 0 10m |
| 104 | +``` |
| 105 | + |
| 106 | +{{% /tab %}} |
| 107 | +{{< /tabs >}} |
| 108 | + |
| 109 | +Ensure there are no errors reported by the Splunk OpenTelemetry Collector (press `ctrl + c` to exit) or use the installed **awesome** `k9s` terminal UI for bonus points! |
| 110 | + |
| 111 | +{{< tabs >}} |
| 112 | +{{% tab title="kubectl logs" %}} |
| 113 | + |
| 114 | +``` bash |
| 115 | +kubectl logs -l app=splunk-otel-collector -f --container otel-collector |
| 116 | +``` |
| 117 | + |
| 118 | +{{% /tab %}} |
| 119 | +{{% tab title="Output" %}} |
| 120 | + |
| 121 | +```text |
| 122 | +2021-03-21T16:11:10.900Z INFO service/service.go:364 Starting receivers... |
| 123 | +2021-03-21T16:11:10.900Z INFO builder/receivers_builder.go:70 Receiver is starting... {"component_kind": "receiver", "component_type": "prometheus", "component_name": "prometheus"} |
| 124 | +2021-03-21T16:11:11.009Z INFO builder/receivers_builder.go:75 Receiver started. {"component_kind": "receiver", "component_type": "prometheus", "component_name": "prometheus"} |
| 125 | +2021-03-21T16:11:11.009Z INFO builder/receivers_builder.go:70 Receiver is starting... {"component_kind": "receiver", "component_type": "k8s_cluster", "component_name": "k8s_cluster"} |
| 126 | +2021-03-21T16:11:11.009Z INFO [email protected]/watcher.go:195 Configured Kubernetes MetadataExporter {"component_kind": "receiver", "component_type": "k8s_cluster", "component_name": "k8s_cluster", "exporter_name": "signalfx"} |
| 127 | +2021-03-21T16:11:11.009Z INFO builder/receivers_builder.go:75 Receiver started. {"component_kind": "receiver", "component_type": "k8s_cluster", "component_name": "k8s_cluster"} |
| 128 | +2021-03-21T16:11:11.009Z INFO healthcheck/handler.go:128 Health Check state change {"component_kind": "extension", "component_type": "health_check", "component_name": "health_check", "status": "ready"} |
| 129 | +2021-03-21T16:11:11.009Z INFO service/service.go:267 Everything is ready. Begin running and processing data. |
| 130 | +2021-03-21T16:11:11.009Z INFO [email protected]/receiver.go:59 Starting shared informers and wait for initial cache sync. {"component_kind": "receiver", "component_type": "k8s_cluster", "component_name": "k8s_cluster"} |
| 131 | +2021-03-21T16:11:11.281Z INFO [email protected]/receiver.go:75 Completed syncing shared informer caches. {"component_kind": "receiver", "component_type": "k8s_cluster", "component_name": "k8s_cluster"} |
| 132 | +``` |
| 133 | + |
| 134 | +{{% /tab %}} |
| 135 | +{{< /tabs >}} |
| 136 | + |
| 137 | +>[!INFO] Deleting a failed installation |
| 138 | +>If you make an error installing the OpenTelemetry Collector you can start over by deleting the |
| 139 | +>installation with the following command: |
| 140 | +> |
| 141 | +>``` bash |
| 142 | +>helm delete splunk-otel-collector |
| 143 | +>``` |
0 commit comments