Package org.springframework.http.client.observation

# Class DefaultClientRequestObservationConvention

java.lang.Object
org.springframework.http.client.observation.DefaultClientRequestObservationConvention

All Implemented Interfaces:
  `io.micrometer.observation.KeyValuesConvention`, `io.micrometer.observation.ObservationConvention<ClientRequestObservationContext>`, `ClientRequestObservationConvention`

public class DefaultClientRequestObservationConvention extends Object implements ClientRequestObservationConvention
Default implementation for a `ClientRequestObservationConvention`, extracting information from the `ClientRequestObservationContext`.

Since:
  6.0
Author:
  Brian Clozel

## Field Summary

### Fields inherited from interface io.micrometer.observation.ObservationConvention

`EMPTY`

## Constructor Summary

Constructors
Constructor
Description
`DefaultClientRequestObservationConvention()`
Create a convention with the default name `"http.client.requests"`.
`DefaultClientRequestObservationConvention(String name)`
Create a convention with a custom name.

## Method Summary

Modifier and Type
Method
Description
`protected io.micrometer.common.KeyValue`
`clientName(ClientRequestObservationContext context)`
`protected io.micrometer.common.KeyValue`
`exception(ClientRequestObservationContext context)`
`String`
`getContextualName(ClientRequestObservationContext context)`
`io.micrometer.common.KeyValues`
`getHighCardinalityKeyValues(ClientRequestObservationContext context)`
`io.micrometer.common.KeyValues`
`getLowCardinalityKeyValues(ClientRequestObservationContext context)`
`String`
`getName()`
`protected io.micrometer.common.KeyValue`
`method(ClientRequestObservationContext context)`
`protected io.micrometer.common.KeyValue`
`outcome(ClientRequestObservationContext context)`
`protected io.micrometer.common.KeyValue`
`requestUri(ClientRequestObservationContext context)`
`protected io.micrometer.common.KeyValue`
`status(ClientRequestObservationContext context)`
`protected io.micrometer.common.KeyValue`
`uri(ClientRequestObservationContext context)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.http.client.observation.ClientRequestObservationConvention

`supportsContext`

## Constructor Details

### DefaultClientRequestObservationConvention

public DefaultClientRequestObservationConvention()
Create a convention with the default name `"http.client.requests"`.

### DefaultClientRequestObservationConvention

public DefaultClientRequestObservationConvention(String name)
Create a convention with a custom name.

Parameters:
  `name` - the observation name

## Method Details

### getName

public String getName()

Specified by:
  `getName` in interface `io.micrometer.observation.ObservationConvention<ClientRequestObservationContext>`

### getContextualName

@Nullable public String getContextualName(ClientRequestObservationContext context)

Specified by:
  `getContextualName` in interface `io.micrometer.observation.ObservationConvention<ClientRequestObservationContext>`

### getLowCardinalityKeyValues

public io.micrometer.common.KeyValues getLowCardinalityKeyValues(ClientRequestObservationContext context)

Specified by:
  `getLowCardinalityKeyValues` in interface `io.micrometer.observation.ObservationConvention<ClientRequestObservationContext>`

### uri

protected io.micrometer.common.KeyValue uri(ClientRequestObservationContext context)

### method

protected io.micrometer.common.KeyValue method(ClientRequestObservationContext context)

### status

protected io.micrometer.common.KeyValue status(ClientRequestObservationContext context)

### clientName

protected io.micrometer.common.KeyValue clientName(ClientRequestObservationContext context)

### exception

protected io.micrometer.common.KeyValue exception(ClientRequestObservationContext context)

### outcome

protected io.micrometer.common.KeyValue outcome(ClientRequestObservationContext context)

### getHighCardinalityKeyValues

public io.micrometer.common.KeyValues getHighCardinalityKeyValues(ClientRequestObservationContext context)

Specified by:
  `getHighCardinalityKeyValues` in interface `io.micrometer.observation.ObservationConvention<ClientRequestObservationContext>`

### requestUri

protected io.micrometer.common.KeyValue requestUri(ClientRequestObservationContext context)