Skip to content

Commit 8cf517a

Browse files
committed
updates
1 parent 86fe903 commit 8cf517a

File tree

6 files changed

+86
-85
lines changed

6 files changed

+86
-85
lines changed

docs/send-data/opentelemetry-collector/use-case-prometheus.md

Lines changed: 86 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If you're collecting metrics using Prometheus, a popular tool for monitoring app
1111

1212
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.
1313

14-
<img src={useBaseUrl('img/send-data/opentelemetry-collector/prometheus.png')} alt="prometheus.png" width="550"/>
14+
<img src={useBaseUrl('img/send-data/opentelemetry-collector/prometheus.png')} alt="prometheus.png" width="600"/>
1515

1616
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.
1717

@@ -32,78 +32,78 @@ To get started, we need to have some Prometheus-formatted metrics to work with.
3232
-it ibmcom/prometheus-metrics-server-simulator
3333
```
3434
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+
```
7171
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:
72-
```bash
73-
curl localhost:8080/metrics
74-
# HELP mock_metric_counter_0
75-
# TYPE mock_metric_counter_0 counter
76-
mock_metric_counter_0{app="prometheus-mock-metrics-server",client_addr="client3"} 5448
77-
# HELP mock_metric_counter_1
78-
# TYPE mock_metric_counter_1 counter
79-
mock_metric_counter_1{app="prometheus-mock-metrics-server",client_addr="client2"} 5424
80-
# HELP mock_metric_counter_2
81-
# TYPE mock_metric_counter_2 counter
82-
mock_metric_counter_2{app="prometheus-mock-metrics-server",client_addr="client2"} 5362
83-
# HELP mock_metric_gauges_0
84-
# TYPE mock_metric_gauges_0 gauge
85-
mock_metric_gauges_0{app="prometheus-mock-metrics-server",client_addr="client1"} 71
86-
# HELP mock_metric_gauges_1
87-
# TYPE mock_metric_gauges_1 gauge
88-
mock_metric_gauges_1{app="prometheus-mock-metrics-server",client_addr="client2"} 44
89-
# HELP mock_metric_gauges_2
90-
# TYPE mock_metric_gauges_2 gauge
91-
mock_metric_gauges_2{app="prometheus-mock-metrics-server",client_addr="client3"} 4
92-
# HELP mock_metric_gauges_3
93-
# TYPE mock_metric_gauges_3 gauge
94-
mock_metric_gauges_3{app="prometheus-mock-metrics-server",client_addr="client3"} 41
95-
# HELP mock_metric_request_total
96-
# TYPE mock_metric_request_total counter
97-
mock_metric_request_total{app="prometheus-mock-metrics-server"} 0
98-
```
72+
```bash
73+
curl localhost:8080/metrics
74+
# HELP mock_metric_counter_0
75+
# TYPE mock_metric_counter_0 counter
76+
mock_metric_counter_0{app="prometheus-mock-metrics-server",client_addr="client3"} 5448
77+
# HELP mock_metric_counter_1
78+
# TYPE mock_metric_counter_1 counter
79+
mock_metric_counter_1{app="prometheus-mock-metrics-server",client_addr="client2"} 5424
80+
# HELP mock_metric_counter_2
81+
# TYPE mock_metric_counter_2 counter
82+
mock_metric_counter_2{app="prometheus-mock-metrics-server",client_addr="client2"} 5362
83+
# HELP mock_metric_gauges_0
84+
# TYPE mock_metric_gauges_0 gauge
85+
mock_metric_gauges_0{app="prometheus-mock-metrics-server",client_addr="client1"} 71
86+
# HELP mock_metric_gauges_1
87+
# TYPE mock_metric_gauges_1 gauge
88+
mock_metric_gauges_1{app="prometheus-mock-metrics-server",client_addr="client2"} 44
89+
# HELP mock_metric_gauges_2
90+
# TYPE mock_metric_gauges_2 gauge
91+
mock_metric_gauges_2{app="prometheus-mock-metrics-server",client_addr="client3"} 4
92+
# HELP mock_metric_gauges_3
93+
# TYPE mock_metric_gauges_3 gauge
94+
mock_metric_gauges_3{app="prometheus-mock-metrics-server",client_addr="client3"} 41
95+
# HELP mock_metric_request_total
96+
# TYPE mock_metric_request_total counter
97+
mock_metric_request_total{app="prometheus-mock-metrics-server"} 0
98+
```
9999

100100
## Step 2: Add Prometheus receiver to your OpenTelemetry Collector configuration
101101

102102
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.
103103

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:
106+
```yml
107107
receivers:
108108
prometheus:
109109
config:
@@ -118,16 +118,19 @@ Next, we'll configure the [Sumo Logic OpenTelemetry Collector](https://github.co
118118
receivers: [prometheus]
119119
exporters: [sumologic]
120120
```
121-
* 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.
122125
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:
124127
```bash
125128
sudo otelcol-sumo \
126129
--config=/etc/otelcol-sumo/sumologic.yaml \
127130
--config "glob:/etc/otelcol-sumo/conf.d/*.yaml"
128131
```
129132

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.
131134

132135

133136
## 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
136139

137140
To create a new dashboard:
138141

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"/>
151153

152-
## Step 4: Set up an alert
153154

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
155156

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).
-167 KB
Loading
-5.71 KB
Loading
-92.5 KB
Loading
-51.5 KB
Loading
-17.4 KB
Loading

0 commit comments

Comments
 (0)