/** * Returns the name that should be used for the span surrounding the downstream call. Defaults to whatever {@link * ProxyRouterSpanNamingAndTaggingStrategy#getInitialSpanName(Object)} returns, with a fallback * of {@link HttpRequestTracingUtils#getFallbackSpanNameForHttpRequest(String, String)} if the naming strategy * returned null or blank string. * * @param downstreamRequest The Netty {@link HttpRequest} for the downstream call. * @param namingStrategy The {@link ProxyRouterSpanNamingAndTaggingStrategy} being used. * @return The name that should be used for the span surrounding the downstream call. */ protected @NotNull String getSubspanSpanName( @NotNull HttpRequest downstreamRequest, @NotNull ProxyRouterSpanNamingAndTaggingStrategy<Span> namingStrategy ) { String spanNameFromStrategy = namingStrategy.getInitialSpanName(downstreamRequest); if (StringUtils.isNotBlank(spanNameFromStrategy)) { return spanNameFromStrategy; } // The naming strategy didn't have anything for us. Fall back to something reasonable. return getFallbackSpanName(downstreamRequest); }
/** * Returns the name that should be used for the span surrounding the downstream call. Defaults to whatever {@link * ProxyRouterSpanNamingAndTaggingStrategy#getInitialSpanName(Object)} returns, with a fallback * of {@link HttpRequestTracingUtils#getFallbackSpanNameForHttpRequest(String, String)} if the naming strategy * returned null or blank string. * * @param downstreamRequest The Netty {@link HttpRequest} for the downstream call. * @param namingStrategy The {@link ProxyRouterSpanNamingAndTaggingStrategy} being used. * @return The name that should be used for the span surrounding the downstream call. */ protected @NotNull String getSubspanSpanName( @NotNull HttpRequest downstreamRequest, @NotNull ProxyRouterSpanNamingAndTaggingStrategy<Span> namingStrategy ) { String spanNameFromStrategy = namingStrategy.getInitialSpanName(downstreamRequest); if (StringUtils.isNotBlank(spanNameFromStrategy)) { return spanNameFromStrategy; } // The naming strategy didn't have anything for us. Fall back to something reasonable. return getFallbackSpanName(downstreamRequest); }