Initial commit for wavefront wrapper for dispatch#1
Initial commit for wavefront wrapper for dispatch#1zimengyang wants to merge 5 commits intodispatchframework:masterfrom
Conversation
|
|
||
| ## Standard Metrics reported by Wavefront Dispatch wrapper | ||
|
|
||
| Following metrics will be reported by wrapper: |
There was a problem hiding this comment.
The table looks screwed up, like this:
Following metrics will be reported by wrapper:
| Metric Name | Type | Description |
|---|---|---|
| dispatch.function.wf.invocations.count | Delta Counter | Count of Dispatch function invocations |
| dispatch.function.wf.errors.count | Delta Counter | Count of Dispatch function executions with error |
| dispatch.function.wf.duration.value | Gauge | Execution time of Dispatch function in ms. |
There was a problem hiding this comment.
I did insert extract spaces and dashes for alignments with table header and contents. I will delete those extra spaces since the final rendering markdown are the same.
| def handle(ctx, payload): | ||
|
|
||
| # Customized metrics | ||
| registry = wavefront_dispatch.get_registry() |
There was a problem hiding this comment.
We're getting an instance of registry every time a function gets invoked. Is that intentional (recommended / required)?
If not, it better be initialized once and reused.
There was a problem hiding this comment.
The registry is MetricsRegistry which only contains various maps of metrics types. My understanding is that the registry is for keeping track of current metrics during execution and should not be expensive. It has to be created every time for new function invocation.
pip install wavefront_dispatchhttps://pypi.org/project/wavefront-dispatch/