Package io.opentelemetry.sdk.common
Class InstrumentationLibraryInfo
java.lang.Object
io.opentelemetry.sdk.common.InstrumentationLibraryInfo
Holds information about the instrumentation library specified when creating an instance of
Tracer
using the Tracer Provider.-
Method Summary
Modifier and TypeMethodDescriptionstatic InstrumentationLibraryInfo
Creates a new instance ofInstrumentationLibraryInfo
.static InstrumentationLibraryInfo
Creates a new instance ofInstrumentationLibraryInfo
.static InstrumentationLibraryInfo
empty()
Returns an "empty"InstrumentationLibraryInfo
.abstract String
getName()
Returns the name of the instrumentation library.abstract String
Returns the URL of the schema used by this instrumentation library, ornull
if not available.abstract String
Returns the version of the instrumentation library, ornull
if not available.
-
Method Details
-
create
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
-
create
public static InstrumentationLibraryInfo create(String name, @Nullable String version, @Nullable String schemaUrl) 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 nullschemaUrl
- the URL of the OpenTelemetry schema being used by this instrumentation library.- Returns:
- the new instance
- Since:
- 1.4.0
-
empty
Returns an "empty"InstrumentationLibraryInfo
.- Returns:
- an "empty"
InstrumentationLibraryInfo
.
-
getName
Returns the name of the instrumentation library.- Returns:
- the name of the instrumentation library.
-
getVersion
Returns the version of the instrumentation library, ornull
if not available.- Returns:
- the version of the instrumentation library, or
null
if not available.
-
getSchemaUrl
Returns the URL of the schema used by this instrumentation library, ornull
if not available.- Returns:
- the URL of the schema used by this instrumentation library, or
null
if not available.
-