-
Notifications
You must be signed in to change notification settings - Fork 140
/
viewing-logs-and-metrics.html.md.erb
380 lines (318 loc) · 18.9 KB
/
viewing-logs-and-metrics.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
---
title: Accessing Logs and Metrics
owner: Oratos, Log Egress, Loggregator
---
This topic describes how to access logs and metrics for VMs and app containers on your <%= vars.platform_name %> deployment. It includes information about the available logs and metrics for the <%= vars.app_runtime_full %> (<%= vars.app_runtime_abbr %>) and <%= vars.k8s_runtime_full %> (<%= vars.k8s_runtime_abbr %>) runtimes.
## <a id="overview"></a> Overview
There are different methods for accessing logs and metrics for VMs and app containers depending on if you use the <%= vars.app_runtime_abbr %> or <%= vars.k8s_runtime_abbr %> app runtime for your deployment.
There are also different permissions required to access logs and metrics on <%= vars.app_runtime_abbr %> and <%= vars.k8s_runtime_abbr %>. The sections in this topic explain how to access logs and metrics on your <%= vars.app_runtime_abbr %> or <%= vars.k8s_runtime_abbr %> deployment based on your user role permissions.
## <a id="director-vm-logs"></a> Access Platform Director VM Logs
Platform Director logs include logs from the Ops Manager and BOSH Director VMs.
For both <%= vars.app_runtime_abbr %> and <%= vars.k8s_runtime_abbr %>, operators can access platform director VM logs by configuring a syslog drain in the Ops Manager tile. For more information, see [Settings Page](https://docs.pivotal.io/platform/ops-manager/pcf-interface.html#settings) in _Using the <%= vars.ops_manager %> Interface_.
The format for the BOSH Director VM logs is Syslog RFC 5424. For more information, see [RFC 5424 - The Syslog Protocol](https://tools.ietf.org/html/rfc5424) in the Internet Engineering Task Force (IETF) documentation.
The format for the Ops Manager VM logs is Syslog RFC 3164. For more information, see [The BSD Syslog Protocol](https://tools.ietf.org/html/rfc3164) in the IETF documentation.
## <a id="vm-logs"></a> Access VM Logs
This section describes how to access logs for <%= vars.app_runtime_abbr %> and <%= vars.k8s_runtime_abbr %> VMs.
The format for VM logs is Syslog RFC 5424. For more information, see [RFC 5424 - The Syslog Protocol](https://tools.ietf.org/html/rfc5424) in the IETF documentation.
See one of the following sections below:
* [Access VM Logs on <%= vars.app_runtime_abbr %>](#vm-logs-<%= vars.app_runtime_abbr %>)
* [Access VM Logs on <%= vars.k8s_runtime_abbr %>](#vm-logs-<%= vars.k8s_runtime_abbr %>)
### <a id="vm-logs-pas"></a> Access VM Logs on <%= vars.app_runtime_abbr %>
<%= vars.app_runtime_abbr %> VM logs include logs for runtime component VMs and service tile VMs.
The following table describes how to access VM logs on foundations with <%= vars.app_runtime_abbr %> based on user role and permissions:
<table class="nice">
<tr>
<th width="15%">Title</th>
<th width="25%"><%= vars.app_runtime_abbr %> Role</th>
<th width="30%">Procedure</th>
<th width="25%">Notes</th>
</tr>
<tr>
<td>Operator</td>
<td><code>Admin</code></td>
<td>Configure system logging in <%= vars.app_runtime_abbr %>. For more information, see <a href="./configure-pas.html#sys-logging">Configure System Logging</a> in <em>Configuring <%= vars.app_runtime_abbr %></em>.</td>
<td>To access logs for service instances, you must also configure syslog in each service tile for which you want logs. For more information, see the documentation for the service tile.</td>
</tr>
<tr>
<td>Developer</td>
<td><code>Space Developer</code></td>
<td>Not applicable.</td>
<td></td>
</tr>
</table>
### <a id="vm-logs-pks"></a> Access VM Logs on <%= vars.k8s_runtime_abbr %>
The following table describes how to access VM logs on foundations with <%= vars.k8s_runtime_abbr %> based on user role and permissions:
<table class="nice">
<tr>
<th width="15%">Title</th>
<th width="20%">Role</th>
<th width="30%">Procedure</th>
<th width="30%">Notes</th>
</tr>
<tr>
<td>Operator</td>
<td><code>Admin</code></td>
<td>Enable system logging in <%= vars.k8s_runtime_abbr %>. For more information, see the <em>Host Monitoring</em> section in the <%= vars.k8s_runtime_abbr %> installation topic for your IaaS:
<ul>
<li><a href="https://docs.pivotal.io/tkgi/installing-aws.html#syslog">Installing <%= vars.k8s_runtime_full %> on AWS</a></li>
<li><a href="https://docs.pivotal.io/tkgi/installing-azure.html#syslog">Installing <%= vars.k8s_runtime_full %> on Azure</a></li>
<li><a href="https://docs.pivotal.io/tkgi/installing-gcp.html#syslog">Installing <%= vars.k8s_runtime_full %> on GCP</a></li>
<li><a href="https://docs.pivotal.io/tkgi/installing-vsphere.html#syslog">Installing <%= vars.k8s_runtime_full %> on vSphere</a></li>
<li><a href="https://docs.pivotal.io/tkgi/installing-nsx-t.html#syslog">Installing <%= vars.k8s_runtime_full %> on vSphere with NSX-T</a></li>
</ul>
</td>
<td></td>
</tr>
<tr>
<td>Cluster Admin/Developer</td>
<td>Not applicable.</td>
<td>Not applicable.</td>
<td></td>
</tr>
</table>
## <a id="vm-metrics"></a> Access VM Metrics
This section describes how to access metrics for <%= vars.app_runtime_abbr %> VMs and <%= vars.k8s_runtime_abbr %> VMs.
See one of the following sections below:
* [Access VM Metrics on <%= vars.app_runtime_abbr %>](#vm-metrics-<%= vars.app_runtime_abbr %>)
* [Access VM Metrics on <%= vars.k8s_runtime_abbr %>](#vm-metrics-<%= vars.k8s_runtime_abbr %>)
### <a id="vm-metrics-pas"></a> Access VM Metrics on <%= vars.app_runtime_abbr %>
For <%= vars.app_runtime_abbr %> deployments, VM metrics include <%= vars.app_runtime_abbr %> component and service tile VM metrics.
The following table describes how to access VM metrics on foundations with <%= vars.app_runtime_abbr %> based on user role and permissions:
<table class="nice">
<tr>
<th width="15%">Title</th>
<th width="25%"><%= vars.app_runtime_abbr %> Role</th>
<th width="35%">Procedure</th>
<th width="25%">Notes</th>
</tr>
<tr>
<td>Operator</td>
<td><code>Admin</code></td>
<td>No additional configuration is required. <%= vars.app_runtime_abbr %> emits VM metrics through the Loggregator Firehose. For more information, see <a href="https://docs.pivotal.io/application-service/loggregator/architecture.html">Loggregator Architecture</a>.</td>
<td>The Firehose emits metrics as a gauge or counter Loggregator envelope type. For more information, see the <a href="https://github.com/cloudfoundry/loggregator-api/blob/master/README.md">loggregator-api</a> repository on GitHub.</td>
</tr>
<tr>
<td>Developer</td>
<td><code>Space Developer</code></td>
<td>Not allowed.</td>
<td></td>
</tr>
</table>
### <a id="vm-metrics-pks"></a> Access VM Metrics on <%= vars.k8s_runtime_abbr %>
For <%= vars.k8s_runtime_abbr %> deployments, VM metrics include metrics for the master and worker nodes.
<p class="note"><strong>Note:</strong> VM metrics are available on <%= vars.k8s_runtime_abbr %> v1.5 and later.</p>
The following table describes how to access VM metrics on foundations with <%= vars.k8s_runtime_abbr %> based on user role and permissions.
<table class="nice">
<tr>
<th width="15%">Title</th>
<th width="20%">Role</th>
<th width="30%">Procedure</th>
<th width="30%">Notes</th>
</tr>
<tr>
<td>Operator</td>
<td><code>Admin</code></td>
<td>Configure an output plugin in the <%= vars.k8s_runtime_abbr %> tile. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</td>
<td>Component VM Metrics include the master node only.</td>
</tr>
<tr>
<td>Cluster Admin</td>
<td>The operator defines the role-based access policy for accessing VM metrics.</td>
<td>Configure a <code>ClusterMetricSink</code> in the cluster. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</td>
<td>
<ul>
<li>You must configure a <code>ClusterMetricSink</code> for each new cluster.</li>
<li>Component VM Metrics include the worker nodes only.</li>
</ul>
</td>
</tr>
<tr>
<td>Developer</td>
<td>The operator defines the role-based access policy for accessing VM metrics.</td>
<td></td>
<td></td>
</tr>
</table>
## <a id="app-logs"></a> Access App Container Logs
This section describes how to access app logs on <%= vars.platform_name %>.
See one of the following sections below:
* [Access App Container Logs on <%= vars.app_runtime_abbr %>](#app-logs-<%= vars.app_runtime_abbr %>)
* [Access App Container Logs on <%= vars.k8s_runtime_abbr %>](#app-logs-<%= vars.k8s_runtime_abbr %>)
### <a id="app-logs-pas"></a> Access App Container Logs on <%= vars.app_runtime_abbr %>
App container logs for <%= vars.app_runtime_abbr %> deployments include logs for apps and service instances.
The following table describes how to access app logs on foundations with <%= vars.app_runtime_abbr %> based on user role and permissions.
<table class="nice">
<tr>
<th width="15%">Title</th>
<th width="25%"><%= vars.app_runtime_abbr %> Role</th>
<th width="30%">Procedure</th>
<th width="25%">Notes</th>
</tr>
<tr>
<td>Operator</td>
<td><code>Admin</code></td>
<td>Access logs with one of the following methods:
<ul>
<li><strong>Loggregator Firehose:</strong> No configuration required. The Firehose emits logs as text payload. The developer defines the log format. For more information, see the <a href="https://github.com/cloudfoundry/loggregator-api/blob/master/README.md">loggregator-api</a> repository on GitHub.</li>
<li><strong>Syslog Drain:</strong> Requires configuration of Syslog Adapter Drain. For more information, see <a href="https://docs.pivotal.io/application-service/devguide/services/log-management.html#step2">Step 2: Create and Bind a User-Provided Service Instance</a> in <em>Streaming App Logs to Log Management Services</em>.</li>
<li><strong>Aggregate Syslog Drain:</strong> A syslog drain that sends all app logs to a single destination. Configure the aggregate syslog drain in the <%= vars.app_runtime_abbr %> tile. For more information, see <a href="https://docs.pivotal.io/application-service/operating/configure-pas.html#sys-db">Configure System Logging</a> in <em>Configuring <%= vars.app_runtime_abbr %></em>.</li>
</ul>
</td>
<td>
<ul>
<li>The Firehose does not emit logs for service instances. To access service instance logs, use the syslog drain or aggregate syslog drain method.</li>
<li>Syslog drains emit logs as Syslog RFC 5424.</li>
</ul>
</td>
</tr>
<tr>
<td>Developer</td>
<td><code>Space Developer</code></td>
<td>Access logs with one of the following methods:
<ul>
<li><strong>Loggregator Firehose:</strong> The Firehose emits logs as text payload. The developer defines the log format. For more information, see the <a href="https://github.com/cloudfoundry/loggregator-api/blob/master/README.md">loggregator-api</a> repository on GitHub.</li>
<li><strong>Syslog Drain:</strong> Requires configuration of Syslog Adapter Drain. For more information, see <a href="https://docs.pivotal.io/application-service/devguide/services/log-management.html#step2">Step 2: Create and Bind a User-Provided Service Instance</a> in <em>Streaming App Logs to Log Management Services</em>.</li>
</ul>
</td>
<td>
<ul>
<li>The Firehose does not emit logs for service instances. To access service instance logs, use the syslog drain method.</li>
<li>Syslog drains emit logs as Syslog RFC 5424.</li>
</ul>
</td>
</tr>
</table>
### <a id="app-logs-pks"></a> Access App Container Logs on <%= vars.k8s_runtime_abbr %>
The following table describes how to access app container logs on foundations with <%= vars.k8s_runtime_abbr %> based on user role and permissions:
<table class="nice">
<tr>
<th width="15%">Title</th>
<th width="20%">Role</th>
<th width="30%">Procedure</th>
<th width="30%">Notes</th>
</tr>
<tr>
<td>Operator</td>
<td><code>Admin</code></td>
<td>Configure a <code>ClusterSink</code> in the cluster. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</td>
<td>
<ul>
<li>You can send logs from a namespace within a cluster to a log destination by configuring a namespace log <code>Sink</code>. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</li>
<li>You must configure a <code>ClusterSink</code> for each new cluster.</li>
</ul>
</td>
</tr>
<tr>
<td>Cluster Admin</td>
<td>The operator defines the role-based access policy for accessing app logs.</td>
<td>Configure a <code>ClusterSink</code> in the cluster. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</td>
<td>
<ul>
<li>You can send logs from a namespace within a cluster to a log destination by configuring a namespace log <code>Sink</code>. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</li>
<li>You must configure a <code>ClusterSink</code> for each new cluster.</li>
</ul>
</td>
</tr>
<tr>
<td>Developer</td>
<td>The operator defines the role-based access policy for accessing app logs.</td>
<td>Configure a <code>Sink</code> in the <%= vars.k8s_runtime_abbr %> tile for a cluster namespace. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</td>
<td>
<ul>
<li>You can send logs from a namespace within a cluster to a log destination by configuring a namespace log <code>Sink</code>. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</li>
<li>You must configure a <code>ClusterSink</code> for each new cluster.</li>
<li>You must provide your own access policy.</li>
<li>Developers may not have permissions to configure a <code>ClusterSink</code>. Operators must define an access policy that allows developers to create a <code>ClusterSink</code>.</li>
</ul>
</td>
</tr>
</table>
## <a id="app-metrics"></a> Access App Container Metrics
This section describes how to access app container metrics on <%= vars.platform_name %>.
See one of the following sections below:
* [Access App Container Metrics on <%= vars.app_runtime_abbr %>](#app-metrics-pas)
* [Access App Container Metrics on <%= vars.k8s_runtime_abbr %>](#app-metrics-pks)
### <a id="app-metrics-pas"></a> Access App Container Metrics on <%= vars.app_runtime_abbr %>
App container metrics on <%= vars.app_runtime_abbr %> include app metrics and service instance metrics. App container metrics on <%= vars.app_runtime_abbr %> do not include task metrics. This is because Diego does not emit task metrics.
The following table describes how to access app container metrics on foundations with <%= vars.app_runtime_abbr %> based on user role and permissions:
<table class="nice">
<tr>
<th width="15%">Title</th>
<th width="20%"><%= vars.app_runtime_abbr %> Role</th>
<th width="30%">Procedure</th>
<th width="30%">Notes</th>
</tr>
<tr>
<td>Operator</td>
<td><code>Admin</code></td>
<td>Access metrics with one of the following methods:
<ul>
<li><strong>Loggregator Firehose:</strong> No configuration required.</li>
<li><strong>Syslog Drain:</strong> Requires configuration of Syslog Adapter Drain. For more information, see <a href="https://docs.pivotal.io/application-service/devguide/services/log-management.html#step2">Step 2: Create and Bind a User-Provided Service Instance</a> in <em>Streaming App Logs to Log Management Services</em>.</li>
</ul>
</td>
<td>
<ul>
<li>The Firehose emits metrics as a gauge or counter Loggregator envelope type. For more information, see the <a href="https://github.com/cloudfoundry/loggregator-api/blob/master/README.md">loggregator-api</a> repository on GitHub.</li>
<li>Syslog drains emit logs as Syslog RFC 5424.</li>
</ul>
</td>
</tr>
<tr>
<td>Developer</td>
<td><code>Space Developer</code></td>
<td>Access metrics with one of the following methods:
<ul>
<li><strong>Loggregator Firehose:</strong> No configuration required.</li>
<li><strong>Syslog Drain:</strong> Requires configuration of Syslog Adapter Drain. For more information, see <a href="https://docs.pivotal.io/application-service/devguide/services/log-management.html#step2">Step 2: Create and Bind a User-Provided Service Instance</a> in <em>Streaming App Logs to Log Management Services</em>.</li>
</ul>
</td>
<td>
</td>
</tr>
</table>
### <a id="app-metrics-pks"></a> Access App Container Metrics on <%= vars.k8s_runtime_abbr %>
The following table describes how to access app container metrics on foundations with <%= vars.k8s_runtime_abbr %> based on user role and permissions:
<table class="nice">
<tr>
<th width="15%">Title</th>
<th width="20%">Role</th>
<th width="30%">Procedure</th>
<th width="30%">Notes</th>
</tr>
<tr>
<td>Operator</td>
<td><code>Admin</code></td>
<td>Configure a <code>ClusterMetricSink</code> in the cluster. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</td>
<td>
<ul>
<li>You must configure a <code>ClusterMetricSink</code> for each new cluster.</li>
<li>You must provide your own access policy.</li>
</ul>
</td>
</tr>
<tr>
<td>Cluster Admin</td>
<td>The operator defines the role-based access policy for accessing app metrics.</td>
<td>Configure a <code>ClusterMetricSink</code> in the cluster. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.</td>
<td>
<ul>
<li>You must configure a <code>ClusterMetricSink</code> for each new cluster.</li>
<li><code>ClusterMetricSink</code> automatically scrapes an annotated <code>/metrics</code> Prometheus endpoint.</li>
</ul>
</td>
</tr>
<tr>
<td>Developer</td>
<td>The operator defines the role-based access policy for accessing app metrics.</td>
<td>Configure a <code>MetricSink</code> in the <%= vars.k8s_runtime_abbr %> tile for a cluster namespace. For more information, see <a href="https://docs.pivotal.io/tkgi/create-sinks.html">Creating Sink Resources</a> in the <%= vars.k8s_runtime_abbr %> documentation.
</td>
<td>
<ul>
<li>You must configure a <code>ClusterMetricSink</code> for each new cluster.</li>
<li><code>ClusterMetricSink</code> automatically scrapes an annotated <code>/metrics</code> Prometheus endpoint.</li>
<li>Developers may not have permissions to configure a <code>ClusterMetricSink</code>. Operators must define an access policy that allows developers to create a <code>ClusterMetricSink</code>.</li>
</ul>
</td>
</tr>
</table>