- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.nike.wingtips.tags.ZipkinHttpTagStrategy
类的一些代码示例,展示了ZipkinHttpTagStrategy
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipkinHttpTagStrategy
类的具体详情如下:
包路径:com.nike.wingtips.tags.ZipkinHttpTagStrategy
类名称:ZipkinHttpTagStrategy
[英]Applies Zipkin standard tags for:
http.method
http.path
http.url
http.route
http.status_code
error
The following known Zipkin tags are unimplemented in this strategy:
http.request.size
http.response.size
http.host
[中]将Zipkin标准标记应用于:
*http。方法
*http。路径
*http。网址
*http。路线
*http。状态代码
*错误
以下已知的Zipkin标签在此策略中未实现:
*http。要求大小
*http。回答大小
*http。主办
代码示例来源:origin: Nike-Inc/wingtips
/**
* @return {@link ZipkinHttpTagStrategy#getDefaultInstance()}.
*/
protected HttpTagAndSpanNamingStrategy<HttpServletRequest, HttpServletResponse> getZipkinHttpTagStrategy() {
return ZipkinHttpTagStrategy.getDefaultInstance();
}
代码示例来源:origin: Nike-Inc/wingtips
@Override
protected void doHandleResponseAndErrorTagging(
@NotNull Span span,
@Nullable REQ request,
@Nullable RES response,
@Nullable Throwable error,
@NotNull HttpTagAndSpanNamingAdapter<REQ, RES> adapter
) {
// Now that we have both request and response, we'll re-try to get the route.
putTagIfValueIsNotBlank(span, KnownZipkinTags.HTTP_ROUTE, adapter.getRequestUriPathTemplate(request, response));
putTagIfValueIsNotBlank(span, KnownZipkinTags.HTTP_STATUS_CODE, adapter.getResponseHttpStatus(response));
// For error tagging, we'll defer to the error Throwable if it's not null.
if (error != null) {
String message = error.getMessage();
if (message == null) {
message = error.getClass().getSimpleName();
}
addErrorTagToSpan(span, message);
}
else {
// The error Throwable was null, so we'll see if the adapter thinks this is an error response.
String errorTagValue = adapter.getErrorResponseTagValue(response);
if (StringUtils.isNotBlank(errorTagValue)) {
addErrorTagToSpan(span, errorTagValue);
}
}
}
代码示例来源:origin: Nike-Inc/wingtips
@Test
public void doHandleRequestTagging_puts_expected_tags_based_on_adapter_results() {
// given
String adapterHttpMethod = "httpmethod-" + UUID.randomUUID().toString();
String adapterPath = "path-" + UUID.randomUUID().toString();
String adapterHttpUrl = "url-" + UUID.randomUUID().toString();
String adapterRoute = "route-" + UUID.randomUUID().toString();
doReturn(adapterHttpMethod).when(adapterMock).getRequestHttpMethod(anyObject());
doReturn(adapterPath).when(adapterMock).getRequestPath(anyObject());
doReturn(adapterHttpUrl).when(adapterMock).getRequestUrl(anyObject());
doReturn(adapterRoute).when(adapterMock).getRequestUriPathTemplate(anyObject(), anyObject());
// when
implSpy.doHandleRequestTagging(spanMock, requestMock, adapterMock);
// then
verify(adapterMock).getRequestHttpMethod(requestMock);
verify(adapterMock).getRequestPath(requestMock);
verify(adapterMock).getRequestUrl(requestMock);
verify(adapterMock).getRequestUriPathTemplate(requestMock, null);
verify(implSpy).putTagIfValueIsNotBlank(spanMock, KnownZipkinTags.HTTP_METHOD, adapterHttpMethod);
verify(implSpy).putTagIfValueIsNotBlank(spanMock, KnownZipkinTags.HTTP_PATH, adapterPath);
verify(implSpy).putTagIfValueIsNotBlank(spanMock, KnownZipkinTags.HTTP_URL, adapterHttpUrl);
verify(implSpy).putTagIfValueIsNotBlank(spanMock, KnownZipkinTags.HTTP_ROUTE, adapterRoute);
}
代码示例来源:origin: Nike-Inc/wingtips
implSpy.doHandleResponseAndErrorTagging(spanMock, requestMock, responseMock, scenario.error, adapterMock);
verify(adapterMock).getResponseHttpStatus(responseMock);
verify(implSpy).putTagIfValueIsNotBlank(spanMock, KnownZipkinTags.HTTP_ROUTE, adapterRoute);
verify(implSpy).putTagIfValueIsNotBlank(spanMock, KnownZipkinTags.HTTP_STATUS_CODE, adapterHttpStatus);
verify(implSpy).putTagIfValueIsNotBlank(spanMock, KnownZipkinTags.ERROR, scenario.expectedErrorTagValue);
代码示例来源:origin: Nike-Inc/wingtips
@SuppressWarnings("WeakerAccess")
protected void addErrorTagToSpan(Span span, String errorTagValue) {
putTagIfValueIsNotBlank(span, KnownZipkinTags.ERROR, errorTagValue);
}
}
代码示例来源:origin: Nike-Inc/wingtips
@Before
public void beforeMethod() {
implSpy = spy(new ZipkinHttpTagStrategy<>());
spanMock = mock(Span.class);
requestMock = mock(Object.class);
responseMock = mock(Object.class);
errorMock = mock(Throwable.class);
adapterMock = mock(HttpTagAndSpanNamingAdapter.class);
}
代码示例来源:origin: Nike-Inc/wingtips
@Override
protected void doHandleRequestTagging(
@NotNull Span span,
@NotNull REQ request,
@NotNull HttpTagAndSpanNamingAdapter<REQ, ?> adapter
) {
putTagIfValueIsNotBlank(span, KnownZipkinTags.HTTP_METHOD, adapter.getRequestHttpMethod(request));
putTagIfValueIsNotBlank(span, KnownZipkinTags.HTTP_PATH, adapter.getRequestPath(request));
putTagIfValueIsNotBlank(span, KnownZipkinTags.HTTP_URL, adapter.getRequestUrl(request));
putTagIfValueIsNotBlank(span, KnownZipkinTags.HTTP_ROUTE, adapter.getRequestUriPathTemplate(request, null));
}
代码示例来源:origin: com.nike.riposte/riposte-core
/**
* Creates a new instance that uses {@link ZipkinHttpTagStrategy#getDefaultInstance()} and {@link
* RiposteWingtipsNettyClientTagAdapter#getDefaultInstance()} to do the work of span naming and tagging.
*/
public DefaultRiposteProxyRouterSpanNamingAndTaggingStrategy() {
this(ZipkinHttpTagStrategy.getDefaultInstance(), RiposteWingtipsNettyClientTagAdapter.getDefaultInstance());
}
代码示例来源:origin: com.nike.riposte/riposte-core
/**
* Creates a new instance that uses {@link ZipkinHttpTagStrategy#getDefaultInstance()} and {@link
* RiposteWingtipsServerTagAdapter#getDefaultInstance()} to do the work of span naming and tagging.
*/
public DefaultRiposteServerSpanNamingAndTaggingStrategy() {
this(ZipkinHttpTagStrategy.getDefaultInstance(), RiposteWingtipsServerTagAdapter.getDefaultInstance());
}
代码示例来源:origin: Nike-Inc/riposte
/**
* Creates a new instance that uses {@link ZipkinHttpTagStrategy#getDefaultInstance()} and {@link
* RiposteWingtipsServerTagAdapter#getDefaultInstance()} to do the work of span naming and tagging.
*/
public DefaultRiposteServerSpanNamingAndTaggingStrategy() {
this(ZipkinHttpTagStrategy.getDefaultInstance(), RiposteWingtipsServerTagAdapter.getDefaultInstance());
}
代码示例来源:origin: Nike-Inc/riposte
/**
* Creates a new instance that uses {@link ZipkinHttpTagStrategy#getDefaultInstance()} and {@link
* AsyncHttpClientHelperTagAdapter#getDefaultInstance()} to do the work of span naming and tagging.
*/
public DefaultAsyncHttpClientHelperSpanNamingAndTaggingStrategy() {
this(ZipkinHttpTagStrategy.getDefaultInstance(), AsyncHttpClientHelperTagAdapter.getDefaultInstance());
}
代码示例来源:origin: Nike-Inc/riposte
/**
* Creates a new instance that uses {@link ZipkinHttpTagStrategy#getDefaultInstance()} and {@link
* RiposteWingtipsNettyClientTagAdapter#getDefaultInstance()} to do the work of span naming and tagging.
*/
public DefaultRiposteProxyRouterSpanNamingAndTaggingStrategy() {
this(ZipkinHttpTagStrategy.getDefaultInstance(), RiposteWingtipsNettyClientTagAdapter.getDefaultInstance());
}
代码示例来源:origin: Nike-Inc/wingtips
/**
* Creates a new instance with the subspan option set to the value of the {@code surroundCallsWithSubspan}
* argument, and the default {@link HttpTagAndSpanNamingStrategy} and {@link HttpTagAndSpanNamingAdapter}
* ({@link ZipkinHttpTagStrategy} and {@link ApacheHttpClientTagAdapter}).
*
* @param surroundCallsWithSubspan Pass in true to have requests surrounded in a subspan, false to disable the
* subspan option.
*/
public WingtipsHttpClientBuilder(boolean surroundCallsWithSubspan) {
this(
surroundCallsWithSubspan,
ZipkinHttpTagStrategy.<HttpRequest, HttpResponse>getDefaultInstance(),
ApacheHttpClientTagAdapter.getDefaultInstance()
);
}
代码示例来源:origin: Nike-Inc/wingtips
/**
* Constructor that lets you choose whether downstream calls will be surrounded with a subspan. The default
* {@link HttpTagAndSpanNamingStrategy} and {@link HttpTagAndSpanNamingAdapter} will be used
* ({@link ZipkinHttpTagStrategy} and {@link SpringHttpClientTagAdapter}).
*
* @param surroundCallsWithSubspan pass in true to have downstream calls surrounded with a new span, false to only
* propagate the current span's info downstream (no subspan).
*/
public WingtipsAsyncClientHttpRequestInterceptor(boolean surroundCallsWithSubspan) {
this(
surroundCallsWithSubspan,
ZipkinHttpTagStrategy.<HttpRequest, ClientHttpResponse>getDefaultInstance(),
SpringHttpClientTagAdapter.getDefaultInstance()
);
}
代码示例来源:origin: Nike-Inc/wingtips
/**
* Creates a new instance with the subspan option set to the value of the {@code surroundCallsWithSubspan}
* argument, and the default {@link HttpTagAndSpanNamingStrategy} and {@link HttpTagAndSpanNamingAdapter}
* ({@link ZipkinHttpTagStrategy} and {@link ApacheHttpClientTagAdapter}).
*
* @param surroundCallsWithSubspan Pass in true to have requests surrounded in a subspan, false to disable the
* subspan option.
*/
public WingtipsApacheHttpClientInterceptor(boolean surroundCallsWithSubspan) {
this(
surroundCallsWithSubspan,
ZipkinHttpTagStrategy.<HttpRequest, HttpResponse>getDefaultInstance(),
ApacheHttpClientTagAdapter.getDefaultInstance()
);
}
代码示例来源:origin: Nike-Inc/wingtips
/**
* Constructor that lets you choose whether downstream calls will be surrounded with a subspan. The default
* {@link HttpTagAndSpanNamingStrategy} and {@link HttpTagAndSpanNamingAdapter} will be used
* ({@link ZipkinHttpTagStrategy} and {@link SpringHttpClientTagAdapter}).
*
* @param surroundCallsWithSubspan pass in true to have downstream calls surrounded with a new span, false to only
* propagate the current span's info downstream (no subspan).
*/
public WingtipsClientHttpRequestInterceptor(boolean surroundCallsWithSubspan) {
this(
surroundCallsWithSubspan,
ZipkinHttpTagStrategy.<HttpRequest, ClientHttpResponse>getDefaultInstance(),
SpringHttpClientTagAdapter.getDefaultInstance()
);
}
代码示例来源:origin: com.nike.wingtips/wingtips-spring
/**
* Constructor that lets you choose whether downstream calls will be surrounded with a subspan. The default
* {@link HttpTagAndSpanNamingStrategy} and {@link HttpTagAndSpanNamingAdapter} will be used
* ({@link ZipkinHttpTagStrategy} and {@link SpringHttpClientTagAdapter}).
*
* @param surroundCallsWithSubspan pass in true to have downstream calls surrounded with a new span, false to only
* propagate the current span's info downstream (no subspan).
*/
public WingtipsClientHttpRequestInterceptor(boolean surroundCallsWithSubspan) {
this(
surroundCallsWithSubspan,
ZipkinHttpTagStrategy.<HttpRequest, ClientHttpResponse>getDefaultInstance(),
SpringHttpClientTagAdapter.getDefaultInstance()
);
}
代码示例来源:origin: com.nike.wingtips/wingtips-spring
/**
* Constructor that lets you choose whether downstream calls will be surrounded with a subspan. The default
* {@link HttpTagAndSpanNamingStrategy} and {@link HttpTagAndSpanNamingAdapter} will be used
* ({@link ZipkinHttpTagStrategy} and {@link SpringHttpClientTagAdapter}).
*
* @param surroundCallsWithSubspan pass in true to have downstream calls surrounded with a new span, false to only
* propagate the current span's info downstream (no subspan).
*/
public WingtipsAsyncClientHttpRequestInterceptor(boolean surroundCallsWithSubspan) {
this(
surroundCallsWithSubspan,
ZipkinHttpTagStrategy.<HttpRequest, ClientHttpResponse>getDefaultInstance(),
SpringHttpClientTagAdapter.getDefaultInstance()
);
}
代码示例来源:origin: Nike-Inc/wingtips
@Test
public void getDefaultInstance_returns_DEFAULT_INSTANCE() {
// expect
assertThat(ZipkinHttpTagStrategy.getDefaultInstance()).isSameAs(ZipkinHttpTagStrategy.DEFAULT_INSTANCE);
}
代码示例来源:origin: Nike-Inc/wingtips
@Test
public void default_constructor_sets_fields_as_expected() {
// when
WingtipsApacheHttpClientInterceptor impl = new WingtipsApacheHttpClientInterceptor();
// then
assertThat(impl.surroundCallsWithSubspan).isTrue();
assertThat(impl.tagAndNamingStrategy).isSameAs(ZipkinHttpTagStrategy.getDefaultInstance());
assertThat(impl.tagAndNamingAdapter).isSameAs(ApacheHttpClientTagAdapter.getDefaultInstance());
}
本文整理了Java中com.nike.wingtips.tags.ZipkinHttpTagStrategy类的一些代码示例,展示了ZipkinHttpTagStrategy类的具体用法。这些代码示例
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSenderDefaultHttpImpl类的一些代码示例,展示了ZipkinSpanSenderD
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSender类的一些代码示例,展示了ZipkinSpanSender类的具体用法。这些代码示例主要来
适用于 iOS 5 的全新 Nike+ GPS 应用程序能够在后台处理加速度计事件(从而允许室内运行机跟踪)。这怎么可能?当我将应用程序置于后台时,它会停止接收事件。我使用标准的 UIAccelero
适用于 iOS 5 的新 Nike+ GPS 应用程序能够在后台处理加速度计事件(从而允许进行室内运行机跟踪)。这怎么可能?当我将我的应用程序置于后台时,它停止接收事件。我使用标准的 UIAccele
本文整理了Java中com.nike.wingtips.tags.ZipkinHttpTagStrategy.putTagIfValueIsNotBlank()方法的一些代码示例,展示了ZipkinH
本文整理了Java中com.nike.wingtips.tags.ZipkinHttpTagStrategy.getDefaultInstance()方法的一些代码示例,展示了ZipkinHttpTa
如何将我的应用程序与 iPhone 4G 的 Nike+ 功能集成。我想访问捕获的数据并将其发送到我自己的应用程序。关于该主题的可用信息似乎有限。非常感谢任何帮助。 最佳答案 我实际上创建了一个 PH
这是一个非常简短的问题,有人知道是否有用于以下转换的 Jquery 插件:http://www.nikesnowboarding.com/team “点击名称”或有人知道如何实现。如果一个人精通 Ja
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSenderDefaultHttpImpl.()方法的一些代码示例,展示了ZipkinSpanSen
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSenderDefaultHttpImpl.configureScheduledExecutorSe
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSender.handleSpan()方法的一些代码示例,展示了ZipkinSpanSender.h
StackOverflow 上有几个关于此的问题,但他们都声称这是不可能的,您只能通过在您的应用程序中显示自定义设置页面来做到这一点。然而,Nike+应用程序完全符合我的要求,如下所示: 那么,再一次
我目前正在尝试使用 python 中的 headless 浏览器进行一些质量检查/表单提交,我认为我的图书馆无法提交/完成表单。我在这里做错了什么? import mechanize import c
我无法从文档中看到这是如何实现的,但耐克正在他们的应用程序中这样做,所以一定有办法。 最佳答案 不幸的是,这是不可能的。苹果为耐克开发了它,所以他们使用了自己的技巧来做到这一点。它实际上可能是可能的,
我是一名优秀的程序员,十分优秀!