Replaces tab to 4 whitespaces

This commit also aligns an indent and fixes some syntax.

Change-Id: I6aeb7bd4f27a7853f4152e07999776731a7a1a3b
This commit is contained in:
Yushiro FURUKAWA 2016-09-28 22:03:29 +09:00
parent c8a299e9c8
commit 51edaa7a86
3 changed files with 77 additions and 62 deletions

View File

@ -135,19 +135,19 @@ In particular, replace any values that have curly braces.
Example: Example:
Change Change
username: {args.username} username: {args.username}
to to
username: myuser username: myuser
You must replace all of the curly brace values and you can also optionally tweak any of the other configuration items as well like a port number in the case of a port conflict. The config file options are documented in the agent.yaml.template file. You may also specify zero or more dimensions that would be included in every metric generated on that node, using the dimensions: value. Example: (include no extra dimensions on every metric) You must replace all of the curly brace values and you can also optionally tweak any of the other configuration items as well like a port number in the case of a port conflict. The config file options are documented in the agent.yaml.template file. You may also specify zero or more dimensions that would be included in every metric generated on that node, using the dimensions: value. Example: (include no extra dimensions on every metric)
dimensions: (No dimensions example) dimensions: (No dimensions example)
OR OR
dimensions: (Single dimension example) dimensions: (Single dimension example)
service: nova service: nova
OR OR
dimensions: (3 dimensions example) dimensions: (3 dimensions example)
service: nova service: nova
group: group_a group: group_a
@ -206,33 +206,33 @@ The init_config section contains global configuration parameters for the plugin.
A plugin config is specified something like this: A plugin config is specified something like this:
init_config: init_config:
is_jmx: true is_jmx: true
# Metrics collected by this check. You should not have to modify this. # Metrics collected by this check. You should not have to modify this.
conf: conf:
# #
# Aggregate cluster stats # Aggregate cluster stats
# #
- include: - include:
domain: '"kafka.server"' domain: '"kafka.server"'
bean: '"kafka.server":type="BrokerTopicMetrics",name="AllTopicsBytesOutPerSec"' bean: '"kafka.server":type="BrokerTopicMetrics",name="AllTopicsBytesOutPerSec"'
attribute: attribute:
MeanRate: MeanRate:
metric_type: counter metric_type: counter
alias: kafka.net.bytes_out alias: kafka.net.bytes_out
instances: instances:
- host: localhost - host: localhost
port: 9999 port: 9999
name: jmx_instance name: jmx_instance
user: username user: username
password: password password: password
#java_bin_path: /path/to/java #Optional, should be set if the agent cannot find your java executable #java_bin_path: /path/to/java #Optional, should be set if the agent cannot find your java executable
#trust_store_path: /path/to/trustStore.jks # Optional, should be set if ssl is enabled #trust_store_path: /path/to/trustStore.jks # Optional, should be set if ssl is enabled
#trust_store_password: password #trust_store_password: password
dimensions: dimensions:
env: stage env: stage
newDim: test newDim: test
monasca-collector service can receive a `--config-file` argument, which represents an alternate agent configuration file, instead of the default /etc/monasca/agent.yaml. monasca-collector service can receive a `--config-file` argument, which represents an alternate agent configuration file, instead of the default /etc/monasca/agent.yaml.

View File

@ -57,7 +57,7 @@ The order of precedence for all dimensions is:
#### Common Dimensions #### Common Dimensions
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| hostname | The FQDN of the host being measured. | | hostname | The FQDN of the host being measured. |
| observer_host | The FQDN of the host that runs a check against another host. | | observer_host | The FQDN of the host that runs a check against another host. |
| url | In the case of the http endpoint check the url of the http endpoint being checked. | | url | In the case of the http endpoint check the url of the http endpoint being checked. |
@ -137,42 +137,57 @@ statsd.timing('pipeline', 2468.34) # Pipeline took 2468.34 ms to execute
statsd.gauge('gaugething', 3.14159265) # 'gauge' would be the preferred metric type for Monitoring statsd.gauge('gaugething', 3.14159265) # 'gauge' would be the preferred metric type for Monitoring
``` ```
The [monasca-statsd](https://github.com/openstack/monasca-statsd library provides a python based implementation The [monasca-statsd](https://github.com/openstack/monasca-statsd library provides a python based implementation
of a statsd client but also adds the ability to add dimensions to the statsd metrics for the client. of a statsd client but also adds the ability to add dimensions to the statsd metrics for the client.
Here are some examples of how code can be instrumented using calls to monasca-statsd. Here are some examples of how code can be instrumented using calls to monasca-statsd.
```
* Import the module once it's installed. * Import the module once it's installed.
from monascastatsd import monasca_statsd
statsd = monasca_statsd.MonascaStatsd()
* Optionally, configure the host and port if you're running Statsd on a non-standard port. ```python
statsd.connect('localhost', 8125) from monascastatsd import monasca_statsd
statsd = monasca_statsd.MonascaStatsd()
```
* Increment a counter. * Optionally, configure the host and port if you're running Statsd on a non-standard port.
statsd.increment('page_views')
With dimensions: ```python
statsd.increment('page_views', 5, dimensions={'Hostname': 'prod.mysql.abccorp.com'}) statsd.connect('localhost', 8125)
```
* Record a gauge 50% of the time. * Increment a counter.
statsd.gauge('users_online', 91, sample_rate=0.5)
With dimensions: ```python
statsd.gauge('users_online', 91, dimensions={'Origin': 'Dev', 'Environment': 'Test'}) statsd.increment('page_views')
* Time a function call. With dimensions:
@statsd.timed('page.render') statsd.increment('page_views', 5, dimensions={'Hostname': 'prod.mysql.abccorp.com'})
def render_page(): ```
# Render things...
* Time a block of code. * Record a gauge 50% of the time.
with statsd.time('database_read_time',
dimensions={'db_host': 'mysql1.mycompany.net'}):
# Do something...
``` ```python
statsd.gauge('users_online', 91, sample_rate=0.5)
With dimensions:
statsd.gauge('users_online', 91, dimensions={'Origin': 'Dev', 'Environment': 'Test'})
```
* Time a function call.
```python
@statsd.timed('page.render')
def render_page():
# Render things...
```
* Time a block of code.
```python
with statsd.time('database_read_time',
dimensions={'db_host': 'mysql1.mycompany.net'}):
# Do something...
```
# License # License
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP

View File

@ -1649,10 +1649,10 @@ Sample config:
init_config: init_config:
instances: instances:
user: mon_api user: mon_api
password: password password: password
service: monasca (optional, defaults to vertica) service: monasca (optional, defaults to vertica)
timeout: 3 (optional, defaults to 3 seconds) timeout: 3 (optional, defaults to 3 seconds)
``` ```
| Metric Name | Dimensions | Semantics | | Metric Name | Dimensions | Semantics |
@ -1660,7 +1660,7 @@ instances:
| vertica.license_usage_percent | hostname, service=vertica| Percentage of the license size taken up. | | vertica.license_usage_percent | hostname, service=vertica| Percentage of the license size taken up. |
| vertica.connection_status | hostname, node_name, service=vertica | Value of DB connection status (0=Healthy). | | vertica.connection_status | hostname, node_name, service=vertica | Value of DB connection status (0=Healthy). |
| vertica.node_status | hostname, node_name, service=vertica| Status of node connection (0=UP). | | vertica.node_status | hostname, node_name, service=vertica| Status of node connection (0=UP). |
| vertica.projection.ros_count | hostname, node_name, projection_name, service=vertica| The number of ROS containers in the projection. | | vertica.projection.ros_count | hostname, node_name, projection_name, service=vertica| The number of ROS containers in the projection. |
| vertica.projection.tuple_mover_mergeouts | hostname, node_name, projection_name, service=vertica | Number of current tuple mover mergeouts on this projection. | | vertica.projection.tuple_mover_mergeouts | hostname, node_name, projection_name, service=vertica | Number of current tuple mover mergeouts on this projection. |
| vertica.projection.tuple_mover_moveouts | hostname, node_name, projection_name, service=vertica | Number of current tuple mover moveout on this projection. | | vertica.projection.tuple_mover_moveouts | hostname, node_name, projection_name, service=vertica | Number of current tuple mover moveout on this projection. |
| vertica.projection.wos_used_bytes | hostname, node_name, projection_name, service=vertica | The number of WOS bytes in the projection.). | | vertica.projection.wos_used_bytes | hostname, node_name, projection_name, service=vertica | The number of WOS bytes in the projection.). |
@ -1685,9 +1685,9 @@ Sample config:
init_config: init_config:
instances: instances:
host: localhost host: localhost
port: 2181 port: 2181
timeout: 3 timeout: 3
``` ```
The Zookeeper checks return the following metrics: The Zookeeper checks return the following metrics: