ThreadLocalAccessor to put and restore current Observation.
| Modifier and Type | Field and Description |
|---|---|
| private static ObservationThreadLocalAccessor | |
| public static final String | KEY
Key under which Micrometer Observation is being registered. |
| private static final InternalLogger | |
| private ObservationRegistry | observationRegistry
The default implementation of |
| Access | Constructor and Description |
|---|---|
| public | ObservationThreadLocalAccessor()
Creates a new instance of this class and stores a static handle to it. |
| public | ObservationThreadLocalAccessor(ObservationRegistry
observation registry observationRegistry)Creates a new instance of this class. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| private void | |
| public static ObservationThreadLocalAccessor | |
| public ObservationRegistry | |
| public Observation | getValue()
Implements io. ThreadLocal value.
|
| public Object | key()
Implements io. ContextSnapshot.
|
| public void | reset()
Overrides default io.
Deprecated
Remove the ThreadLocal value when setting ThreadLocal values in
case of missing mapping for a key() from a ContextSnapshot, or a
Context object (operated upon by ContextAccessor).
|
| public void | restore()
Overrides default io. restore(Object) when there was no ThreadLocal
value existing at the start of the scope.
|
| public void | restore(Observation
previous value to set, never value)null when called from a
ContextSnapshot * implementation, which is not allowed to store mappings to
null.Overrides default io. ThreadLocal at the end of a
io.
|
| public void | setObservationRegistry(ObservationRegistry
observation registry observationRegistry)Provide an |
| public void | setValue(Observation
the value to set, never value)null when called from a
ContextSnapshot implementation, which is not allowed to store mappings to
null.Implements io. ThreadLocal at the start of a
io.
|
| public void | setValue()
Overrides default io. setValue(Object) in order to remove the current
ThreadLocal value at the start of a
io.
|
| instance | back to summary |
|---|---|
| private static ObservationThreadLocalAccessor instance | |
| KEY | back to summary |
|---|---|
| public static final String KEY Key under which Micrometer Observation is being registered. | |
| log | back to summary |
|---|---|
| private static final InternalLogger log | |
| observationRegistry | back to summary |
|---|---|
| private ObservationRegistry observationRegistry The default implementation of | |
| ObservationThreadLocalAccessor | back to summary |
|---|---|
| public ObservationThreadLocalAccessor() Creates a new instance of this class and stores a static handle to it. Remember to
call | |
| ObservationThreadLocalAccessor | back to summary |
|---|---|
| public ObservationThreadLocalAccessor(ObservationRegistry observationRegistry) Creates a new instance of this class.
| |
| assertFalse | back to summary |
|---|---|
| pack-priv void assertFalse(String msg) | |
| closeCurrentScope | back to summary |
|---|---|
| private void closeCurrentScope() | |
| getInstance | back to summary |
|---|---|
| public static ObservationThreadLocalAccessor getInstance() Return the singleton instance of this
| |
| getObservationRegistry | back to summary |
|---|---|
| public ObservationRegistry getObservationRegistry() Returns the provided
| |
| getValue | back to summary |
|---|---|
| public Observation getValue() Implements io. Doc from io. Return the current This method is called in two scenarios:
| |
| key | back to summary |
|---|---|
| public Object key() Implements io. Doc from io. The key to associate with the ThreadLocal value when saved within a
| |
| reset | back to summary |
|---|---|
| public void reset() Overrides default io. Doc from io. Deprecated
Remove the
| |
| restore | back to summary |
|---|---|
| public void restore() Overrides default io. Doc from io. Called instead of
| |
| restore | back to summary |
|---|---|
| public void restore(Observation value) Overrides default io. Doc from io. Restore the
| |
| setObservationRegistry | back to summary |
|---|---|
| public void setObservationRegistry(ObservationRegistry observationRegistry) Provide an
| |
| setValue | back to summary |
|---|---|
| public void setValue(Observation value) Implements io. Doc from io. Set the
| |
| setValue | back to summary |
|---|---|
| public void setValue() Overrides default io. Doc from io. Called instead of
| |