-
Notifications
You must be signed in to change notification settings - Fork 155
Make Metrics consistent with Go client. #129
Make Metrics consistent with Go client. #129
Conversation
Signed-off-by: eundoo-song <eundoo.song@samsung.com>
Signed-off-by: Eundoo Song <eundoo.song@gmail.com>
It looks like the uncovered line(return PeriodicCallback) is not related to this. |
@eundoosong Sweet! Thanks for contributing. Don't worry about the coverage, it looks like a glitch. @jpkrohling could you take a look, since you just did the same in Java? |
Signed-off-by: Eundoo Song <eundoo.song@gmail.com>
LGTM. Looks like the Python version is missing a gauge ( |
@jpkrohling Thanks for your review. if spans:
yield self._submit(spans)
self.metrics.reporter_queue_length(self.queue.qsize())
for _ in spans:
self.queue.task_done()
spans = spans[:0] If it's ok, I'll update. |
I'm not familiar with Tornado (or Python in general, for that matter), but looks OK to me. |
Signed-off-by: Eundoo Song <eundoo.song@gmail.com>
@yurishkuro Is there any reason reporter_queue_length gauge is missed in python? Do you think it should be added as above? |
@eundoosong yes, please add it. Only I would add it after that if statement, i.e. as the last statement of the while loop (or alternatively the first statement). Re |
replace socker_error by reporter failure counter. Signed-off-by: Eundoo Song <eundoo.song@gmail.com>
@yurishkuro @jpkrohling reporter_socket(removed) is replaced by reporter_failure and reporter_queue_length is moved. |
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, but I can't judge the Python part :)
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.
one small issue with update sampler metric
jaeger_client/sampler.py
Outdated
self.error_reporter.error( | ||
'Fail to update sampler' | ||
'from jaeger-agent: %s [%s]', e, response) | ||
|
||
def _update_adaptive_sampler(self, per_operation_strategies): | ||
if isinstance(self.sampler, AdaptiveSampler): | ||
self.sampler.update(per_operation_strategies) | ||
self.metrics.sampler_updated(1) |
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.
this should always run, for else:
part as well
…ondition Signed-off-by: Eundoo Song <eundoo.song@gmail.com>
@yurishkuro moved sampler_updated metric out of the condition |
@eundoosong have you tried this in a real service with a real metrics library? |
@yurishkuro I tried this using my prometheus factory as you see my first comment above |
Thanks, @eundoosong! Do you think you can add a PR for |
@yurishkuro Sure, I can add PrometheusMetricsFactory. PR will be created after tidying code and a try to remove a runtime dependency on prometheus client. |
Make Metrics consistent with Go client.
Now the metric name shows consistent with go-client as you see below prometheus test I did.
Resolves #102
Please review.
Signed-off-by: eundoo-song eundoo.song@gmail.com