-
Notifications
You must be signed in to change notification settings - Fork 227
Breakdown metrics #535
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
Breakdown metrics #535
Conversation
…acers e.g. tests.instrumentation.transactions_store_tests.test_tag_with_non_string_value
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.
Looking good! I haven't gotten to the tests yet, will take another look tomorrow. Here's my comments so far.
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.
Thanks for the updates - just a couple of main issues which I missed in my first pass.
|
||
def test_bare_transaction(elasticapm_client): | ||
elasticapm_client.begin_transaction("request") | ||
time.sleep(0.005) |
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.
I think we should enable callers to supply the duration to end_transaction
, end_span
, etc. Other tracing APIs allow specifying the end timestamp, which is of dubious value given wall clocks can jump... but being able to specify the duration is at least useful here, so we can specify the duration and check the exact value below. It could also be useful for integrating with other tracing systems.
In the Go agent, we only set the span's duration in the end
method if it hasn't already been set, and it looks like this approach would work well in the Python agent too -- an optional arg would be fine too. In case the duration were specified, you work out the end timestamp as self.start_time + self.duration
and pass that into child_ended
.
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.
Makes sense, but if you're ok with it, I'll do that in a separate PR after the 5.0 release
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.
No worries.
on CI, these upper bounds are randomly broken due to slow machines
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.
LGTM! Can you please create a TODO and/or issue so we don't forget to add the duration option and update the tests with exact durations?
implements #479