You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you accept a PR that allowed users to pass a callback function or object to the Hubspot3 class allowing it to publish metrics? For example a simple counter of HTTP requests and response codes? Something along the lines of
# hubspot3.metrics or somewhere similarclassMetricsClient(Protocol):
defcounter(self, name: str, value: int, tags: Optional[dict[str, str|int|float]]):
pass# hubspot3.baseclassBaseClient:
def__init__(..., metrics_client: MetricsClient=None):
self.metrics_client=metrics_clientdef_counter(self, name: str, value: int, tags: Optional[dict[str, str|int|float]]):
ifnotself.metrics_client:
returntry:
self.metrics_client.counter(name, value, tags)
exceptException:
logging.exception("something went wrong publishing a metric")
def_execute_raw_request(self, conn, request):
...
self._counter("endpoint", 1, {"http_status": 123})
returnresult# user codeclassMyMetricsClient:
defcounter(self, name: str, value: int, tags: Optional[dict[str, str|int|float]]):
# user implemented method to publish the metric somewhereclient=Hubspot3(access_token="blah", metrics_client=MyMetricsClient)
My motivation is using the new Private Apps there is no equivalent to /integrations/v1/limit/daily that shows your API usage. I've raised a feature request with HubSpot but I'm not hopeful.
The text was updated successfully, but these errors were encountered:
Would you accept a PR that allowed users to pass a callback function or object to the Hubspot3 class allowing it to publish metrics? For example a simple counter of HTTP requests and response codes? Something along the lines of
My motivation is using the new Private Apps there is no equivalent to /integrations/v1/limit/daily that shows your API usage. I've raised a feature request with HubSpot but I'm not hopeful.
The text was updated successfully, but these errors were encountered: