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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # SETTING UP GAE_TS_MON WITH APPENGINE
2
3 Symlink this directory to your appengine app.
4
5 Add a cron job to the cron.yaml file
6 cron:
7 - description: flush alerts metrics
8 url: /monitoring
9 schedule: every 5 minutes
10 target: monitoring
11
12 Add a dispatch.yaml file
13 dispatch:
14 - url: "*/monitoring"
15 module: monitoring
16
17 - url: "*/monitoring/*"
18 module: monitoring
19
20 - url: "*/_ah/start"
21 module: monitoring
22
23 - url: "*/*"
24 module: default
25
26 # INCREMENTING OR SETTING A PROVIDED METRIC
27
28 import gae_ts_mon
29 url = app_identity.get_default_version_hostname()
30 gae_ts_mon.access_count.increment(fields={'url_path': url + '/' + key,
31 'request_path': key,
32 'request_type': 'GET'})
33 gae_ts_mon.request_bytes.add(48)
34
35 See __init__.py for list of predefined metrics.
36
37 # SENDING A SPECIFIC METRIC TO MONARCH
38
39 gae_ts_mon.send(gae_ts_mon.access_count)
40
41 # MANUALLY FLUSHING (SEND TO MONARCH) ALL METRICS
42
43 gae_ts_mon.flush()
44
45 All metrics will already flush automatically every five minutes.
46
47 # ADDING A NEW METRIC
48
49 alerts_count = gae_ts_mon.CounterMetric('gae/alerts')
50
51 This may raise a MonitoringDuplicateRegistrationError if the name is already
52 registered with a metric of a different type.
53
54 # ADDING A NEW METRIC WITH CUSTOM TARGET:
55
56 service, job, region, hostname, task = 'service', 'job', 'reg', 'host', 1
57 custom_target = gae_ts_mon.TaskTarget(service, job, region, hostname, task)
58 cats_metric = gae_ts_mon.CounterMetric('gae/cats', target=custom_target)
OLDNEW
« 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