Class InstrumentSelector

java.lang.Object
io.opentelemetry.sdk.metrics.InstrumentSelector

@Immutable public abstract class InstrumentSelector extends Object
Instrument selection criteria for applying Views 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
  • Method Details

    • builder

      public static InstrumentSelectorBuilder builder()
    • getInstrumentType

      @Nullable public abstract InstrumentType getInstrumentType()
      Returns the selected InstrumentType, or null if this selects all instrument types.
    • getInstrumentName

      @Nullable public abstract 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
    • getMeterName

      @Nullable public abstract String getMeterName()
      Returns the selected meter name, or null if this selects instruments from all meter names.
    • getMeterVersion

      @Nullable public abstract String getMeterVersion()
      Returns the selected meter version, or null if this selects instruments from all meter versions.
    • getMeterSchemaUrl

      @Nullable public abstract String getMeterSchemaUrl()
      Returns the selected meter schema url, or null if this selects instruments from all meter schema urls.
    • toString

      public final String toString()
      Overrides:
      toString in class Object