Package com.newrelic.telemetry.metrics
Class MetricBuffer.Builder
- java.lang.Object
-
- com.newrelic.telemetry.metrics.MetricBuffer.Builder
-
- Enclosing class:
- MetricBuffer
public static class MetricBuffer.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricBuffer.Builder
attributes(Attributes attributes)
Provides the base collection of common attributes that will be applied to all buffered metrics.MetricBuffer
build()
Builds the new MetricBuffer instanceMetricBuffer.Builder
instrumentationProvider(java.lang.String instrumentationProvider)
Optional.MetricBuffer.Builder
serviceName(java.lang.String serviceName)
Optional.
-
-
-
Method Detail
-
attributes
public MetricBuffer.Builder attributes(Attributes attributes)
Provides the base collection of common attributes that will be applied to all buffered metrics.- Parameters:
attributes
- - common attributes to be applied to all metrics within this buffer- Returns:
- this builder
-
serviceName
public MetricBuffer.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 as "service.name".- Parameters:
serviceName
- - The name of the service
-
instrumentationProvider
public MetricBuffer.Builder instrumentationProvider(java.lang.String instrumentationProvider)
Optional. Specify the name of the instrumentation that provides the metrics, typically a library like "micrometer" or "dropwizard-metrics" or "kamon", for example. This is generally not expected to be called by a user's manual instrumentation code. The instrumentation provider will be included in all common attributes as "instrumentation.provider".- Parameters:
instrumentationProvider
- - The name of the instrumentation library
-
build
public MetricBuffer build()
Builds the new MetricBuffer instance- Returns:
- a newly created instance of MetricBuffer configured with data from this builder
-
-