1818
1919
2020Money Trace Plugin
21- ==================
21+ ******************
2222
23- This is a remap plugin that allows ATS to participate in a distributed tracing system based upon
24- the Comcast "Money" distributed tracing and monitoring library. The Comcast "Money" library has
25- its roots in Google's Dapper and Twitters Zipkin systems. A money trace header or session id, is
26- attached to transaction and allows an operator with the appropriate logging systems in place,
27- to determine where errors and/or latency may exit.
23+ Description
24+ ===========
2825
29- Use of the library enables the tracing of a transaction through all systems that participate in
30- handling the request. See the documentation on this open source library at
31- https://github.com/Comcast/money.
26+ This plugin allows ATS to participate in a distributed tracing system
27+ based upon the Comcast "Money" distributed tracing and monitoring library.
28+ The Comcast "Money" library has its roots in Google's Dapper and Twitters
29+ Zipkin systems. A money trace header or session id, is attached to
30+ transaction and allows an operator with the appropriate logging systems
31+ in place, to determine where errors and/or latency may exit.
32+
33+ Use of the library enables the tracing of a transaction through all
34+ systems that participate in handling the request. See the documentation
35+ on this open source library at https://github.com/Comcast/money.
3236
3337How it Works
34- ------------
35-
36- This plugin checks incoming requests for the "X-MoneyTrace" header. If the header is not present
37- no further processing takes place. However if the header is present, the plugin will check to
38- to see if the request has been cached. If so, the plugin will add the "X-Moneytrace" header from the
39- incoming request to the cached response returned to the client as required by the money_trace
40- protocol. If the request has not been cached, the plugin will extends the trace context by creating a new
41- "X-MoneyTrace" header for inclusion in the outgoing request to a parent cache or origin server.
42- The extended header includes the 'trace-id' from the incoming request, the incoming span-id
43- becomes the outgoing parent-id and the plugin generates a new random long span id for the outgoing request.
44- See the documentation at the link above for a complete description on the "X-MoneyTrace" header and how
45- to use and extend it in a distributed tracing system.
38+ ============
39+
40+ This plugin checks incoming requests for the "X-MoneyTrace" header.
41+ If the header is not present no further processing takes place.
42+ However if the header is present, the plugin will check to to see if the
43+ request has been cached. If so, the plugin will add the "X-Moneytrace"
44+ header from the incoming request to the cached response returned to the
45+ client as required by the money_trace protocol. If the request has not
46+ been cached, the plugin will extends the trace context by creating a new
47+ "X-MoneyTrace" header for inclusion in the outgoing request to a parent
48+ cache or origin server. The extended header includes the 'trace-id'
49+ from the incoming request, the incoming span-id becomes the outgoing
50+ parent-id and the plugin generates a new span id for the
51+ outgoing request using the current state machine id.
52+
53+ See the documentation at the link above for a complete description on
54+ the "X-MoneyTrace" header and how to use and extend it in a distributed
55+ tracing system.
56+
57+ A sample money-trace header:
58+
59+ ::
60+
61+ X-MoneyTrace: trace-id=aa234a23-189e-4cc4-98ed-b5327b1ec231-3;parent-id=0;span-id=4303691729133364974
4662
4763Installation
48- ------------
64+ ============
4965
50- The `Money Trace ` plugin is a :term: `remap plugin `. Enable it by adding
51- ``money_trace.so `` to your :file: `remap.config ` file. There are no options.
66+ The `Money Trace ` plugin can be either a :term: `remap plugin ` or
67+ :term: `global plugin `. Enable it by adding ``money_trace.so `` to your
68+ :file: `remap.config ` file or :file: `plugin.config `.
5269
5370Here is an example remap.config entry:
5471
@@ -57,3 +74,53 @@ Here is an example remap.config entry:
5774 map http://vod.foobar.com http://origin.vod.foobar.com @plugin=money_trace.so
5875
5976.. _MoneyTrace : https://github.com/Comcast/money
77+
78+ Configuration
79+ =============
80+
81+ The plugin supports the following options:
82+
83+ * ``--create-if-none=[true|false] `` (default: ``false ``)
84+
85+ If no X-MoneyTrace header is found in the client request one will
86+ be manufactured using the transaction UUID as trace-id,
87+ the transaction state machine id as span-id and parent-id set to '0'.
88+
89+ * ``--global-skip-header=[header name] `` (default: null/disable)
90+
91+ This setting only applies to a :term: `global plugin ` instance
92+ and allows remap plugin instances to override :term: `global plugin `
93+ behavior by disabling the :term: `global plugin `
94+
95+ Because a :term: `global plugin ` runs before any :term: `remap plugin `
96+ in the remap phase a pregen header may still be created by the
97+ :term: `global plugin ` if configured to do so.
98+
99+ The global skip check is performed during the post remap phase in order
100+ to allow remap plugins (like `header rewrite `) to set this skip header.
101+
102+ It is strongly suggested to use a private ATS header (begins with '@')
103+ as this value.
104+
105+ * ``--header=[header name] `` (default: ``X-MoneyTrace ``)
106+
107+ Allows the money trace header to be overridden.
108+
109+ * ``--passthru=[true|false] `` (default: ``false ``)
110+
111+ In this mode ATS acts transparently and only passes the money trace header
112+ through to the parent. This option ignores the --create-if-none setting.
113+
114+ * ``--pregen-header=[header name] `` (default: null/disable)
115+
116+ Normally the money trace header for a transaction is only added to the
117+ transaction server request headers. If this argument is supplied the
118+ header will be generated earlier in the transaction and added to the
119+ client request headers. Use this for debug or for logging the current
120+ transaction's money trace header. It is suggested to use a private
121+ ATS header (begins with a '@') for this value. A :file: `logging.yaml `
122+ entry with pregen-header=@MoneyTrace might look like:
123+
124+ ::
125+
126+ %<{@MoneyTrace}cqh>
0 commit comments