|
| 1 | +--- |
| 2 | +title: Deploy Gateway |
| 3 | +linkTitle: 2.1 Deploy Gateway |
| 4 | +weight: 1 |
| 5 | +time: 5 minutes |
| 6 | +--- |
| 7 | + |
| 8 | +## Gateway |
| 9 | + |
| 10 | +First we will deploy the **OTel Gateway**. The workshop instructor will deploy the gateway, but we will walk through the steps here if you wish to try this yourself on a second instance. |
| 11 | + |
| 12 | +The steps: |
| 13 | +* Click the **Data Management** icon in the toolbar |
| 14 | +* Click the **+ Add integration** button |
| 15 | +* Click **Deploy the Splunk OpenTelemetry Collector** button |
| 16 | +* Click **Next** |
| 17 | +* Select **Linux** |
| 18 | +* Change mode to **Data forwarding (gateway)** |
| 19 | +* Set the environment to **prod** |
| 20 | +* Choose the access token for this workshop |
| 21 | +* Click **Next** |
| 22 | +* Copy the installer script and run it in the provided linux environment. |
| 23 | + |
| 24 | +Once our gateway is started we will notice... **Nothing**. The gateway, by default, doesn't send any data. It can be configured to send data, but it doesn't by default. |
| 25 | + |
| 26 | +We can review the config file with: |
| 27 | +``` bash |
| 28 | +sudo cat /etc/otel/collector/splunk-otel-collector.conf |
| 29 | +``` |
| 30 | + |
| 31 | +And see that the config being used is `gateway_config.yaml`. |
| 32 | + |
| 33 | +{{% notice title="Tip" style="primary" icon="lightbulb" %}} |
| 34 | +Diagrams created with [OTelBin.io](https://www.otelbin.io). Click on them to see them in detail. |
| 35 | +{{% /notice %}} |
| 36 | + |
| 37 | +|Diagram|What it Tells Us| |
| 38 | +|-|-| |
| 39 | +||**Metrics**:<br>The gateway will receive metrics over **otlp** or **signalfx** protocols, and then send these metrics to **Splunk Observability Cloud** with the **signalfx** protocol.<br><br>There is also a pipeline for **prometheus metrics** to be sent to Splunk. That pipeline is labeled **internal** and is meant to be for the collector. (In other words if we want to receive prometheus directly we should add it to the main pipeline.)| |
| 40 | +||**Traces**:<br>The gateway will receive traces over **jaeger**, **otlp**, **sapm**, or **zipkin** and then send these traces to **Splunk Observability Cloud** with the **sapm** protocol.| |
| 41 | +||**Logs**:<br>The gateway will receive logs over **otlp** and then send these logs to 2 places: **Splunk Enterprise (Cloud)** (for logs) and **Splunk Observability Cloud** (for profiling data).<br><br>There is also a pipeline labeled **signalfx** that is sending **signalfx** to **Splunk Observability Cloud**; these are events that can be used to add events to charts, as well as the process list.| |
| 42 | + |
| 43 | +We're not going to see any host metrics, and we aren't send any other data through the gateway yet. But we do have the **internal** metrics being sent in. |
| 44 | + |
| 45 | +You can find it by creating a new chart and adding a metric: |
| 46 | +* Click the **+** in the top-right |
| 47 | +* Click **Chart** |
| 48 | +* For the signal of Plot A, type `otelcol_process_uptime` |
| 49 | +* Add a filter with the + to the right, and type: `host.id:<name of instance>` |
| 50 | + |
| 51 | +You should get a chart like the following: |
| 52 | + |
| 53 | + |
| 54 | +You can look at the **Metric Finder** to find other internal metrics to explore. |
| 55 | + |
| 56 | +## Add Metadata |
| 57 | + |
| 58 | +Before we deploy a collector (agent) let's add some metada onto metrics and traces with the gateway. That's how we will know data is passing through it. |
| 59 | + |
| 60 | +The [attributes processor](https://docs.splunk.com/observability/en/gdi/opentelemetry/components/attributes-processor.html) let's us add some metadata. |
| 61 | + |
| 62 | +``` bash |
| 63 | +sudo vi /etc/otel/collector/agent_config.yaml |
| 64 | +``` |
| 65 | + |
| 66 | +Here's what we want to add to the processors section: |
| 67 | + |
| 68 | +``` yaml |
| 69 | +processors: |
| 70 | + attributes/gateway_config: |
| 71 | + actions: |
| 72 | + - key: gateway |
| 73 | + value: oac |
| 74 | + action: insert |
| 75 | +``` |
| 76 | +
|
| 77 | +And then to the pipelines (adding `attributes/gateway_config` to each): |
| 78 | +``` yaml |
| 79 | +service: |
| 80 | + pipelines: |
| 81 | + traces: |
| 82 | + receivers: [jaeger, otlp, smartagent/signalfx-forwarder, zipkin] |
| 83 | + processors: |
| 84 | + - memory_limiter |
| 85 | + - batch |
| 86 | + - resourcedetection |
| 87 | + - attributes/gateway_config |
| 88 | + #- resource/add_environment |
| 89 | + exporters: [sapm, signalfx] |
| 90 | + # Use instead when sending to gateway |
| 91 | + #exporters: [otlp, signalfx] |
| 92 | + metrics: |
| 93 | + receivers: [hostmetrics, otlp, signalfx, smartagent/signalfx-forwarder] |
| 94 | + processors: [memory_limiter, batch, resourcedetection, attributes/gateway_config] |
| 95 | + exporters: [signalfx] |
| 96 | + # Use instead when sending to gateway |
| 97 | + #exporters: [otlp] |
| 98 | +``` |
| 99 | + |
| 100 | +And finally we need to restart the gateway: |
| 101 | +``` bash |
| 102 | +sudo systemctl restart splunk-otel-collector.service |
| 103 | +``` |
| 104 | + |
| 105 | +We can make sure it is still running fine by checking the status: |
| 106 | +``` bash |
| 107 | +sudo systemctl status splunk-otel-collector.service |
| 108 | +``` |
| 109 | + |
| 110 | +## Next |
| 111 | + |
| 112 | +Next, let's deploy a collector and then configure it to this gateway. |
0 commit comments