Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump OpenTelemetry to 1.5.1 #1255

Merged
merged 7 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<MicrosoftOwinPkgVer>[4.2.2,5.0)</MicrosoftOwinPkgVer>
<MicrosoftPublicApiAnalyzersPkgVer>[3.3.3]</MicrosoftPublicApiAnalyzersPkgVer>
<MicrosoftSourceLinkGitHubPkgVer>[1.1.1,2.0)</MicrosoftSourceLinkGitHubPkgVer>
<OpenTelemetryCoreLatestVersion>[1.5.0,2.0)</OpenTelemetryCoreLatestVersion>
<OpenTelemetryCoreLatestVersion>[1.5.1,2.0)</OpenTelemetryCoreLatestVersion>
<OpenTelemetryCoreLatestPrereleaseVersion>[1.5.0-rc.1]</OpenTelemetryCoreLatestPrereleaseVersion>
<StackExchangeRedisPkgVer>[2.1.58,3.0)</StackExchangeRedisPkgVer>
<CassandraCSharpDriverPkgVer>[3.16.0,4.0)</CassandraCSharpDriverPkgVer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.HttpListener" Version="1.5.0-rc.1" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.HttpListener" Version="$(OpenTelemetryCoreLatestPrereleaseVersion)" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Process\OpenTelemetry.Instrumentation.Process.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.HttpListener" Version="1.5.0-rc.1" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.HttpListener" Version="$(OpenTelemetryCoreLatestPrereleaseVersion)" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Runtime\OpenTelemetry.Instrumentation.Runtime.csproj" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Contrib.Extensions.AWSXRay/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
([#1140](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1140))
* Extract AWS Resource Detectors to dedicated package `OpenTelemetry.ResourceDetectors.AWS`
([#1140](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1140))
* Updates to 1.5.1 of OpenTelemetry SDK.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.2.0

Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Update OpenTelemetry SDK version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.5.0

Released 2023-Jun-14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,8 @@ internal int SerializeLogRecord(LogRecord logRecord)
// `LogRecord.State` and `LogRecord.StateValues` were marked Obsolete in https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334
#pragma warning disable 0618
IReadOnlyList<KeyValuePair<string, object>> listKvp;
if (logRecord.State == null)
if (logRecord.StateValues != null)
utpilla marked this conversation as resolved.
Show resolved Hide resolved
{
// When State is null, OTel SDK guarantees StateValues is populated
// TODO: Debug.Assert?
listKvp = logRecord.StateValues;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,8 @@ internal void SerializeLogRecord(LogRecord logRecord)

// `LogRecord.State` and `LogRecord.StateValues` were marked Obsolete in https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334
#pragma warning disable 0618
if (logRecord.State == null)
if (logRecord.StateValues != null)
{
// When State is null, OTel SDK guarantees StateValues is populated
// TODO: Debug.Assert?
listKvp = logRecord.StateValues;
}
else
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Exporter.InfluxDB/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Updates to 1.5.1 of OpenTelemetry SDK.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-alpha.2

Released 2023-Jun-20
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Exporter.Instana/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Drop support for .NET Framework 4.6.1.
The lowest supported version is .NET Framework 4.6.2.
([#1050](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1050))
* Update OTel SDK version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.3

Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
non-zero on `LogRecord`s.
([#1127](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1127))

* Update OpenTelemetry to 1.5.1
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 0.1.0-alpha.2

Released 2023-Mar-6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ protected override void SerializeItemToJson(Resource resource, LogRecord item, C

string? body = null;

if (item.StateValues != null)
if (item.Attributes != null)
{
for (int i = 0; i < item.StateValues.Count; i++)
for (int i = 0; i < item.Attributes.Count; i++)
{
var attribute = item.StateValues[i];
var attribute = item.Attributes[i];

if (string.IsNullOrEmpty(attribute.Key))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry" Version="[1.4.0,2.0.0)" />
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestVersion)" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonPkgVer)" Condition="'$(TargetFramework)' != 'net7.0' AND '$(TargetFramework)' != 'net6.0'" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/OpenTelemetry.Exporter.OneCollector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ dotnet add package --prerelease OpenTelemetry.Exporter.OneCollector
using var logFactory = LoggerFactory.Create(builder => builder
.AddOpenTelemetry(builder =>
{
builder.ParseStateValues = true;
builder.IncludeScopes = true;
builder.AddOneCollectorExporter("InstrumentationKey=instrumentation-key-here");
}));
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Exporter.Stackdriver/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Update OTel SDK version to `1.5.0`.
Kielek marked this conversation as resolved.
Show resolved Hide resolved
([#1220](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1220))
* Update OTel SDK version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-beta.4

Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Extensions/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* Add LogToActivityEventConversionOptions.Filter callback
([#1059](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1059))

* Update OTel SDK version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-beta.4

Released 2023-Feb-27
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ public override void OnEnd(LogRecord data)

data.ForEachScope(ProcessScope, new State(tags, this));

if (data.StateValues != null)
if (data.Attributes != null)
{
try
{
this.options.StateConverter?.Invoke(tags, data.StateValues);
this.options.StateConverter?.Invoke(tags, data.Attributes);
}
#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception ex)
#pragma warning restore CA1031 // Do not catch general exception types
{
OpenTelemetryExtensionsEventSource.Log.LogProcessorException($"Processing state of type [{data.State?.GetType().FullName}]", ex);
OpenTelemetryExtensionsEventSource.Log.LogProcessorException($"Processing attributes for LogRecord with CategoryName [{data.CategoryName}]", ex);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry" Version="[1.4.0,2.0.0)" />
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Update `OpenTelemetry.Api` to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-rc9.9

Released 2023-Jun-09
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.Cassandra/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Updates to 1.5.0 of OpenTelemetry SDK.
([#1220](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1220))
* Updates to 1.5.1 of OpenTelemetry SDK.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-beta.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Updated OTel SDK package version to 1.5.0
([#1220](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1220))
* Updated OTel SDK package version to 1.5.1
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-beta.4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
enable filtering of instrumentation.
([#1203](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1203))

* Updated OTel SDK package version to 1.5.1
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-beta.7

Released 2023-Jun-09
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Update OpenTelemetry.Api to 1.5.0.
([#1220](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1220))
* Update OpenTelemetry.Api to 1.5.1.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-alpha.2

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

## Unreleased

* Update OTel API version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.5.0-beta.1

Released 2023-Jun-23
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.MySqlData/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Update OTel API version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-beta.7

Released 2023-Jun-09
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.Owin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
([#1220](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1220))
* Removes `AddOwinInstrumentation` method with default configure parameter.
([#929](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/929))
* Updated OpenTelemetry SDK to 1.5.1
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-rc.3

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

## Unreleased

* Update OpenTelemetry API to 1.5.1
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 0.5.0-beta.3

Released 2023-Jun-09
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.Quartz/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Update OpenTelemetry.Api to 1.5.1.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-alpha.3

Released 2023-Jun-09
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
GC for .NET 7 and greater versions
([#1239](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1239))

* Update OpenTelemetry API to 1.5.1
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.5.0

Released 2023-Jun-06
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Update OTel API version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-rc9.10

Released 2023-Jun-09
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.Wcf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Update OTel SDK version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-rc.10

Released 2023-Jun-09
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.ResourceDetectors.AWS/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
* Initial release. Previously it was part of `OpenTelemetry.Contrib.Extensions.AWSXRay`
package.
([#1140](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1140))

* Update OTel SDK version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))
3 changes: 3 additions & 0 deletions src/OpenTelemetry.ResourceDetectors.Container/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Updates to 1.5.1 of OpenTelemetry SDK.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))

## 1.0.0-beta.4

Released 2023-Jun-09
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Sampler.AWS/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ Initial release of `OpenTelemetry.Sampler.AWS`.
* Feature - AWSXRayRemoteSampler - Add support for AWS X-Ray remote sampling
([#1091](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1091),
[#1124](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1124))

* Update OTel SDK version to `1.5.1`.
([#1255](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1255))
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,32 @@
// </copyright>

using System.Diagnostics.Metrics;
using System.Reflection;
using OpenTelemetry.Exporter.InfluxDB.Tests.Utils;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using Xunit;

namespace OpenTelemetry.Exporter.InfluxDB.Tests;

public class InfluxDBMetricsExporterTests
{
private static readonly string OpenTelemetrySdkVersion;

#pragma warning disable CA1810 // Initialize reference type static fields inline
static InfluxDBMetricsExporterTests()
#pragma warning restore CA1810 // Initialize reference type static fields inline
{
var sdkVersion = typeof(Sdk).Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>()?.Version;
if (sdkVersion != null)
{
OpenTelemetrySdkVersion = Version.Parse(sdkVersion).ToString(3);
}
else
{
OpenTelemetrySdkVersion = "0.0.0";
}
}

[Theory]
[InlineData(MetricsSchema.TelegrafPrometheusV1, "test-gauge", "gauge")]
[InlineData(MetricsSchema.TelegrafPrometheusV2, "prometheus", "test-gauge")]
Expand Down Expand Up @@ -440,7 +457,7 @@ static void AssertBucketDataPoint(PointData dataPoint, string bound, long count)
AssertUtils.HasTag("tag_key_2", "tag_value_2", 6, dataPoint.Tags);
AssertUtils.HasTag("telemetry.sdk.language", "dotnet", 7, dataPoint.Tags);
AssertUtils.HasTag("telemetry.sdk.name", "opentelemetry", 8, dataPoint.Tags);
AssertUtils.HasTag("telemetry.sdk.version", "1.5.0", 9, dataPoint.Tags);
AssertUtils.HasTag("telemetry.sdk.version", OpenTelemetrySdkVersion, 9, dataPoint.Tags);
}
}

Expand Down Expand Up @@ -490,6 +507,6 @@ private static void AssertTags(PointData dataPoint)
AssertUtils.HasTag("tag_key_2", "tag_value_2", 5, dataPoint.Tags);
AssertUtils.HasTag("telemetry.sdk.language", "dotnet", 6, dataPoint.Tags);
AssertUtils.HasTag("telemetry.sdk.name", "opentelemetry", 7, dataPoint.Tags);
AssertUtils.HasTag("telemetry.sdk.version", "1.5.0", 8, dataPoint.Tags);
AssertUtils.HasTag("telemetry.sdk.version", OpenTelemetrySdkVersion, 8, dataPoint.Tags);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private static LogRecord CreateLogRecord(int index)
logRecord.EventId = new EventId(1);
}

logRecord.StateValues = new List<KeyValuePair<string, object?>>
logRecord.Attributes = new List<KeyValuePair<string, object?>>
{
new KeyValuePair<string, object?>("userId", 18),
new KeyValuePair<string, object?>("greeting", "hello world"),
Expand Down
Loading