Skip to content

Commit

Permalink
update sdk version and section tags (#3841)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcocchi committed May 10, 2023
1 parent ade7e34 commit aff7349
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0-beta2" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.32.0-preview" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.33.0-preview" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static async Task Main()

IServiceProvider serviceProvider = services.BuildServiceProvider();
_telemetryClient = serviceProvider.GetRequiredService<TelemetryClient>();
// <SetUpApplicationInsights>
// </SetUpApplicationInsights>

CosmosClientOptions options = new CosmosClientOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.0.0-beta.10" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.32.0-preview" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.33.0-preview" />
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.6.3" />
<PackageReference Include="OpenTelemetry" Version="1.4.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="7.0.2" />
Expand Down
6 changes: 4 additions & 2 deletions Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static async Task Main()
throw new ArgumentException("Please specify a valid ApplicationInsightsConnectionString in the appSettings.json");
}

// <SetUpOpenTelemetery>
// <SetUpOpenTelemetry>
ResourceBuilder resource = ResourceBuilder.CreateDefault().AddService(
serviceName: serviceName,
serviceVersion: "1.0.0");
Expand All @@ -69,12 +69,14 @@ static async Task Main()
.AddAzureMonitorTraceExporter(o => o.ConnectionString = aiConnectionString) // Set up exporter of your choice
.SetResourceBuilder(resource)
.Build();
// <SetUpOpenTelemetery>
// </SetUpOpenTelemetry>

// <EnableDistributedTracing>
CosmosClientOptions options = new CosmosClientOptions()
{
IsDistributedTracingEnabled = true // Defaults to true, set to false to disable
};
// </EnableDistributedTracing>
using (CosmosClient client = new CosmosClient(endpoint, authKey, options))
{
Console.WriteLine($"Getting container reference for {containerName}.");
Expand Down

0 comments on commit aff7349

Please sign in to comment.