Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EnvVar AZURE_AUTHORITY_HOST #9318

Closed
wants to merge 51 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
b5f7596
Make azure resource creation can be disabled. (#7335)
mitchdenny Jan 10, 2020
a781f99
Keyvault ARM template for live test (#7340)
hemanttanwar Jan 10, 2020
a68aca1
Fix dyanmic resource deprovision (#7343)
danieljurek Jan 10, 2020
0213d7c
Update README.md
weshaggard Jan 10, 2020
dd6c261
Remove OpenCensus tracing support for Java SDKs (#7167)
samvaity Jan 10, 2020
574f7bc
port https://github.com/Azure/azure-sdk-for-java/pull/6835 from v4 (#…
moderakh Jan 10, 2020
409efc5
Return empty string on empty content response from backend (#7347)
kushagraThapar Jan 11, 2020
14c8c1d
Added missing variables from ARM deployment, fixed expected environme…
alzimmermsft Jan 13, 2020
10e4bd5
Initial commit to add API to retrieve min throughput for a CosmosCont…
abinav2307 Jan 13, 2020
0c76069
Support AM/PM in MSI token (#7356)
jianghaolu Jan 13, 2020
7a16996
Encryption client from regular client (#7242)
gapra-msft Jan 13, 2020
72f8152
Jan Release readme fix/ changes (#7395)
hemanttanwar Jan 13, 2020
eaad511
Post release version update (#7399)
kushagraThapar Jan 13, 2020
8c44c17
Update identity to 1.0.3 (#7398)
jianghaolu Jan 13, 2020
7d14750
Move cosmosdb to cosmos (#7384)
mitchdenny Jan 14, 2020
585add2
Disabld feature CI trigger. (#7363)
mitchdenny Jan 14, 2020
105660c
Update documentation and in-memory checkpoint store sample (#7389)
srnagar Jan 14, 2020
e9e5e53
Prep for doc warden updates (#7405)
chidozieononiwu Jan 14, 2020
9def363
Post identity 1.0.3 release version update (#7407)
jianghaolu Jan 14, 2020
379dddf
Continue to use same .receive() method on disconnection (#7336)
conniey Jan 14, 2020
f93ec77
Updated storage versions post January release (#7397)
gapra-msft Jan 14, 2020
48171b1
Fixed retry logic on writes on forbidden status (#7402)
kushagraThapar Jan 14, 2020
0f27ea7
Add az namespace span attribute for App config (#7097)
samvaity Jan 14, 2020
3670d35
[After MSAL 1.3] Pluggable HTTP in identity/msal (#7120)
jianghaolu Jan 14, 2020
5b62f09
[After Jan 7] Removing dependency on java.desktop module. (#6877)
JonathanGiles Jan 14, 2020
d68f40b
Lower branch coverage threshold for Identity (#7433)
srnagar Jan 15, 2020
572a47a
Update Download To File Write Logic (#7403)
alzimmermsft Jan 15, 2020
f819bb4
Updated release version to 3.6.0 (#7428)
kushagraThapar Jan 15, 2020
7232b92
Feature/release verify (#7386)
JimSuplizio Jan 15, 2020
a5aba4c
revert license changes (#7387)
sima-zhu Jan 15, 2020
44cc9c4
Update TextSentimentClass to extend ExpandableStringEnum (#7427)
samvaity Jan 15, 2020
74f58ab
Added an overload for listing with a continuation token (#7388)
gapra-msft Jan 15, 2020
62ceaf6
Added ability to create service clients anonymously (#7421)
gapra-msft Jan 15, 2020
ee1925d
Fixed upload from file using FluxUtil.write in a manner where the und…
alzimmermsft Jan 15, 2020
b89d97c
Added client side checks for account set props (#7426)
gapra-msft Jan 15, 2020
cc9158a
Post release version update to 3.7.0-beta.1 (#7478)
kushagraThapar Jan 15, 2020
481cf3b
fixes some bugs and add tests to improve code coveragwe (#7401)
mssfang Jan 15, 2020
3e65a46
Updated Readme and changelog for storage release (#7484)
gapra-msft Jan 15, 2020
bbeeed3
Placeholder pipeline for aggregate report generation. (#7486)
mitchdenny Jan 16, 2020
274ae66
Move aggregate reports up.: (#7487)
mitchdenny Jan 16, 2020
6b2c11e
Implements a slf4j logger impl as default logger in azure core (#7298)
sima-zhu Jan 16, 2020
9b198d6
Replace AutoCloseable with reactor's Disposable. Retry and timeout fi…
conniey Jan 16, 2020
fb3937a
Eventhubs ARM template for live test (#7344)
hemanttanwar Jan 16, 2020
3c3900a
Fix cancellation handling (#7430)
mitchdenny Jan 16, 2020
fc90101
add build qualifier to unreleased version (#7501)
JimSuplizio Jan 16, 2020
a18cd1a
Retry network operations in resources scripts (#7510)
heaths Jan 17, 2020
9ef4b0d
Fix up SDKType parameter condition. (#7512)
mitchdenny Jan 17, 2020
570f57f
Paged Flux abstractions (#6465)
anuchandy Jan 17, 2020
6b58732
Clears closed/errored sessions and links (#7534)
conniey Jan 18, 2020
e8f1f7b
add environment variable authorityhost
Luyunmt Mar 20, 2020
d96c366
add environment variable authorityhost
Luyunmt Mar 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add az namespace span attribute for App config (#7097)
  • Loading branch information
samvaity authored Jan 14, 2020
commit 0f27ea72078ac63d9fcc583780418ca9fa4b3aab
1 change: 1 addition & 0 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
@@ -35,3 +35,4 @@ com.azure:azure-storage-queue;12.2.0;12.3.0-beta.1
# Format;
# unreleased_<groupId>:<artifactId>;dependency-version
unreleased_com.azure:azure-core-amqp;1.0.1
unreleased_com.azure:azure-core;1.3.0-beta.1
2 changes: 1 addition & 1 deletion sdk/appconfiguration/azure-data-appconfiguration/pom.xml
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.2.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
<version>1.3.0-beta.1</version> <!-- {x-version-update;unreleased_com.azure:azure-core;dependency} -->
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Original file line number Diff line number Diff line change
@@ -28,11 +28,16 @@
import reactor.core.publisher.Mono;

import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.function.Supplier;

import static com.azure.core.util.FluxUtil.monoError;
import static com.azure.core.util.FluxUtil.withContext;
import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY;

/**
* This class provides a client that contains all the operations for {@link ConfigurationSetting ConfigurationSettings}
@@ -54,6 +59,9 @@ public final class ConfigurationAsyncClient {
private final ClientLogger logger = new ClientLogger(ConfigurationAsyncClient.class);

private static final String ETAG_ANY = "*";
private static final Supplier<Map<String, String>> APP_CONFIG_TRACING_PROPERTIES =
() -> Collections.unmodifiableMap(
new HashMap<String, String>() {{ put(AZ_TRACING_NAMESPACE_KEY, "Microsoft.AppConfiguration"); }});

private final String serviceEndpoint;
private final ConfigurationService service;
@@ -62,13 +70,12 @@ public final class ConfigurationAsyncClient {
/**
* Creates a ConfigurationAsyncClient that sends requests to the configuration service at {@code serviceEndpoint}.
* Each service call goes through the {@code pipeline}.
*
* @param serviceEndpoint The URL string for the App Configuration service.
* @param pipeline HttpPipeline that the HTTP requests and responses flow through.
* @param version {@link ConfigurationServiceVersion} of the service to be used when making requests.
*/
ConfigurationAsyncClient(String serviceEndpoint, HttpPipeline pipeline, ConfigurationServiceVersion version) {
this.service = RestProxy.create(ConfigurationService.class, pipeline);
this.service = RestProxy.create(ConfigurationService.class, pipeline, APP_CONFIG_TRACING_PROPERTIES);
this.serviceEndpoint = serviceEndpoint;
}

Original file line number Diff line number Diff line change
@@ -10,10 +10,9 @@
import com.azure.core.http.HttpResponse;
import com.azure.core.http.policy.AfterRetryPolicyProvider;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.util.UrlBuilder;
import com.azure.core.util.CoreUtils;
import com.azure.core.tracing.opentelemetry.implementation.HttpTraceUtil;

import com.azure.core.util.CoreUtils;
import com.azure.core.util.UrlBuilder;
import io.opentelemetry.OpenTelemetry;
import io.opentelemetry.context.propagation.HttpTextFormat;
import io.opentelemetry.trace.AttributeValue;
@@ -26,6 +25,8 @@

import java.util.Optional;

import static com.azure.core.tracing.opentelemetry.OpenTelemetryTracer.AZ_NAMESPACE_KEY;
import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY;
import static com.azure.core.util.tracing.Tracer.PARENT_SPAN_KEY;

/**
@@ -73,7 +74,7 @@ public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineN

// If span is sampled in, add additional TRACING attributes
if (span.isRecording()) {
addSpanRequestAttributes(span, request); // Adds HTTP method, URL, & user-agent
addSpanRequestAttributes(span, request, context); // Adds HTTP method, URL, & user-agent
}

// For no-op tracer, SpanContext is INVALID; inject valid span headers onto outgoing request
@@ -88,10 +89,15 @@ public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineN
.subscriberContext(Context.of("TRACING_SPAN", span, "REQUEST", request));
}

private static void addSpanRequestAttributes(Span span, HttpRequest request) {
private static void addSpanRequestAttributes(Span span, HttpRequest request,
HttpPipelineCallContext context) {
putAttributeIfNotEmptyOrNull(span, HTTP_USER_AGENT, request.getHeaders().getValue("User-Agent"));
putAttributeIfNotEmptyOrNull(span, HTTP_METHOD, request.getHttpMethod().toString());
putAttributeIfNotEmptyOrNull(span, HTTP_URL, request.getUrl().toString());
Optional<Object> tracingNamespace = context.getData(AZ_TRACING_NAMESPACE_KEY);
if (tracingNamespace.isPresent()) {
putAttributeIfNotEmptyOrNull(span, AZ_NAMESPACE_KEY, tracingNamespace.get().toString());
}
}

private static void putAttributeIfNotEmptyOrNull(Span span, String key, String value) {
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ public class OpenTelemetryTracer implements com.azure.core.util.tracing.Tracer {
private static final Tracer TRACER = OpenTelemetry.getTracerFactory().get("Azure-OpenTelemetry");

// standard attributes with AMQP request
static final String AZ_NAMESPACE_KEY = "az.namespace";
static final String COMPONENT = "component";
static final String MESSAGE_BUS_DESTINATION = "message_bus.destination";
static final String PEER_ENDPOINT = "peer.address";
@@ -48,7 +49,12 @@ public Context start(String spanName, Context context) {

Builder spanBuilder = getSpanBuilder(spanName, context);
Span span = spanBuilder.startSpan();

if (span.isRecording()) {
String tracingNamespace = getOrDefault(context, AZ_TRACING_NAMESPACE_KEY, null, String.class);
if (tracingNamespace != null) {
span.setAttribute(AZ_NAMESPACE_KEY, AttributeValue.stringAttributeValue(tracingNamespace));
}
}
return context.addData(PARENT_SPAN_KEY, span);
}

Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ private HttpTraceUtil() { }
* mapping is defined in <a
* href="https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto">Google API
* canonical error code</a>, and the behavior is defined in <a
* href="https://github.com/census-instrumentation/opentelemetry-specs/blob/master/trace/HTTP.md">OpenTelemetry
* href="https://github.com/census-instrumentation/opencensus-specs/blob/master/trace/HTTP.md">OpenTelemetry
* Specs</a>.
*
* @param statusCode the HTTP response status code. {@code 0} means invalid response.
Original file line number Diff line number Diff line change
@@ -21,13 +21,16 @@

import java.util.Map;

import static com.azure.core.tracing.opentelemetry.OpenTelemetryTracer.AZ_NAMESPACE_KEY;
import static com.azure.core.tracing.opentelemetry.OpenTelemetryTracer.COMPONENT;
import static com.azure.core.tracing.opentelemetry.OpenTelemetryTracer.MESSAGE_BUS_DESTINATION;
import static com.azure.core.tracing.opentelemetry.OpenTelemetryTracer.PEER_ENDPOINT;
import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY;
import static com.azure.core.util.tracing.Tracer.DIAGNOSTIC_ID_KEY;
import static com.azure.core.util.tracing.Tracer.ENTITY_PATH_KEY;
import static com.azure.core.util.tracing.Tracer.HOST_NAME_KEY;
import static com.azure.core.util.tracing.Tracer.PARENT_SPAN_KEY;
import static com.azure.core.util.tracing.Tracer.SCOPE_KEY;
import static com.azure.core.util.tracing.Tracer.SPAN_BUILDER_KEY;
import static com.azure.core.util.tracing.Tracer.SPAN_CONTEXT_KEY;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,13 +41,14 @@
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* Tests Azure-OpenTelemetry tracing package using opentelemetry-sdk
* Tests Azure-OpenTelemetry tracing package using openTelemetry-sdk
*/
public class OpenTelemetryTracerTest {
private static final String METHOD_NAME = "EventHubs.send";
private static final String HOSTNAME_VALUE = "testEventDataNameSpace.servicebus.windows.net";
private static final String ENTITY_PATH_VALUE = "test";
private static final String COMPONENT_VALUE = "EventHubs";
private static final String AZ_NAMESPACE_VALUE = "Microsoft.Eventhub";
private OpenTelemetryTracer openTelemetryTracer;
private Tracer tracer;
private Context tracingContext;
@@ -85,13 +89,16 @@ public void startSpanParentContextFlowTest() {
final SpanId parentSpanId = parentSpan.getContext().getSpanId();

// Act
final Context updatedContext = openTelemetryTracer.start(METHOD_NAME, tracingContext);
final Context updatedContext = openTelemetryTracer.start(METHOD_NAME,
tracingContext.addData(AZ_TRACING_NAMESPACE_KEY, AZ_NAMESPACE_VALUE));

// Assert
assertSpanWithExplicitParent(updatedContext, parentSpanId);
final ReadableSpan recordEventsSpan =
(ReadableSpan) updatedContext.getData(PARENT_SPAN_KEY).get();
assertEquals(Span.Kind.INTERNAL, recordEventsSpan.toSpanData().getKind());
final Map<String, AttributeValue> attributeMap = recordEventsSpan.toSpanData().getAttributes();
assertEquals(attributeMap.get(AZ_NAMESPACE_KEY), AttributeValue.stringAttributeValue(AZ_NAMESPACE_VALUE));
}

@Test
@@ -163,7 +170,7 @@ public void startSpanProcessKindProcess() {
final SpanId parentSpanId = parentSpan.getContext().getSpanId();
// Add additional metadata to spans for SEND
final Context traceContext = tracingContext.addData(ENTITY_PATH_KEY, ENTITY_PATH_VALUE)
.addData(HOST_NAME_KEY, HOSTNAME_VALUE);
.addData(HOST_NAME_KEY, HOSTNAME_VALUE);
// Act
final Context updatedContext = openTelemetryTracer.start(METHOD_NAME, traceContext, ProcessKind.PROCESS);

@@ -173,7 +180,7 @@ public void startSpanProcessKindProcess() {
// verify span created with explicit parent
assertSpanWithExplicitParent(updatedContext, parentSpanId);
// verify scope returned
assertNotNull(updatedContext.getData("scope").get());
assertNotNull(updatedContext.getData(SCOPE_KEY).get());
final ReadableSpan recordEventsSpan =
(ReadableSpan) updatedContext.getData(PARENT_SPAN_KEY).get();
assertEquals(Span.Kind.SERVER, recordEventsSpan.toSpanData().getKind());
@@ -206,7 +213,7 @@ public void startProcessSpanWithRemoteParent() {
final Context updatedContext = openTelemetryTracer.start(METHOD_NAME, traceContext, ProcessKind.PROCESS);

// Assert
assertNotNull(updatedContext.getData("scope").get());
assertNotNull(updatedContext.getData(SCOPE_KEY).get());
// Assert new span created with remote parent context
assertSpanWithRemoteParent(updatedContext, testSpanId);
}
@@ -293,6 +300,7 @@ private static void assertSpanWithExplicitParent(Context updatedContext, SpanId

final ReadableSpan recordEventsSpan =
(ReadableSpan) updatedContext.getData(PARENT_SPAN_KEY).get();

assertEquals(METHOD_NAME, recordEventsSpan.getName());

// verify span started with explicit parent
Original file line number Diff line number Diff line change
@@ -3,34 +3,34 @@

package com.azure.core.http.rest;

import com.azure.core.implementation.http.UnexpectedExceptionInformation;
import com.azure.core.util.Base64Url;
import com.azure.core.annotation.ResumeOperation;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.UnexpectedLengthException;
import com.azure.core.http.ContentType;
import com.azure.core.http.HttpHeader;
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.exception.UnexpectedLengthException;
import com.azure.core.http.ContentType;
import com.azure.core.util.UrlBuilder;
import com.azure.core.implementation.TypeUtil;
import com.azure.core.implementation.http.UnexpectedExceptionInformation;
import com.azure.core.implementation.serializer.HttpResponseDecoder;
import com.azure.core.implementation.serializer.HttpResponseDecoder.HttpDecodedResponse;
import com.azure.core.util.Base64Url;
import com.azure.core.util.Context;
import com.azure.core.util.CoreUtils;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.UrlBuilder;
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.tracing.TracerProxy;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.CoreUtils;
import com.azure.core.implementation.TypeUtil;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import reactor.core.Exceptions;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -46,10 +46,13 @@
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;

import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY;

/**
* Type to create a proxy implementation for an interface describing REST API methods.
*
@@ -63,6 +66,7 @@ public final class RestProxy implements InvocationHandler {
private final SerializerAdapter serializer;
private final SwaggerInterfaceParser interfaceParser;
private final HttpResponseDecoder decoder;
private final Map<String, String> tracerSpanAttributes;

private final ResponseConstructorsCache responseConstructorsCache;

@@ -74,13 +78,16 @@ public final class RestProxy implements InvocationHandler {
* @param serializer the serializer that will be used to convert response bodies to POJOs.
* @param interfaceParser the parser that contains information about the interface describing REST API methods
* that this RestProxy "implements".
* @param tracerSpanAttributes the map of attributes to be set on the tracer spans.
*/
private RestProxy(HttpPipeline httpPipeline, SerializerAdapter serializer, SwaggerInterfaceParser interfaceParser) {
private RestProxy(HttpPipeline httpPipeline, SerializerAdapter serializer, SwaggerInterfaceParser interfaceParser,
Map<String, String> tracerSpanAttributes) {
this.httpPipeline = httpPipeline;
this.serializer = serializer;
this.interfaceParser = interfaceParser;
this.decoder = new HttpResponseDecoder(this.serializer);
this.responseConstructorsCache = new ResponseConstructorsCache();
this.tracerSpanAttributes = tracerSpanAttributes;
}

/**
@@ -130,7 +137,13 @@ public Object invoke(Object proxy, final Method method, Object[] args) {
methodParser = getMethodParser(method);
request = createHttpRequest(methodParser, args);
Context context =
methodParser.setContext(args).addData("caller-method", methodParser.getFullyQualifiedMethodName());
methodParser.setContext(args)
.addData("caller-method", methodParser.getFullyQualifiedMethodName());

if (tracerSpanAttributes != null) {
context = context.addData(AZ_TRACING_NAMESPACE_KEY,
tracerSpanAttributes.get(AZ_TRACING_NAMESPACE_KEY));
}
context = startTracingSpan(method, context);

if (request.getBody() != null) {
@@ -671,7 +684,21 @@ public static <A> A create(Class<A> swaggerInterface, HttpPipeline httpPipeline)
* Create a proxy implementation of the provided Swagger interface.
*
* @param swaggerInterface the Swagger interface to provide a proxy implementation for
* @param httpPipeline the HttpPipelinePolicy and HttpClient pipline that will be used to send Http
* @param httpPipeline the HttpPipelinePolicy and HttpClient pipeline that will be used to send Http requests
* @param <A> the type of the Swagger interface
* @param tracerAttributeSupplier the supplier to get attributes to be set on the tracer spans.
* @return a proxy implementation of the provided Swagger interface
*/
public static <A> A create(Class<A> swaggerInterface, HttpPipeline httpPipeline,
Supplier<Map<String, String>> tracerAttributeSupplier) {
return create(swaggerInterface, httpPipeline, createDefaultSerializer(), tracerAttributeSupplier);
}

/**
* Create a proxy implementation of the provided Swagger interface.
*
* @param swaggerInterface the Swagger interface to provide a proxy implementation for
* @param httpPipeline the HttpPipelinePolicy and HttpClient pipeline that will be used to send Http
* requests
* @param serializer the serializer that will be used to convert POJOs to and from request and
* response bodies
@@ -680,8 +707,27 @@ public static <A> A create(Class<A> swaggerInterface, HttpPipeline httpPipeline)
*/
@SuppressWarnings("unchecked")
public static <A> A create(Class<A> swaggerInterface, HttpPipeline httpPipeline, SerializerAdapter serializer) {
return create(swaggerInterface, httpPipeline, serializer, null);
}

/**
* Create a proxy implementation of the provided Swagger interface.
*
* @param swaggerInterface the Swagger interface to provide a proxy implementation for
* @param httpPipeline the HttpPipelinePolicy and HttpClient pipeline that will be used to send Http
* requests
* @param serializer the serializer that will be used to convert POJOs to and from request and
* response bodies
* @param <A> the type of the Swagger interface.
* @param tracerAttributeSupplier the supplier to get attributes to be set on the tracer spans.
* @return a proxy implementation of the provided Swagger interface
*/
@SuppressWarnings("unchecked")
public static <A> A create(Class<A> swaggerInterface, HttpPipeline httpPipeline, SerializerAdapter serializer,
Supplier<Map<String, String>> tracerAttributeSupplier) {
final SwaggerInterfaceParser interfaceParser = new SwaggerInterfaceParser(swaggerInterface, serializer);
final RestProxy restProxy = new RestProxy(httpPipeline, serializer, interfaceParser);
final RestProxy restProxy = new RestProxy(httpPipeline, serializer, interfaceParser,
tracerAttributeSupplier == null ? null : tracerAttributeSupplier.get());
return (A) Proxy.newProxyInstance(swaggerInterface.getClassLoader(), new Class<?>[]{swaggerInterface},
restProxy);
}
Original file line number Diff line number Diff line change
@@ -57,6 +57,11 @@ public interface Tracer {
*/
String SPAN_BUILDER_KEY = "builder";

/**
* Key for {@link Context} which indicates that the context contains the Azure resource provider namespace.
*/
String AZ_TRACING_NAMESPACE_KEY = "az.tracing.namespace";

/**
* Creates a new tracing span.
* <p>