Can we increment Prometheus counter metric using decorator in python? Here is code snippet
REQUEST_COUNT = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint'])
@REQUEST_COUNT.labels(method='get', endpoint='/hello').inc()
def process_request_count():
...
Error:
@REQUEST_COUNT.labels(method='get', endpoint='/hello').inc() SyntaxError: invalid syntax