You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/send-data/opentelemetry-collector/use-case-prometheus.md
+86-85Lines changed: 86 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ If you're collecting metrics using Prometheus, a popular tool for monitoring app
11
11
12
12
With the Sumo Logic OpenTelemetry Collector, you can import your Prometheus-formatted metrics into Sumo Logic and create a custom dashboard for them. This diagram shows the flow of metrics data from a custom application which has been instrumented to provide Prometheus-formatted metrics.
Metrics are scraped by our OpenTelemetry Collector using the `prometheus` receiver, then sent to Sumo Logic’s OLTP-compatible ingest API via the `sumologic` exporter. The data is stored and indexed by Sumo Logic, where it can then be queried and displayed in a custom dashboard within Sumo Logic.
17
17
@@ -32,78 +32,78 @@ To get started, we need to have some Prometheus-formatted metrics to work with.
32
32
-it ibmcom/prometheus-metrics-server-simulator
33
33
```
34
34
1. Confirm that the simulator starts with the default configuration. You can modify that configuration to produce whatever custom metrics you want to mock.
35
-
```bash title="cat examples/config.yaml"
36
-
counters:
37
-
- prefix: mock_metric_counter
38
-
number: 3
39
-
labels:
40
-
- name: app
41
-
valueset:
42
-
- "prometheus-mock-metrics-server"
43
-
- name: client_addr
44
-
valueset:
45
-
- "client1"
46
-
- "client2"
47
-
- "client3"
48
-
- prefix: mock_metric_request_total
49
-
labels:
50
-
- name: app
51
-
valueset:
52
-
- "prometheus-mock-metrics-server"
53
-
valuemode: http
54
-
55
-
gauges:
56
-
- prefix: mock_metric_gauges
57
-
number: 4
58
-
range:
59
-
upper: 1000
60
-
lower: 2
61
-
labels:
62
-
- name: app
63
-
valueset:
64
-
- "prometheus-mock-metrics-server"
65
-
- name: client_addr
66
-
valueset:
67
-
- "client1"
68
-
- "client2"
69
-
- "client3"%
70
-
```
35
+
```bash title="cat examples/config.yaml"
36
+
counters:
37
+
- prefix: mock_metric_counter
38
+
number: 3
39
+
labels:
40
+
- name: app
41
+
valueset:
42
+
- "prometheus-mock-metrics-server"
43
+
- name: client_addr
44
+
valueset:
45
+
- "client1"
46
+
- "client2"
47
+
- "client3"
48
+
- prefix: mock_metric_request_total
49
+
labels:
50
+
- name: app
51
+
valueset:
52
+
- "prometheus-mock-metrics-server"
53
+
valuemode: http
54
+
55
+
gauges:
56
+
- prefix: mock_metric_gauges
57
+
number: 4
58
+
range:
59
+
upper: 1000
60
+
lower: 2
61
+
labels:
62
+
- name: app
63
+
valueset:
64
+
- "prometheus-mock-metrics-server"
65
+
- name: client_addr
66
+
valueset:
67
+
- "client1"
68
+
- "client2"
69
+
- "client3"%
70
+
```
71
71
1. To verify that it's up and running, curl the metrics endpoint to see the Prometheus-formatted metrics it is generating. You should see something like this:
## Step 2: Add Prometheus receiver to your OpenTelemetry Collector configuration
101
101
102
102
Next, we'll configure the [Sumo Logic OpenTelemetry Collector](https://github.com/SumoLogic/sumologic-otel-collector) to receive metrics from the Prometheus Metrics Server Simulator, and then forward them to Sumo Logic.
103
103
104
-
1.[Install the Sumo Logic OpenTelemetry Collector](/docs/send-data/opentelemetry-collector/).
105
-
2. Create a new configuration file for the OpenTelemetry Collector with the following content:
106
-
```yml title="/etc/otelcol-sumo/conf.d/prom.yaml"
104
+
1. Install the [Sumo Logic OpenTelemetry Collector](/docs/send-data/opentelemetry-collector/).
105
+
2. Create a new configuration file for the OpenTelemetry Collector called **/etc/otelcol-sumo/conf.d/prom.yaml** and paste in the following snippet:
* In the above configuration, we define a `prometheus` receiver that scrapes metrics from the Prometheus Metrics Server Simulator running on `localhost:8080`. We then define a metrics pipeline that uses the `prometheus` receiver to scrape the metrics and send them to Sumo Logic via the `sumologic` exporter.
121
+
In this configuration, we:
122
+
- Define a `prometheus` receiver that scrapes metrics from the Prometheus Metrics Server Simulator running on `localhost:8080`.
123
+
- Define a metrics pipeline that uses the `prometheus` receiver to scrape the metrics.
124
+
- Send the metrics to Sumo Logic via the `sumologic` exporter.
122
125
3. Save the configuration file as `/etc/otelcol-sumo/conf.d/prom.yaml`.
123
-
4. Start the OpenTelemetry Collector with the following command.
126
+
4. Start the OpenTelemetry Collector with the following command:
124
127
```bash
125
128
sudo otelcol-sumo \
126
129
--config=/etc/otelcol-sumo/sumologic.yaml \
127
130
--config "glob:/etc/otelcol-sumo/conf.d/*.yaml"
128
131
```
129
132
130
-
This will start the collector with the configuration you defined, and begin receiving and exporting metrics to Sumo Logic.
133
+
This will start the collector with the configuration you defined, and you'll begin receiving and exporting metrics to Sumo Logic.
131
134
132
135
133
136
## Step 3: Create a New Dashboard in Sumo Logic
@@ -136,21 +139,19 @@ Finally, we will create a new dashboard in Sumo Logic to visualize the custom Pr
136
139
137
140
To create a new dashboard:
138
141
139
-
1. Go to the Sumo Logic **Home** tab, click **+ New**, then select **Dashboard (New)** from the dropdown list.<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/dashboard-new-new.png')} alt="dashboard-new-new.png" width="500"/>
140
-
1. Click the name of the dashboard and write in a unique title. In this case, we'll do **Custom Metrics Dashboard**.<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/custom-dashboard.png')} alt="custom-dashboard.png" width="350"/>
141
-
1. Click the **Time Series** button to create a time series chart panel.<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/time-series.png')} alt="time-series.png" width="350"/>
142
-
1. Select the icon next to the query box to choose a **Metrics** query.<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/custom-metrics.png')} alt="custom-metrics.png" width="400"/>
143
-
1. Select **mock_metric_counter_0** from the drop down (of course, this could be any metric. This is just an example).<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/mock-counter.png')} alt="mock-counter.png" width="600" />
144
-
1. From filters, choose the **client_addr** dimension. This will let us only show the metrics for specific client(s).<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/client-addr.png')} alt="client-addr.png" width="600" />
145
-
1. Choose the `=()` *In* operator. This will let us specify a list of clients we want to include on the chart.<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/client-addr-0.png')} alt="client-addr-0.png" width="500"/>
146
-
1. Select the desired clients. In this case, there’s only a single client, **client3**.<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/client3.png')} alt="client3.png" width="400" />
147
-
1. Click the search button (magifying glass) to execute the search and see example output.<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/client3-search.png')} alt="client3-search.png" />
148
-
1. You should see something like this below. If it looks right, click the **Add to Dashboard** button.<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/add-to-dash.png')} alt="add-to-dash.png" />
149
-
1. Now we have a new dashboard in our Library called **Custom Metrics Dashboard** with the time-series chart showing just the clients we want to observe.<br/><img src={useBaseUrl('img/dashboards-new/create-dashboard-new/custom-dash-final.png')} alt="custom-dash-final.png" />
150
-
142
+
1. [**Classic UI**](/docs/get-started/sumo-logic-ui/). Go to the Sumo Logic **Home** tab and select **Dashboard**. [**New UI**](/docs/get-started/sumo-logic-ui-new/). In the main Sumo Logic menu, select **Dashboards > New Dashboard**. You can also click the **Go To...** menu at the top of the screen and select **New Dashboard**.
143
+
1. Click the name of the dashboard and write in a unique title like **Custom Metrics Dashboard**.<br/><img src={useBaseUrl('img/dashboards/create-dashboard/custom-dashboard.png')} alt="custom-dashboard.png" width="350"/>
144
+
1. Click the **Time Series** button to create a time series chart panel.<br/><img src={useBaseUrl('img/dashboards/create-dashboard/time-series.png')} alt="time-series.png" width="350"/>
145
+
1. Select the icon next to the query box to choose a **Metrics** query.<br/><img src={useBaseUrl('img/dashboards/create-dashboard/custom-metrics.png')} alt="custom-metrics.png" width="300"/>
146
+
1. Select **mock_metric_counter_0** from the drop down (of course, this could be any metric. This is just an example).<br/><img src={useBaseUrl('img/dashboards/create-dashboard/mock-counter.png')} alt="mock-counter.png" width="500" />
147
+
1. From filters, choose the **client_addr** dimension. This will let us only show the metrics for specific client(s).<br/><img src={useBaseUrl('img/dashboards/create-dashboard/client-addr.png')} alt="client-addr.png" width="400" />
148
+
1. Choose the `=() In` operator. This will let us specify a list of clients we want to include on the chart.<br/><img src={useBaseUrl('img/dashboards/create-dashboard/client-addr-0.png')} alt="client-addr-0.png" width="400"/>
149
+
1. Select the desired clients. In this case, there’s only a single client, **client3**.<br/><img src={useBaseUrl('img/dashboards/create-dashboard/client3.png')} alt="client3.png" width="400" />
150
+
1. Click the search button (magnifying glass) to execute the search and see example output.<br/><img src={useBaseUrl('img/dashboards/create-dashboard/client3-search.png')} alt="client3-search.png" />
151
+
1. You should see something like this below.<br/><img src={useBaseUrl('img/dashboards/create-dashboard/add-to-dash.png')} alt="add-to-dash.png" /><br/>If it looks right, click **Add to Dashboard**.
152
+
1. Now we have a new dashboard in our Library called **Custom Metrics Dashboard** with the time-series chart showing just the clients we want to observe.<br/><img src={useBaseUrl('img/dashboards/create-dashboard/custom-dash-final.png')} alt="custom-dash-final.png" width="500"/>
151
153
152
-
## Step 4: Set up an alert
153
154
154
-
Now we set up an alert so that we get email when a particular metric (e.g., room temperature) exceeds a threshold and stays above that value for (2 cycles or 10 minutes, not sure which is doable).
155
+
## Step 4: Set up alerts
155
156
156
-
Steps here...
157
+
Next, [set up a monitor](/docs/alerts/monitors/create-monitor) so that you get alert emails when a particular metric (for example, room temperature) exceeds a threshold and stays above that value for (2 cycles or 10 minutes, not sure which is doable).
0 commit comments