aws / aws-xray-sdk-python

AWS X-Ray SDK for the Python programming language
Apache License 2.0
329 stars 143 forks source link

support for sampling on subsegments #104

Open kapilt opened 6 years ago

kapilt commented 6 years ago

we have a few long running segments, that can generate thousands of api calls, i'd like to be able to sample on the subsegments. fwiw, we've gone and reused the sampler for that use case, but we end up with non clean segments, primarily due to the class constructor ref counting on the enclosing segment. there were enough dashboard ux abnormalities that we walked it back to the default of non sampled subsegments streamed.

haotianw465 commented 6 years ago

Hi, thank you four the feedback. We will definitely consider this feature request to provide better customer experience. Which SDK are you using? Could you clarify a little bit more on "end up with non clean segments" so we can try to provide a workaround if possible?

kapilt commented 6 years ago

re non clean segments, nesting on subsegments no longer aggregates properly in the X-ray ui. there's a dichotomy in the code base wrt to to ref counting extant/open on segment with ref instantiation on class creation for subsegments. Removing the subsegment sampling restored expected ux/nesting semantics, having it as a first class supported use case would make expected results easier to achieve.

haotianw465 commented 6 years ago

Thank you for the clarification. We will look into this feature request and post updates here. If you have any preferred UX or API for configuring subsegments sampling for a particular segment feel free to share extra thoughts here too.