Package com.newrelic.telemetry.metrics
Class MetricBatch.Builder
- java.lang.Object
-
- com.newrelic.telemetry.metrics.MetricBatch.Builder
-
- Enclosing class:
- MetricBatch
public static class MetricBatch.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricBatch.Builder
attributes(Attributes attributes)
Provides the core set of common attributes to be used with all metrics in the batch.MetricBatch
build()
Builds the metric batchMetricBatch.Builder
instrumentationProvider(java.lang.String instrumentationProvider)
Optional.MetricBatch.Builder
metrics(java.util.Collection<Metric> metrics)
Provides the collection of metrics contained within the metric batch.MetricBatch.Builder
serviceName(java.lang.String serviceName)
Optional.
-
-
-
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
-
-