Search in sources :

Example 1 with OkHttpBraveIntegration

use of io.crnk.monitor.brave.internal.OkHttpBraveIntegration in project crnk-framework by crnk-project.

the class BraveModule method setHttpAdapter.

@Override
public void setHttpAdapter(HttpAdapter adapter) {
    if (adapter instanceof OkHttpAdapter) {
        OkHttpAdapter okHttpAdapter = (OkHttpAdapter) adapter;
        okHttpAdapter.addListener(new OkHttpBraveIntegration(brave));
    } else if (adapter instanceof HttpClientAdapter) {
        HttpClientAdapter okHttpAdapter = (HttpClientAdapter) adapter;
        okHttpAdapter.addListener(new HttpClientBraveIntegration(brave, spanNameProvider));
    } else {
        throw new IllegalArgumentException(adapter.getClass() + " not supported yet");
    }
}
Also used : HttpClientAdapter(io.crnk.client.http.apache.HttpClientAdapter) OkHttpAdapter(io.crnk.client.http.okhttp.OkHttpAdapter) OkHttpBraveIntegration(io.crnk.monitor.brave.internal.OkHttpBraveIntegration) HttpClientBraveIntegration(io.crnk.monitor.brave.internal.HttpClientBraveIntegration)

Aggregations

HttpClientAdapter (io.crnk.client.http.apache.HttpClientAdapter)1 OkHttpAdapter (io.crnk.client.http.okhttp.OkHttpAdapter)1 HttpClientBraveIntegration (io.crnk.monitor.brave.internal.HttpClientBraveIntegration)1 OkHttpBraveIntegration (io.crnk.monitor.brave.internal.OkHttpBraveIntegration)1