Class LDObserve
-
- All Implemented Interfaces:
-
com.launchdarkly.observability.interfaces.Observe
public final class LDObserve implements Observe
LDObserve is the singleton entry point for recording observability data such as metrics, logs, errors, and traces. It is recommended to use the Observability plugin with the LaunchDarkly Android Client SDK, as that will automatically initialize the LDObserve singleton instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLDObserve.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static LDObserve.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description LDObserve(ObservabilityClient client)Creates an LDObserve instance with the provided ObservabilityClient.
-
Method Summary
Modifier and Type Method Description UnitrecordMetric(Metric metric)Record a metric value. UnitrecordCount(Metric metric)Record a count metric. UnitrecordIncr(Metric metric)Record an increment metric. UnitrecordHistogram(Metric metric)Record a histogram metric. UnitrecordUpDownCounter(Metric metric)Record an up/down counter metric. UnitrecordError(Error error, Attributes attributes)Record an error. UnitrecordLog(String message, Severity severity, Attributes attributes)Record a log message. SpanstartSpan(String name, Attributes attributes)Start a span. -
-
Constructor Detail
-
LDObserve
LDObserve(ObservabilityClient client)
Creates an LDObserve instance with the provided ObservabilityClient.- Parameters:
client- The ObservabilityClient to which observability data will be forwarded.
-
-
Method Detail
-
recordMetric
Unit recordMetric(Metric metric)
Record a metric value.
- Parameters:
metric- The metric to record
-
recordCount
Unit recordCount(Metric metric)
Record a count metric.
- Parameters:
metric- The count metric to record
-
recordIncr
Unit recordIncr(Metric metric)
Record an increment metric.
- Parameters:
metric- The increment metric to record
-
recordHistogram
Unit recordHistogram(Metric metric)
Record a histogram metric.
- Parameters:
metric- The histogram metric to record
-
recordUpDownCounter
Unit recordUpDownCounter(Metric metric)
Record an up/down counter metric.
- Parameters:
metric- The up/down counter metric to record
-
recordError
Unit recordError(Error error, Attributes attributes)
Record an error.
- Parameters:
error- The error to recordattributes- The attributes to record with the error
-
recordLog
Unit recordLog(String message, Severity severity, Attributes attributes)
Record a log message.
- Parameters:
message- The log message to recordseverity- The severity of the log messageattributes- The attributes to record with the log message
-
-
-
-