-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement heartbeats for Python #203
Conversation
Store the last (hopefully only) initialised client in a global variable, and expose its config as a class method on the `Client` class.
Implement a transmitter module similar to the ones in other integrations, which handles the sending of requests with the usual AppSignal identifying params.
Probably a leftover from some typing refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build is failing because of some import error.
12e2e0b
to
a7697ce
Compare
Ended up changing the design significantly, please re-review. I feel that I feel that the current design, where the Also fixed some major issues with the implementation. |
This is a message from the daily scheduled checks. |
Implement the heartbeats functionality for Python, similarly to how it was implemented for Ruby, Elixir and Node.js. Due to limitations on how `with` blocks are implemented, which make it impossible for a function to behave in different ways when called "by itself" and when called by a `with` block, it is possible to call it in the following ways: - `heartbeat(name)`, which sends a finish heartbeat event - `heartbeat(name, function)`, which sends: - a start heartbeat event - a finish heartbeat event, if the function does not raise - as a `with Heartbeat(name):` block (note: `H` not `h`!) which sends: - a start heartbeat event - a finish heartbeat event, if the `with` block does not raise The latter is intentionally un-documented for now, to avoid potential confusion between `heartbeat` and `Heartbeat`. Add a `LOGGING_ENDPOINT` configuration variable to configure the logging endpoint, which is also the endpoint to which heartbeats are sent. This is a bit bizarre, as Python does not support the logging feature yet, but it is consistent with our other integrations.
Bump the changeset to a minor version and mention that the feature is only available to beta testers.
Store global client and expose its config
Store the last (hopefully only) initialised client in a global
variable, and expose its config as a class method on the
Client
class.
Implement AppSignal transmitter
Implement a transmitter module similar to the ones in other
integrations, which handles the sending of requests with the usual
AppSignal identifying params.
Remove empty
TYPE_CHECKING
blockProbably a leftover from some typing refactor.
Implement heartbeats for Python
Implement the heartbeats functionality for Python, similarly to how
it was implemented for Ruby, Elixir and Node.js.
Due to limitations on how
with
blocks are implemented, which makeit impossible for a function to behave in different ways when called
"by itself" and when called by a
with
block, it is possible to callit in the following ways:
heartbeat(name)
, which sends a finish heartbeat eventheartbeat(name, function)
, which sends:with Heartbeat(name):
block (note:H
noth
!) which sends:with
block does not raiseAdd a
LOGGING_ENDPOINT
configuration variable to configure thelogging endpoint, which is also the endpoint to which heartbeats are
sent. This is a bit bizarre, as Python does not support the logging
feature yet, but it is consistent with our other integrations.