From 51edaa7a86dd5ece2210a79686441b6858412c95 Mon Sep 17 00:00:00 2001 From: Yushiro FURUKAWA Date: Wed, 28 Sep 2016 22:03:29 +0900 Subject: [PATCH] Replaces tab to 4 whitespaces This commit also aligns an indent and fixes some syntax. Change-Id: I6aeb7bd4f27a7853f4152e07999776731a7a1a3b --- docs/Agent.md | 58 ++++++++++++++++++------------------- docs/MonascaMetrics.md | 65 ++++++++++++++++++++++++++---------------- docs/Plugins.md | 16 +++++------ 3 files changed, 77 insertions(+), 62 deletions(-) diff --git a/docs/Agent.md b/docs/Agent.md index bb13890d..ba0a1dbe 100644 --- a/docs/Agent.md +++ b/docs/Agent.md @@ -135,19 +135,19 @@ In particular, replace any values that have curly braces. Example: 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) dimensions: (No dimensions example) - OR + OR dimensions: (Single dimension example) service: nova - OR + OR dimensions: (3 dimensions example) service: nova 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: init_config: - is_jmx: true + is_jmx: true - # Metrics collected by this check. You should not have to modify this. - conf: - # - # Aggregate cluster stats - # - - include: - domain: '"kafka.server"' - bean: '"kafka.server":type="BrokerTopicMetrics",name="AllTopicsBytesOutPerSec"' - attribute: - MeanRate: - metric_type: counter - alias: kafka.net.bytes_out + # Metrics collected by this check. You should not have to modify this. + conf: + # + # Aggregate cluster stats + # + - include: + domain: '"kafka.server"' + bean: '"kafka.server":type="BrokerTopicMetrics",name="AllTopicsBytesOutPerSec"' + attribute: + MeanRate: + metric_type: counter + alias: kafka.net.bytes_out instances: - - host: localhost - port: 9999 - name: jmx_instance - user: username - password: password - #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_password: password - dimensions: - env: stage - newDim: test + - host: localhost + port: 9999 + name: jmx_instance + user: username + password: password + #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_password: password + dimensions: + env: stage + 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. diff --git a/docs/MonascaMetrics.md b/docs/MonascaMetrics.md index b94cd81b..18657578 100644 --- a/docs/MonascaMetrics.md +++ b/docs/MonascaMetrics.md @@ -57,7 +57,7 @@ The order of precedence for all dimensions is: #### Common Dimensions | Name | Description | -| ---- | ----------- | +| ---- | ----------- | | hostname | The FQDN of the host being measured. | | 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. | @@ -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 ``` -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. Here are some examples of how code can be instrumented using calls to monasca-statsd. -``` - * Import the module once it's installed. - from monascastatsd import monasca_statsd - statsd = monasca_statsd.MonascaStatsd() +* Import the module once it's installed. - * Optionally, configure the host and port if you're running Statsd on a non-standard port. - statsd.connect('localhost', 8125) + ```python + from monascastatsd import monasca_statsd + statsd = monasca_statsd.MonascaStatsd() + ``` - * Increment a counter. - statsd.increment('page_views') +* Optionally, configure the host and port if you're running Statsd on a non-standard port. - With dimensions: - statsd.increment('page_views', 5, dimensions={'Hostname': 'prod.mysql.abccorp.com'}) + ```python + statsd.connect('localhost', 8125) + ``` - * Record a gauge 50% of the time. - statsd.gauge('users_online', 91, sample_rate=0.5) +* Increment a counter. - With dimensions: - statsd.gauge('users_online', 91, dimensions={'Origin': 'Dev', 'Environment': 'Test'}) + ```python + statsd.increment('page_views') - * Time a function call. - @statsd.timed('page.render') - def render_page(): - # Render things... + With dimensions: + statsd.increment('page_views', 5, dimensions={'Hostname': 'prod.mysql.abccorp.com'}) + ``` - * Time a block of code. - with statsd.time('database_read_time', - dimensions={'db_host': 'mysql1.mycompany.net'}): - # Do something... +* Record a gauge 50% of the time. -``` + ```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 (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP diff --git a/docs/Plugins.md b/docs/Plugins.md index 162c15c8..a1ae4c8e 100644 --- a/docs/Plugins.md +++ b/docs/Plugins.md @@ -1649,10 +1649,10 @@ Sample config: init_config: instances: - user: mon_api - password: password - service: monasca (optional, defaults to vertica) - timeout: 3 (optional, defaults to 3 seconds) + user: mon_api + password: password + service: monasca (optional, defaults to vertica) + timeout: 3 (optional, defaults to 3 seconds) ``` | Metric Name | Dimensions | Semantics | @@ -1660,7 +1660,7 @@ instances: | 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.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_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.). | @@ -1685,9 +1685,9 @@ Sample config: init_config: instances: - host: localhost - port: 2181 - timeout: 3 + host: localhost + port: 2181 + timeout: 3 ``` The Zookeeper checks return the following metrics: