Skip to content

Commit fbe6ea1

Browse files
Updating OTel configuration. (#10965)
* Updating OTel configuration. * Updating deps.json file. * Updating deps file and adding release notes.
1 parent 8e8c1ce commit fbe6ea1

File tree

6 files changed

+155
-152
lines changed

6 files changed

+155
-152
lines changed

release_notes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
- Added the option to exclude test data from the `/functions` endpoint API response (#10943)
1717
- Increased the GC allocation budget value to improve cold start (#10953)
1818
- Fixed bug that could result in "Binding names must be unique" error (#10938)
19-
- Fix race condition that leads the host to initialize placeholder (warmup) function in Linux environments (#10848)
19+
- Fix race condition that leads the host to initialize placeholder (warmup) function in Linux environments (#10848)
20+
- Updating Azure.Core and OTel related packages, recording exception and retaining "Microsoft.Azure.WebJobs" logs (#10965)

src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
using Microsoft.Azure.WebJobs.Script.Workers.SharedMemoryDataTransfer;
3333
using Microsoft.Extensions.Logging;
3434
using Microsoft.Extensions.Options;
35+
using OpenTelemetry.Trace;
3536
using static Microsoft.Azure.WebJobs.Script.Grpc.Messages.RpcLog.Types;
3637
using FunctionMetadata = Microsoft.Azure.WebJobs.Script.Description.FunctionMetadata;
3738
using MsgType = Microsoft.Azure.WebJobs.Script.Grpc.Messages.StreamingMessage.ContentOneofCase;
@@ -1282,6 +1283,8 @@ internal void Log(GrpcEvent msg)
12821283
// TODO fix RpcException catch all https://github.com/Azure/azure-functions-dotnet-worker/issues/370
12831284
var exception = new Workers.Rpc.RpcException(rpcLog.Message, rpcLog.Exception.Message, rpcLog.Exception.StackTrace);
12841285
context.Logger.Log(logLevel, new EventId(0, rpcLog.EventId), rpcLog.Message, exception, (state, exc) => state);
1286+
Activity.Current?.RecordException(exception);
1287+
Activity.Current?.SetStatus(ActivityStatusCode.Error, exception.Message);
12851288
}
12861289
else
12871290
{

src/WebJobs.Script/Config/HostJsonFileConfigurationSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class HostJsonFileConfigurationProvider : ConfigurationProvider
5151
{
5252
"version", "functionTimeout", "retry", "functions", "http", "watchDirectories", "watchFiles", "queues", "serviceBus",
5353
"eventHub", "singleton", "logging", "aggregator", "healthMonitor", "extensionBundle", "managedDependencies",
54-
"customHandler", "httpWorker", "extensions", "concurrency", ConfigurationSectionNames.SendCanceledInvocationsToWorker,
54+
"customHandler", "httpWorker", "extensions", "concurrency", "telemetryMode", ConfigurationSectionNames.SendCanceledInvocationsToWorker,
5555
ConfigurationSectionNames.MetadataProviderTimeout
5656
};
5757

src/WebJobs.Script/Diagnostics/OpenTelemetry/OpenTelemetryConfigurationExtensions.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ private static ILoggingBuilder AddDefaultOpenTelemetryFilters(this ILoggingBuild
158158
.AddFilter<OpenTelemetryLoggerProvider>("Azure.*", _ => false)
159159
// Host.Results and Host.Aggregator are used to emit metrics, ignoring these categories.
160160
.AddFilter<OpenTelemetryLoggerProvider>("Host.Results", _ => false)
161-
.AddFilter<OpenTelemetryLoggerProvider>("Host.Aggregator", _ => false)
162-
// Ignoring all Microsoft.Azure.WebJobs.* logs like /getScriptTag and /lock.
163-
.AddFilter<OpenTelemetryLoggerProvider>("Microsoft.Azure.WebJobs.*", _ => false);
161+
.AddFilter<OpenTelemetryLoggerProvider>("Host.Aggregator", _ => false);
164162
}
165163

166164
private static IOpenTelemetryBuilder ConfigureEventLogLevel(this IOpenTelemetryBuilder builder, IConfiguration configuration)

src/WebJobs.Script/WebJobs.Script.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<ItemGroup>
2828
<!-- Dependencies needed for Storage Providers -->
29-
<PackageReference Include="Azure.Core" Version="1.38.0" />
29+
<PackageReference Include="Azure.Core" Version="1.45.0" />
3030
<PackageReference Include="Azure.Data.Tables" Version="12.8.3" />
3131
<PackageReference Include="Azure.Identity" Version="1.11.4" />
3232
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0-beta.2" />
@@ -52,10 +52,10 @@
5252
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
5353
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
5454
<PackageReference Include="NuGet.ProjectModel" Version="5.11.6" />
55-
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.0" />
56-
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.0" />
57-
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
58-
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
55+
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
56+
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
57+
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
58+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
5959
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
6060
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
6161
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />

0 commit comments

Comments
 (0)