Skip to content

Commit

Permalink
Merge branch 'main' into instrumentation-scope-version
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek committed Apr 5, 2024
2 parents 4294446 + 3f4c73a commit 7d538b2
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 40 deletions.
3 changes: 3 additions & 0 deletions docs/metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ package, regardless of the .NET runtime version being used:
* The .NET runtime team is holding a high bar for backward compatibility on
`System.Diagnostics.DiagnosticSource` even during major version bumps, so
compatibility is not a concern here.
* Refer to the [.NET official
document](https://learn.microsoft.com/dotnet/core/diagnostics/compare-metric-apis#systemdiagnosticsmetrics)
for more information about `System.Diagnostics.Metrics`.

## Metrics API

Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## 1.8.0

Released 2024-Apr-04

* Fixed an issue for spans when `server.port` attribute was not set with
`server.address` when it has default values (`80` for `HTTP` and
`443` for `HTTPS` protocol).
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Instrumentation.GrpcNetClient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* `ActivitySource.Version` is set to NuGet package version.
([#5498](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5498))

## 1.8.0-beta.1

Released 2024-Apr-04

## 1.7.0-beta.1

Released 2024-Feb-09
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## 1.8.0

Released 2024-Apr-04

* Fixed an issue for spans when `server.port` attribute was not set with
`server.address` when it has default values (`80` for `HTTP` and
`443` for `HTTPS` protocol).
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* `ActivitySource.Version` is set to NuGet package version.
([#5498](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5498))

## 1.8.0-beta.1

Released 2024-Apr-04

## 1.7.0-beta.1

Released 2024-Feb-09
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"
Expand Down
57 changes: 17 additions & 40 deletions src/OpenTelemetry/Metrics/AggregatorStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,7 @@ internal void SnapshotDelta(int indexSnapshot)
continue;
}

if (this.IsExemplarEnabled())
{
metricPoint.TakeSnapshotWithExemplar(outputDelta: true);
}
else
{
metricPoint.TakeSnapshot(outputDelta: true);
}
this.TakeMetricPointSnapshot(ref metricPoint, outputDelta: true);

this.currentMetricPointBatch[this.batchSize] = i;
this.batchSize++;
Expand All @@ -246,14 +239,7 @@ internal void SnapshotDeltaWithMetricPointReclaim()
ref var metricPointWithNoTags = ref this.metricPoints[0];
if (metricPointWithNoTags.MetricPointStatus != MetricPointStatus.NoCollectPending)
{
if (this.IsExemplarEnabled())
{
metricPointWithNoTags.TakeSnapshotWithExemplar(outputDelta: true);
}
else
{
metricPointWithNoTags.TakeSnapshot(outputDelta: true);
}
this.TakeMetricPointSnapshot(ref metricPointWithNoTags, outputDelta: true);

this.currentMetricPointBatch[this.batchSize] = 0;
this.batchSize++;
Expand All @@ -265,14 +251,7 @@ internal void SnapshotDeltaWithMetricPointReclaim()
ref var metricPointForOverflow = ref this.metricPoints[1];
if (metricPointForOverflow.MetricPointStatus != MetricPointStatus.NoCollectPending)
{
if (this.IsExemplarEnabled())
{
metricPointForOverflow.TakeSnapshotWithExemplar(outputDelta: true);
}
else
{
metricPointForOverflow.TakeSnapshot(outputDelta: true);
}
this.TakeMetricPointSnapshot(ref metricPointForOverflow, outputDelta: true);

this.currentMetricPointBatch[this.batchSize] = 1;
this.batchSize++;
Expand Down Expand Up @@ -329,14 +308,7 @@ internal void SnapshotDeltaWithMetricPointReclaim()
continue;
}

if (this.IsExemplarEnabled())
{
metricPoint.TakeSnapshotWithExemplar(outputDelta: true);
}
else
{
metricPoint.TakeSnapshot(outputDelta: true);
}
this.TakeMetricPointSnapshot(ref metricPoint, outputDelta: true);

this.currentMetricPointBatch[this.batchSize] = i;
this.batchSize++;
Expand All @@ -358,14 +330,7 @@ internal void SnapshotCumulative(int indexSnapshot)
continue;
}

if (this.IsExemplarEnabled())
{
metricPoint.TakeSnapshotWithExemplar(outputDelta: false);
}
else
{
metricPoint.TakeSnapshot(outputDelta: false);
}
this.TakeMetricPointSnapshot(ref metricPoint, outputDelta: false);

this.currentMetricPointBatch[this.batchSize] = i;
this.batchSize++;
Expand Down Expand Up @@ -395,6 +360,18 @@ private static double[] FindDefaultHistogramBounds(in MetricStreamIdentity metri
return Metric.DefaultHistogramBounds;
}

private void TakeMetricPointSnapshot(ref MetricPoint metricPoint, bool outputDelta)
{
if (this.IsExemplarEnabled())
{
metricPoint.TakeSnapshotWithExemplar(outputDelta);
}
else
{
metricPoint.TakeSnapshot(outputDelta);
}
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void InitializeZeroTagPointIfNotInitialized()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

# Generate self-signed certificate for the collector
openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

# Trust the self-signed certificated used by the collector
cp /cfg/otel-collector.crt /usr/local/share/ca-certificates/
Expand Down

0 comments on commit 7d538b2

Please sign in to comment.