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.ObjectInstrument selection criteria for applyingViews 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 InstrumentSelectorBuilderbuilder()Returns a newInstrumentSelectorBuilderforInstrumentSelector.(package private) static InstrumentSelectorcreate(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.StringgetInstrumentName()Returns the selected instrument name, or null if this selects all instrument names.abstract InstrumentTypegetInstrumentType()Returns the selectedInstrumentType, or null if this selects all instrument types.abstract java.lang.StringgetInstrumentUnit()Returns the selected instrument unit, or null if this selects all instrument units.abstract java.lang.StringgetMeterName()Returns the selected meter name, or null if this selects instruments from all meter names.abstract java.lang.StringgetMeterSchemaUrl()Returns the selected meter schema url, or null if this selects instruments from all meter schema urls.abstract java.lang.StringgetMeterVersion()Returns the selected meter version, or null if this selects instruments from all meter versions.java.lang.StringtoString()
-
-
-
Method Detail
-
builder
public static InstrumentSelectorBuilder builder()
Returns a newInstrumentSelectorBuilderforInstrumentSelector.
-
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:
toStringin classjava.lang.Object
-
-