hyperdash-sdk-py icon indicating copy to clipboard operation
hyperdash-sdk-py copied to clipboard

Custom actions

Open richardartoul opened this issue 7 years ago • 1 comments

@spence 's original comment:

Additionally, to support custom actions, do we want to use this as an entrypoint or have them self-registerable.

from hyperdash import action

@action("Shutdown Server")
def shutdown_server():
  os.system("some_command with args")

richardartoul avatar Jul 08 '17 02:07 richardartoul

I've never liked the self-registration thing (feels a little too magic), however, it's common in the Python world and people seem to like it so it might be a good way to go.

Also we could consider making the custom_api_key_getter behave this way, or just drop it altogether as @andrewschreiber suggested in favor of having them set the environment variable themselves, however, they then have to figure out how to implement rotation on their own.

richardartoul avatar Jul 08 '17 02:07 richardartoul