Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2785)

Unified Diff: appengine_module/gae_ts_mon/README

Issue 1260293009: make version of ts_mon compatible with appengine (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: add noncululativedistribution metric to ts_mon imports Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/sheriff_o_matic/ts_alerts.py ('k') | appengine_module/gae_ts_mon/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine_module/gae_ts_mon/README
diff --git a/appengine_module/gae_ts_mon/README b/appengine_module/gae_ts_mon/README
new file mode 100644
index 0000000000000000000000000000000000000000..104d0f65a00139969860d0447802da5c4187c739
--- /dev/null
+++ b/appengine_module/gae_ts_mon/README
@@ -0,0 +1,58 @@
+# SETTING UP GAE_TS_MON WITH APPENGINE
+
+Symlink this directory to your appengine app.
+
+Add a cron job to the cron.yaml file
+cron:
+- description: flush alerts metrics
+ url: /monitoring
+ schedule: every 5 minutes
+ target: monitoring
+
+Add a dispatch.yaml file
+dispatch:
+- url: "*/monitoring"
+ module: monitoring
+
+- url: "*/monitoring/*"
+ module: monitoring
+
+- url: "*/_ah/start"
+ module: monitoring
+
+- url: "*/*"
+ module: default
+
+# INCREMENTING OR SETTING A PROVIDED METRIC
+
+import gae_ts_mon
+url = app_identity.get_default_version_hostname()
+gae_ts_mon.access_count.increment(fields={'url_path': url + '/' + key,
+ 'request_path': key,
+ 'request_type': 'GET'})
+gae_ts_mon.request_bytes.add(48)
+
+See __init__.py for list of predefined metrics.
+
+# SENDING A SPECIFIC METRIC TO MONARCH
+
+gae_ts_mon.send(gae_ts_mon.access_count)
+
+# MANUALLY FLUSHING (SEND TO MONARCH) ALL METRICS
+
+gae_ts_mon.flush()
+
+All metrics will already flush automatically every five minutes.
+
+# ADDING A NEW METRIC
+
+alerts_count = gae_ts_mon.CounterMetric('gae/alerts')
+
+This may raise a MonitoringDuplicateRegistrationError if the name is already
+registered with a metric of a different type.
+
+# ADDING A NEW METRIC WITH CUSTOM TARGET:
+
+service, job, region, hostname, task = 'service', 'job', 'reg', 'host', 1
+custom_target = gae_ts_mon.TaskTarget(service, job, region, hostname, task)
+cats_metric = gae_ts_mon.CounterMetric('gae/cats', target=custom_target)
« no previous file with comments | « appengine/sheriff_o_matic/ts_alerts.py ('k') | appengine_module/gae_ts_mon/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698