Skip to content

Commit

Permalink
Merge branch 'main' into docs-logs-sensitive-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Feb 15, 2024
2 parents 7616a9d + 855e9c4 commit 714d906
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="[8.1.0,)" />
<PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="[8.2.0,)" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="[1.0.3,2.0)" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="[17.8.0,18.0.0)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[1.1.1,2.0)" />
Expand Down
2 changes: 1 addition & 1 deletion docs/logs/complex-objects/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// This will flush the remaining logs and shutdown the logging pipeline.
loggerFactory.Dispose();

public static partial class ApplicationLogs
internal static partial class LoggerExtensions
{
[LoggerMessage(LogLevel.Critical)]
public static partial void FoodRecallNotice(
Expand Down
4 changes: 3 additions & 1 deletion docs/logs/complex-objects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ that the following code is added which uses the `LogPropertiesAttribute` to log
the `FoodRecallNotice` object:

```csharp
public static partial class ApplicationLogs
internal static partial class LoggerExtensions
{
[LoggerMessage(LogLevel.Critical)]
public static partial void FoodRecallNotice(
Expand Down Expand Up @@ -89,6 +89,8 @@ LogRecord.Attributes (Key:Value):
ProductType: Food & Beverages
ProductDescription: Salads
BrandName: Contoso
LogRecord.EventId: 252550133
LogRecord.EventName: FoodRecallNotice
```

> [!NOTE]
Expand Down
6 changes: 3 additions & 3 deletions docs/metrics/customizing-the-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,9 @@ Histograms with buckets, and it stores at most one exemplar per histogram
bucket. The exemplar stored is the last measurement recorded - i.e. any new
measurement overwrites the previous one in that bucket.

* `SimpleExemplarReservoir` is the default reservoir used for all metrics except
Histograms with buckets. It has a fixed reservoir pool, and implements the
equivalent of [naive
* `SimpleFixedSizeExemplarReservoir` is the default reservoir used for all
metrics except Histograms with buckets. It has a fixed reservoir pool, and
implements the equivalent of [naive
reservoir](https://en.wikipedia.org/wiki/Reservoir_sampling). The reservoir pool
size (currently defaulting to 1) determines the maximum number of exemplars
stored.
Expand Down
4 changes: 2 additions & 2 deletions docs/trace/reporting-exceptions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ using (var activity = MyActivitySource.StartActivity("Foo"))
}
catch (SomeException ex)
{
activity?.SetStatus(ActivityStatusCode.Error, ex.message);
activity?.SetStatus(ActivityStatusCode.Error, ex.Message);
}
}
```
Expand All @@ -119,7 +119,7 @@ using (var activity = MyActivitySource.StartActivity("Foo"))
}
catch (SomeException ex)
{
activity?.SetStatus(ActivityStatusCode.Error, ex.message);
activity?.SetStatus(ActivityStatusCode.Error, ex.Message);
activity?.RecordException(ex);
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/otlp-collector-example/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ receivers:

exporters:
logging:
loglevel: debug
verbosity: detailed

service:
pipelines:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
namespace OpenTelemetry.Metrics;

/// <summary>
/// The SimpleExemplarReservoir implementation.
/// The SimpleFixedSizeExemplarReservoir implementation.
/// </summary>
internal sealed class SimpleExemplarReservoir : ExemplarReservoir
internal sealed class SimpleFixedSizeExemplarReservoir : ExemplarReservoir
{
private readonly int poolSize;
private readonly Random random;
Expand All @@ -17,7 +17,7 @@ internal sealed class SimpleExemplarReservoir : ExemplarReservoir

private long measurementsSeen;

public SimpleExemplarReservoir(int poolSize)
public SimpleFixedSizeExemplarReservoir(int poolSize)
{
this.poolSize = poolSize;
this.runningExemplars = new Exemplar[poolSize];
Expand Down
2 changes: 1 addition & 1 deletion src/OpenTelemetry/Metrics/MetricPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ internal MetricPoint(

if (aggregatorStore!.IsExemplarEnabled() && reservoir == null)
{
reservoir = new SimpleExemplarReservoir(DefaultSimpleReservoirPoolSize);
reservoir = new SimpleFixedSizeExemplarReservoir(DefaultSimpleReservoirPoolSize);
}

if (reservoir != null)
Expand Down
2 changes: 1 addition & 1 deletion test/OpenTelemetry.Tests/Metrics/MetricExemplarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void TestExemplarsCounter(MetricReaderTemporalityPreference temporality)
var exemplars = GetExemplars(metricPoint.Value);

// TODO: Modify the test to better test cumulative.
// In cumulative where SimpleExemplarReservoir's size is
// In cumulative, where SimpleFixedSizeExemplarReservoir's size is
// more than the count of new measurements, it is possible
// that the exemplar value is for a measurement that was recorded in the prior
// cycle. The current ValidateExemplars() does not handle this case.
Expand Down

0 comments on commit 714d906

Please sign in to comment.