Package io.opentelemetry.sdk.metrics
Class InstrumentSelector
java.lang.Object
io.opentelemetry.sdk.metrics.InstrumentSelector
- Direct Known Subclasses:
AutoValue_InstrumentSelector
Instrument selection criteria for applying
View
s registered via SdkMeterProviderBuilder.registerView(InstrumentSelector, View)
.
Properties are ANDed together. For example, if getInstrumentName()
is
"http.server.duration" and getMeterName()
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic InstrumentSelectorBuilder
builder()
Returns a newInstrumentSelectorBuilder
forInstrumentSelector
.(package private) static InstrumentSelector
create
(InstrumentType instrumentType, String instrumentName, String instrumentUnit, String meterName, String meterVersion, String meterSchemaUrl) abstract String
Returns the selected instrument name, or null if this selects all instrument names.abstract InstrumentType
Returns the selectedInstrumentType
, or null if this selects all instrument types.abstract String
Returns the selected instrument unit, or null if this selects all instrument units.abstract String
Returns the selected meter name, or null if this selects instruments from all meter names.abstract String
Returns the selected meter schema url, or null if this selects instruments from all meter schema urls.abstract String
Returns the selected meter version, or null if this selects instruments from all meter versions.final String
toString()
-
Constructor Details
-
InstrumentSelector
InstrumentSelector()
-
-
Method Details
-
builder
Returns a newInstrumentSelectorBuilder
forInstrumentSelector
. -
create
-
getInstrumentType
Returns the selectedInstrumentType
, or null if this selects all instrument types. -
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
Returns the selected instrument unit, or null if this selects all instrument units.- Since:
- 1.24.0
-
getMeterName
Returns the selected meter name, or null if this selects instruments from all meter names. -
getMeterVersion
Returns the selected meter version, or null if this selects instruments from all meter versions. -
getMeterSchemaUrl
Returns the selected meter schema url, or null if this selects instruments from all meter schema urls. -
toString
-