A Circonus annotation can be created in several ways.
annotation = circonus.create_annotation("title", "category")
Note: The create_annotation() method returns an Annotation instance rather than a requests.Response instance. The requests.Response object is available at the response attribute on the returned object.
@circonus.annotation("title", "category")
def nap_time():
sleep(10)
This will create an annotation with the given parameters and start and stop times that are automatically set to the UTC values of the object.__enter__() and object.__exit__() for the decorated function.
with circonus.annotation("title", "category"):
sleep(10)
This will create an annotation with the given parameters and start and stop times that are automatically set to the UTC values of the object.__enter__() and object.__exit__() for the block.