Package io.opentelemetry.sdk.metrics
Class InstrumentSelector
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.InstrumentSelector
-
- Direct Known Subclasses:
AutoValue_InstrumentSelector
@Immutable public abstract class InstrumentSelector extends java.lang.Object
Instrument selection criteria for applyingView
s registered viaSdkMeterProviderBuilder.registerView(InstrumentSelector, View)
.Properties are ANDed together. For example, if
getInstrumentName()
is "http.server.duration" andgetMeterName()
is "my.http.meter", then instruments are selected where name is "http.server.duration" AND meter name is "my.http.meter".- Since:
- 1.14.0
-
-
Constructor Summary
Constructors Constructor Description InstrumentSelector()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static InstrumentSelectorBuilder
builder()
Returns a newInstrumentSelectorBuilder
forInstrumentSelector
.(package private) static InstrumentSelector
create(InstrumentType instrumentType, java.lang.String instrumentName, java.lang.String instrumentUnit, java.lang.String meterName, java.lang.String meterVersion, java.lang.String meterSchemaUrl)
abstract java.lang.String
getInstrumentName()
Returns the selected instrument name, or null if this selects all instrument names.abstract InstrumentType
getInstrumentType()
Returns the selectedInstrumentType
, or null if this selects all instrument types.abstract java.lang.String
getInstrumentUnit()
Returns the selected instrument unit, or null if this selects all instrument units.abstract java.lang.String
getMeterName()
Returns the selected meter name, or null if this selects instruments from all meter names.abstract java.lang.String
getMeterSchemaUrl()
Returns the selected meter schema url, or null if this selects instruments from all meter schema urls.abstract java.lang.String
getMeterVersion()
Returns the selected meter version, or null if this selects instruments from all meter versions.java.lang.String
toString()
-
-
-
Method Detail
-
builder
public static InstrumentSelectorBuilder builder()
Returns a newInstrumentSelectorBuilder
forInstrumentSelector
.
-
create
static InstrumentSelector create(@Nullable InstrumentType instrumentType, @Nullable java.lang.String instrumentName, @Nullable java.lang.String instrumentUnit, @Nullable java.lang.String meterName, @Nullable java.lang.String meterVersion, @Nullable java.lang.String meterSchemaUrl)
-
getInstrumentType
@Nullable public abstract InstrumentType getInstrumentType()
Returns the selectedInstrumentType
, or null if this selects all instrument types.
-
getInstrumentName
@Nullable public abstract java.lang.String getInstrumentName()
Returns the selected instrument name, or null if this selects all instrument names.Instrument name may contain the wildcard characters
*
and?
with the following matching criteria:*
matches 0 or more instances of any character?
matches exactly one instance of any character
-
getInstrumentUnit
@Nullable public abstract java.lang.String getInstrumentUnit()
Returns the selected instrument unit, or null if this selects all instrument units.- Since:
- 1.24.0
-
getMeterName
@Nullable public abstract java.lang.String getMeterName()
Returns the selected meter name, or null if this selects instruments from all meter names.
-
getMeterVersion
@Nullable public abstract java.lang.String getMeterVersion()
Returns the selected meter version, or null if this selects instruments from all meter versions.
-
getMeterSchemaUrl
@Nullable public abstract java.lang.String getMeterSchemaUrl()
Returns the selected meter schema url, or null if this selects instruments from all meter schema urls.
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-