io.opentelemetry.javaagent.instrumentation.vertx.client.AbstractVertxHttpAttributesGetter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-javaagent-vertx-http-client-common Show documentation
Show all versions of opentelemetry-javaagent-vertx-http-client-common Show documentation
Instrumentation of Java libraries using OpenTelemetry.
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.javaagent.instrumentation.vertx.client;
import io.opentelemetry.instrumentation.api.semconv.http.HttpClientAttributesGetter;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
import java.util.List;
import javax.annotation.Nullable;
public abstract class AbstractVertxHttpAttributesGetter
implements HttpClientAttributesGetter {
@Override
public List getHttpRequestHeader(HttpClientRequest request, String name) {
return request.headers().getAll(name);
}
@Override
public Integer getHttpResponseStatusCode(
HttpClientRequest request, HttpClientResponse response, @Nullable Throwable error) {
return response.statusCode();
}
@Override
public List getHttpResponseHeader(
HttpClientRequest request, HttpClientResponse response, String name) {
return response.headers().getAll(name);
}
}