Observation so that we can disable the instrumentation
logic.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | NoopObservation.NoopScope
Scope that does nothing. |
| Modifier and Type | Field and Description |
|---|---|
| private static final Observation. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Observation | contextualName(String
contextual name contextualName)Implements io. |
| public Observation | error(Throwable
error error)Implements io. |
| public Observation | event(Observation.
event eventImplements io. Event.
|
| public Observation. | getContext()
Implements io. |
| public Observation | highCardinalityKeyValue(KeyValue
key value keyValue)Implements io. |
| public Observation | highCardinalityKeyValue(String
key key, String value value)Overrides default io. |
| public Observation | lowCardinalityKeyValue(KeyValue
key value keyValue)Implements io. |
| public Observation | lowCardinalityKeyValue(String
key key, String value value)Overrides default io. |
| public Observation | observationConvention(ObservationConvention<?>
observation convention observationConvention)Implements io. |
| public Observation. | openScope()
Implements io. ObservationHandlers such as putting entries in thread local.
|
| public Observation | parentObservation(Observation
parent observation to set parentObservation)Implements io. Observation you can manually set
the parent Observation using this method - that way you won't need to open
scopes just to create a child observation.
|
| public Observation | |
| public void |
| CONTEXT | back to summary |
|---|---|
| private static final Observation. | |
| NoopObservation | back to summary |
|---|---|
| pack-priv NoopObservation() | |
| contextualName | back to summary |
|---|---|
| public Observation contextualName(String contextualName) Implements io. Doc from io. Sets the name that can be defined from the contents of the context. E.g. a span name should not be the default observation name but one coming from an HTTP request.
| |
| error | back to summary |
|---|---|
| public Observation error(Throwable error) Implements io. Doc from io. Signals an error.
| |
| event | back to summary |
|---|---|
| public Observation event(Observation. Implements io. Doc from io. Signals an arbitrary
| |
| getContext | back to summary |
|---|---|
| public Observation. Implements io. Doc from io. Returns the context attached to this observation.
| |
| highCardinalityKeyValue | back to summary |
|---|---|
| public Observation highCardinalityKeyValue(KeyValue keyValue) Implements io. Doc from io. Adds a high cardinality key value. High cardinality means that this key value will have an unbounded number of possible values. An HTTP URL is a good example of such a key value (e.g. /foo/bar, /foo/baz etc.).
| |
| highCardinalityKeyValue | back to summary |
|---|---|
| public Observation highCardinalityKeyValue(String key, String value) Overrides default io. Doc from io. Adds a high cardinality key value. High cardinality means that this key value will have an unbounded number of possible values. An HTTP URL is a good example of such a key value (e.g. /foo/bar, /foo/baz etc.).
| |
| lowCardinalityKeyValue | back to summary |
|---|---|
| public Observation lowCardinalityKeyValue(KeyValue keyValue) Implements io. Doc from io. Adds a low cardinality key value. Low cardinality means that this key value will have a bounded number of possible values. A templated HTTP URL is a good example of such a key value (e.g. /foo/{userId}).
| |
| lowCardinalityKeyValue | back to summary |
|---|---|
| public Observation lowCardinalityKeyValue(String key, String value) Overrides default io. Doc from io. Adds a low cardinality key value. Low cardinality means that this key value will have a bounded number of possible values. A templated HTTP URL is a good example of such a key value (e.g. /foo/{userId}).
| |
| observationConvention | back to summary |
|---|---|
| public Observation observationConvention(ObservationConvention<?> observationConvention) Implements io. Doc from io. Sets an observation convention that can be used to attach key values to the
observation. Implementations should only set the convention when it supports (see:
Warning You must set the ObservationConvention to the Observation before it is started.
| |
| openScope | back to summary |
|---|---|
| public Observation. Implements io. Doc from io. When put in scope, additional operations can take place by the
| |
| parentObservation | back to summary |
|---|---|
| public Observation parentObservation(Observation parentObservation) Implements io. Doc from io. If you have access to a previously created
| |
| start | back to summary |
|---|---|
| public Observation start() Implements io. Doc from io. Starts the observation. Remember to call this method, otherwise timing calculations will not take place.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements io. Doc from io. Stop the observation. Remember to call this method, otherwise timing calculations won't be finished.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Observation. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements io. |
| public Observation | getCurrentObservation()
Implements io. |
| public void | makeCurrent()
Implements io. reset().
|
| public void |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final Observation. Instance of | |
| NoopScope | back to summary |
|---|---|
| private NoopScope() | |
| close | back to summary |
|---|---|
| public void close() Implements io. Doc from io. Clears the current scope and notifies the handlers that the scope was closed. You don't need to call this method manually. If you use try-with-resource, it will call this for you. Please only call this method if you know what you are doing and your use-case demands the usage of it.
| |
| getCurrentObservation | back to summary |
|---|---|
| public Observation getCurrentObservation() Implements io. Doc from io. Current observation available within this scope.
| |
| makeCurrent | back to summary |
|---|---|
| public void makeCurrent() Implements io. Doc from io. This method assumes that all previous scopes got
| |
| reset | back to summary |
|---|---|
| public void reset() Implements io. Doc from io. Resets the current scope. The effect of calling this method should be clearing all related thread local entries. You don't need to call this method in most of the cases. Please only call this method if you know what you are doing and your use-case demands the usage of it.
| |