introduced plural forms of the *Prefix trace options
@@ -129,24 +129,63 @@ func WithCodeLocation(loc *CodeLocation) TraceOption {
//
// If no prefix strings are passed here, the configured defaults will be used.
//
+// Deprecated: New code should use WithIgnoredPrefixes instead.
+//
func WithIgnoredPrefix(prefix ...string) TraceOption {
return func(o *traceOptSet) {
o.IgnoredPrefixes = prefix
}
}
+//
+// WithIgnoredPrefixes indicates that the code location reported
+// for Code Level Metrics should be the first function in the
+// call stack that does not begin with the given string (or any of the given strings if more than one are given). This
+// string is matched against the entire fully-qualified function
+// name, which includes the name of the package the function
+// comes from. By default, the Go Agent tries to take the first
+// function on the call stack that doesn't seem to be internal to
+// the agent itself, but you can control this behavior using
+// this option.
+//
+// If all functions in the call stack begin with this prefix,
+// the outermost one will be used anyway, since we didn't find
+// anything better on the way to the bottom of the stack.
+//
+// If no prefix strings are passed here, the configured defaults will be used.
+//
+func WithIgnoredPrefixes(prefix ...string) TraceOption {
+ return func(o *traceOptSet) {
+ o.IgnoredPrefixes = prefix
+ }
+}
+
//
// WithPathPrefix overrides the list of source code path prefixes
// used to trim source file pathnames, providing a new set of one
// or more path prefixes to use for this trace only.
// If no strings are given, the configured defaults will be used.
//
+// Deprecated: New code should use WithPathPrefixes instead.
+//
func WithPathPrefix(prefix ...string) TraceOption {
return func(o *traceOptSet) {
o.PathPrefixes = prefix
}
}
+//
+// WithPathPrefixes overrides the list of source code path prefixes
+// used to trim source file pathnames, providing a new set of one
+// or more path prefixes to use for this trace only.
+// If no strings are given, the configured defaults will be used.
+//
+func WithPathPrefixes(prefix ...string) TraceOption {
+ return func(o *traceOptSet) {
+ o.PathPrefixes = prefix
+ }
+}
+
//
// WithoutCodeLevelMetrics suppresses the collection and reporting
// of Code Level Metrics for this trace. This helps avoid the overhead
