apm icon indicating copy to clipboard operation
apm copied to clipboard

Rename the span_frames_min_duration property

Open danielfariati opened this issue 6 years ago • 10 comments

The span_frames_min_duration seems to be used to decide whether or not to collect stack traces for a span. The problem is that this information only becomes clear after reading the full documentation, as the name of the property does not make this easy to guess. It would be better if the name of the property was clear enough for the user to know what it is used for. Maybe stack_trace_span_min_duration, for example.

Spec issue

  • [x] https://github.com/elastic/apm/issues/528 Milestone

Agent issues

  • [x] https://github.com/elastic/apm-agent-java/issues/2206 Milestone
  • [x] https://github.com/elastic/apm-agent-dotnet/issues/1529 Milestone
  • [x] https://github.com/elastic/apm-agent-go/issues/1142 Milestone
  • [x] https://github.com/elastic/apm-agent-php/issues/568 Milestone
  • [ ] https://github.com/elastic/apm-agent-ruby/issues/1174 Milestone
  • [x] https://github.com/elastic/apm-agent-nodejs/issues/2381 Milestone
  • [x] https://github.com/elastic/apm-agent-python/issues/1369 Milestone

danielfariati avatar Jan 23 '19 21:01 danielfariati

I agree this is a confusing name. The problem is that it has to be aligned with the other Elastic APM agents. But that doesn't mean we can't change it 🙂

How do you like span_stack_trace_min_duration?

felixbarny avatar Jan 25 '19 15:01 felixbarny

Much better! When I read the property span_stack_trace_min_duration, I know exactly what it will be used for.

danielfariati avatar Jan 27 '19 22:01 danielfariati

If we do this, I'd really like to also switch the meaning of the special values 0 and -1. Currently, setting the value to 0 means "never", and setting the value to -1 means "always". If you consider that 0 is a valid duration, then it's logical that duration>0 should always capture a stack trace. Therefore we really only need -1 as a special case of "never". We could leave the values for the existing config name alone.

axw avatar Jun 04 '19 05:06 axw

I have also found this very confusing +1 to switch the semantics of 0 and -1

felixbarny avatar Jun 04 '19 06:06 felixbarny

Swinging by from the future with some data -- the Node.js agent is about to merge our implementation of the ELASTIC_APM_SPAN_FRAMES_MIN_DURATION env variable. We aligned with the Java, Ruby, Python and .NET agents in implementing a "-1 means all, 0 means none" behavior, and we're keeping (for now) a legacy boolean that can turn this feature on/off wholesale.

We'd also be keenly interested in a new name for this variable and treating 0 as a valid duration.

astorm avatar Jun 01 '21 21:06 astorm

If we go with both new name and new meaning, we can keep backwards compatibility. I still think it's a decent idea 👍

mikker avatar Jun 02 '21 08:06 mikker

SGTM. Any volunteers to draft a spec?

felixbarny avatar Jun 08 '21 11:06 felixbarny

I could do it, though it won't be for a week or two while I play catch-up.

basepi avatar Jun 08 '21 17:06 basepi

Spec in #454

basepi avatar Jun 21 '21 16:06 basepi

Reopened to use as meta issue

AlexanderWert avatar Oct 20 '21 11:10 AlexanderWert