Skip to content

Conversation

@zimengyang
Copy link
Collaborator

  • wavefront python wrapper for Dispatch
    • Support for generic metrics and custom metrics
    • Docs and example are included
  • Intall by pip install wavefront_dispatch
    • package hosted on https://pypi.org/project/wavefront-dispatch/

Copy link
Member

@imikushin imikushin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple questions


## Standard Metrics reported by Wavefront Dispatch wrapper

Following metrics will be reported by wrapper:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants