Package io.opentelemetry.sdk.common
Class InstrumentationLibraryInfo
- java.lang.Object
-
- io.opentelemetry.sdk.common.InstrumentationLibraryInfo
-
@Immutable public abstract class InstrumentationLibraryInfo extends java.lang.Object
Holds information about the instrumentation library specified when creating an instance ofTracer
using the Tracer Provider.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static InstrumentationLibraryInfo
create(java.lang.String name, java.lang.String version)
Creates a new instance ofInstrumentationLibraryInfo
.static InstrumentationLibraryInfo
empty()
Returns an "empty"InstrumentationLibraryInfo
.abstract java.lang.String
getName()
Returns the name of the instrumentation library.abstract java.lang.String
getVersion()
Returns the version of the instrumentation library, ornull
if not available.
-
-
-
Method Detail
-
create
public static InstrumentationLibraryInfo create(java.lang.String name, @Nullable java.lang.String version)
Creates a new instance ofInstrumentationLibraryInfo
.- Parameters:
name
- name of the instrumentation library (e.g., "io.opentelemetry.contrib.mongodb"), must not be nullversion
- version of the instrumentation library (e.g., "1.0.0"), might be null- Returns:
- the new instance
-
empty
public static InstrumentationLibraryInfo empty()
Returns an "empty"InstrumentationLibraryInfo
.- Returns:
- an "empty"
InstrumentationLibraryInfo
.
-
getName
public abstract java.lang.String getName()
Returns the name of the instrumentation library.- Returns:
- the name of the instrumentation library.
-
getVersion
@Nullable public abstract java.lang.String getVersion()
Returns the version of the instrumentation library, ornull
if not available.- Returns:
- the version of the instrumentation library, or
null
if not available.
-
-