Class TraceParams.Builder

java.lang.Object
io.opencensus.trace.config.TraceParams.Builder
Direct Known Subclasses:
AutoValue_TraceParams.Builder
Enclosing class:
TraceParams

public abstract static class TraceParams.Builder extends Object
A Builder class for TraceParams.
Since:
0.5
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setSampler

      public abstract TraceParams.Builder setSampler(Sampler sampler)
      Sets the global default Sampler. It must be not null otherwise build() will throw an exception.
      Parameters:
      sampler - the global default Sampler.
      Returns:
      this.
      Since:
      0.5
    • setMaxNumberOfAttributes

      public abstract TraceParams.Builder setMaxNumberOfAttributes(int maxNumberOfAttributes)
      Sets the global default max number of attributes per Span.
      Parameters:
      maxNumberOfAttributes - the global default max number of attributes per Span. It must be positive otherwise build() will throw an exception.
      Returns:
      this.
      Since:
      0.5
    • setMaxNumberOfAnnotations

      public abstract TraceParams.Builder setMaxNumberOfAnnotations(int maxNumberOfAnnotations)
      Sets the global default max number of Annotation events per Span.
      Parameters:
      maxNumberOfAnnotations - the global default max number of Annotation events per Span. It must be positive otherwise build() will throw an exception.
      Returns:
      this.
      Since:
      0.5
    • setMaxNumberOfMessageEvents

      public abstract TraceParams.Builder setMaxNumberOfMessageEvents(int maxNumberOfMessageEvents)
      Sets the global default max number of MessageEvent events per Span.
      Parameters:
      maxNumberOfMessageEvents - the global default max number of MessageEvent events per Span. It must be positive otherwise build() will throw an exception.
      Returns:
      this.
      Since:
      0.12
    • setMaxNumberOfNetworkEvents

      @Deprecated public TraceParams.Builder setMaxNumberOfNetworkEvents(int maxNumberOfNetworkEvents)
      Sets the global default max number of NetworkEvent events per Span.
      Parameters:
      maxNumberOfNetworkEvents - the global default max number of NetworkEvent events per Span. It must be positive otherwise build() will throw an exception.
      Returns:
      this.
      Since:
      0.5
    • setMaxNumberOfLinks

      public abstract TraceParams.Builder setMaxNumberOfLinks(int maxNumberOfLinks)
      Sets the global default max number of Link entries per Span.
      Parameters:
      maxNumberOfLinks - the global default max number of Link entries per Span. It must be positive otherwise build() will throw an exception.
      Returns:
      this.
      Since:
      0.5
    • autoBuild

      abstract TraceParams autoBuild()
    • build

      public TraceParams build()
      Builds and returns a TraceParams with the desired values.
      Returns:
      a TraceParams with the desired values.
      Throws:
      NullPointerException - if the sampler is null.
      IllegalArgumentException - if any of the max numbers are not positive.
      Since:
      0.5