Git Product home page Git Product logo

Comments (9)

wu-sheng avatar wu-sheng commented on June 24, 2024

fyi @Superskyyy

from skywalking.

CodePrometheus avatar CodePrometheus commented on June 24, 2024

Could you briefly describe your idea? Is it possible to dynamically update the value of sample based on the configuration file?

from skywalking.

tsonglew avatar tsonglew commented on June 24, 2024

@CodePrometheus I will achieve the function through following tasks:

  1. Add SW_AGENT_SAMPLE in skywalking/config.py
  2. Create a sampling_service with try_sampling, reset_sampling_factor and other methods. try_sampling will add one to a counter property of sampling_service. reset_sampling_factor will clear the counter.
  3. Modify skywalking/trace/context.py to check if sampling_service.try_sampling returns true every time before creating a new SpanContext. If sampling_service.try_sampling returns false, get_context should return NoopContext.
  4. A scheduler thread will be started when initializing a sampling service, it will reset the sampling factor every 3 seconds.

Dynamically updating the value based on the configuration file or environment variables will not be implemented.

from skywalking.

wu-sheng avatar wu-sheng commented on June 24, 2024

Could you briefly describe your idea? Is it possible to dynamically update the value of sample based on the configuration file?

@CodePrometheus Could you be more specific about this? What do you mean based on file?

The above logic seems to be as same as Java agent sampling.

from skywalking.

CodePrometheus avatar CodePrometheus commented on June 24, 2024

@CodePrometheus Could you be more specific about this? What do you mean based on file?

The above logic seems to be as same as Java agent sampling.

Yes, the above logic is similar to the existing sample_n_per_3_secs in Java agent. I want to refer to dynamic configuration, ref #6114

from skywalking.

wu-sheng avatar wu-sheng commented on June 24, 2024

I am not sure whether python agent supports dynamic configuration in the kernel already? @Superskyyy

from skywalking.

CodePrometheus avatar CodePrometheus commented on June 24, 2024

I am not sure whether python agent supports dynamic configuration in the kernel already? @Superskyyy

Currently, this capability is not implemented in python-agent.

from skywalking.

wu-sheng avatar wu-sheng commented on June 24, 2024

@tsonglew Are you going to add this too?

from skywalking.

tsonglew avatar tsonglew commented on June 24, 2024

@tsonglew Are you going to add this too?

Yes, I will create another mr for config change events

from skywalking.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.