- Azure SDK supports global configuration through Common environment variables
- .NET allows to configure SDKs through
appsettings.jsonor any otherMS.Extensions.Configuration-compatible source using additionalMicrosoft.Extensions.Azurepackage. - Java Azure Spring Cloud works on extensive list of configuration options
- Cloud Configuration draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Autowired | |
| ServiceBusSenderClient serviceBusClient; | |
| @PostMapping("/queues") | |
| public String send(@RequestParam("message") String message) { | |
| serviceBusClient.sendMessage(new ServiceBusMessage(message)); | |
| return message; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class MessagingExtensions | |
| { | |
| // potential addition to event hubs SDK. service bus is similar | |
| // The only concern is availability of ActivityContext prior to .NET 5 | |
| // there is a potential to update DiagnosticSource, but it's problematic because of | |
| // version conflict: binding redirects on .NET Fx and version conflicts with Functions load contexts | |
| public static ActivityContext ExtractTraceContext(this EventData @event) | |
| { | |
| if (@event.Properties.TryGetValue("Diagnostic-Id", out var tp) && tp is string traceparent) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.example.functions; | |
| import com.azure.core.models.CloudEvent; | |
| import com.azure.core.util.serializer.TypeReference; | |
| import com.azure.messaging.eventgrid.EventGridEvent; | |
| import com.fasterxml.jackson.core.JsonProcessingException; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.microsoft.azure.functions.ExecutionContext; | |
| import com.microsoft.azure.functions.HttpMethod; | |
| import com.microsoft.azure.functions.HttpRequestMessage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void main(String[] args) { | |
| // first call in not instrumented... | |
| doSomething(); | |
| doSomething().transform(t -> { | |
| Span s = GlobalOpenTelemetry.getTracer("test") | |
| .spanBuilder("span") | |
| .startSpan(); | |
| return t.doFinally(signal -> s.end()) |
- P0 - Define span modelling conventions for HTTP client spans #1747
- Replace http.target with http.path and http.query? #2056
- Remove http.XX_content_length* semantic attributes #2028
- P0 - Confirm that HTTP instrumentations can provide sampling-relevant attributes at creation time #2011
- P? - required/optional #2114
- Semantic convention around retry attempts? #1306
- Adding semantic conventions for setting attributes to record retry behavior [#729](https://github.com/open-telemetry/opentelemetry-sp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static final Method SET_REACTOR_CONTEXT_METHOD = getStoreContextMethod(); | |
| static Method getStoreContextMethod() { | |
| try { | |
| Class<?> contextPropagationOperatorClass = Class.forName("io.opentelemetry.javaagent.shaded.instrumentation.reactor.ContextPropagationOperator"); | |
| Class<?> oteContextShaded = Class.forName("io.opentelemetry.javaagent.shaded.io.opentelemetry.context.Context"); | |
| if (contextPropagationOperatorClass != null && oteContextShaded != null) { | |
| Method storeMethod = contextPropagationOperatorClass.getDeclaredMethod("storeOpenTelemetryContext", reactor.util.context.Context.class, oteContextShaded); | |
| if (storeMethod.getReturnType() == reactor.util.context.Context.class) { | |
| return storeMethod; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.example; | |
| import io.opentelemetry.api.trace.Span; | |
| import io.opentelemetry.api.trace.StatusCode; | |
| import io.opentelemetry.api.trace.Tracer; | |
| import io.opentelemetry.context.Scope; | |
| import io.opentelemetry.exporter.jaeger.JaegerGrpcSpanExporter; | |
| import io.opentelemetry.sdk.OpenTelemetrySdk; | |
| import io.opentelemetry.sdk.common.CompletableResultCode; | |
| import io.opentelemetry.sdk.trace.ReadableSpan; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.http; | |
| import com.squareup.okhttp.Interceptor; | |
| import com.squareup.okhttp.OkHttpClient; | |
| import com.squareup.okhttp.Request; | |
| import com.squareup.okhttp.Response; | |
| import java.io.IOException; | |
| import io.opentelemetry.api.trace.SpanKind; |