-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy path_log-cache-cli-plugin.html.md.erb
71 lines (63 loc) · 3.36 KB
/
_log-cache-cli-plugin.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
To access metrics for <%= vars.service_name %> service instances, you can use Loggregator's Log
Cache feature with the Log Cache CLI plugin.
Log Cache is enabled by default in Pivotal Application Service (PAS) v2.2 and later.
To access metrics for on-demand service instances, do the following:
1. To install the cf CLI plugin, run the following command:
```
cf install-plugin -r CF-Community "log-cache"
```
1. To access metrics for a service instance, run the following command:
<% case vars.service_name
when "MySQL for PCF" %>
```
cf tail SERVICE-INSTANCE-NAME
```
Two useful flags to append to this command are:
- `-f`, `--follow`: Append metrics logs to stdout as they are generated, rather than returning a fixed number of metrics or metrics over a fixed interval.
- `--json`: Output metrics logs as envelopes in JSON format.
For a complete list of `cf tail` options, see the [Log Cache CLI repository](https://github.com/cloudfoundry/log-cache-cli#usage).
<% when "Redis for PCF" %>
```
cf tail SERVICE-INSTANCE-NAME
```
<% when "RabbitMQ for PCF" %>
```
cf tail SERVICE-INSTANCE-NAME
```
<% end %>
Where `SERVICE-INSTANCE-NAME` is the name of your service instance.
<br><br>
For example:
<pre class="terminal">
<%# Switch output for different services %>
<% case vars.service_name
when "MySQL for PCF" %>
$ cf tail -f my-instance | egrep 'connected|available|persistent_disk_used_percent'
2019-05-17T11:25:59.48-0700 [my-instance] GAUGE /p.mysql/available:1.000000 boolean
2019-05-17T11:26:29.49-0700 [my-instance] GAUGE /p.mysql/system/persistent_disk_used_percent:17.000000 percentage
2019-05-17T11:26:29.49-0700 [my-instance] GAUGE /p.mysql/performance/threads_connected:**6**.000000 connection
2019-05-17T11:26:59.50-0700 [my-instance] GAUGE /p.mysql/available:1.000000 boolean
2019-05-17T11:27:29.50-0700 [my-instance] GAUGE /p.mysql/system/persistent_disk_used_percent:17.000000 percentage
2019-05-17T11:27:29.50-0700 [my-instance] GAUGE /p.mysql/performance/threads_connected:**7**.000000 connection
<% when "Redis for PCF" %>
$ cf tail my-instance
Retrieving logs for service my-instance in org system / space pivotal-services as admin...
2018-07-03T09:54:14.84+0100 [my-instance] GAUGE info.clients.blocked_clients:0.000000 metric info.clients.client_biggest_input_buf:0.000000 metric ...
<% when "RabbitMQ for PCF" %>
$ cf tail my-instance
Retrieving logs for service my-instance in org system / space pivotal-services as admin...
2018-12-06T11:01:06.03+0000 [my-instance] GAUGE /p.rabbitmq/rabbitmq/channels/count:0.000000 count /p.rabbitmq/rabbitmq/connections/count:0.000000...
<% end %>
</pre>
For more information about the metrics output, see
<%# Switch links for different services %>
<% case vars.service_name
when "MySQL for PCF" %>
the [Key Performance Indicators](#kpi) and [Component Metrics](#component-metrics) sections below.
<% when "Redis for PCF" %>
[Redis KPIs](./monitoring.html#Redis-KPIs).
<% when "RabbitMQ for PCF" %>
[Monitoring and KPIs for On-Demand RabbitMQ for PCF](./monitor.html).
<% end %>
For more information about how to enable Log Cache and about the `cf tail` command,
see [Enable Log Cache](https://docs.pivotal.io/pivotalcf/opsguide/logging-config-opsman.html#log-cache).