Class MetricBatch.Builder

  • Enclosing class:
    MetricBatch

    public static class MetricBatch.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • serviceName

        public MetricBatch.Builder serviceName​(java.lang.String serviceName)
        Optional. Specify the name of the service that is creating the metrics. The service name will be included in all common attributes.
        Parameters:
        serviceName - - The name of the service
      • instrumentationProvider

        public MetricBatch.Builder instrumentationProvider​(java.lang.String instrumentationProvider)
        Optional. Specify the name of the instrumentation library that provides the metrics (such as "micrometer" or "dropwizard-metrics" or "kamon"). The instrumentation provider will be included in all common attributes as "instrumentation.provider".
        Parameters:
        instrumentationProvider - - The instrumentation provider name
      • attributes

        public MetricBatch.Builder attributes​(Attributes attributes)
        Provides the core set of common attributes to be used with all metrics in the batch.
        Parameters:
        attributes - - the set of common attributes to use for all metrics.
        Returns:
        this builder
      • metrics

        public MetricBatch.Builder metrics​(java.util.Collection<Metric> metrics)
        Provides the collection of metrics contained within the metric batch.
        Parameters:
        metrics - - the collection of new relic metrics
        Returns:
        this builder
      • build

        public MetricBatch build()
        Builds the metric batch
        Returns:
        A new MetricBatch instance configured with data from this builder