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

[Exporter.Geneva] Update OTel SDK prerelease version #1210

Merged
merged 13 commits into from
Jun 2, 2023
Merged
2 changes: 1 addition & 1 deletion build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<MicrosoftPublicApiAnalyzersPkgVer>[3.3.3]</MicrosoftPublicApiAnalyzersPkgVer>
<MicrosoftSourceLinkGitHubPkgVer>[1.1.1,2.0)</MicrosoftSourceLinkGitHubPkgVer>
<OpenTelemetryCoreLatestVersion>[1.4.0,2.0)</OpenTelemetryCoreLatestVersion>
<OpenTelemetryCoreLatestPrereleaseVersion>[1.5.0-alpha.1]</OpenTelemetryCoreLatestPrereleaseVersion>
<OpenTelemetryCoreLatestPrereleaseVersion>[1.5.0-rc.1]</OpenTelemetryCoreLatestPrereleaseVersion>
cijothomas marked this conversation as resolved.
Show resolved Hide resolved
<StackExchangeRedisPkgVer>[2.1.58,3.0)</StackExchangeRedisPkgVer>
<CassandraCSharpDriverPkgVer>[3.16.0,4.0)</CassandraCSharpDriverPkgVer>
<StyleCopAnalyzersPkgVer>[1.2.0-beta.435,2.0)</StyleCopAnalyzersPkgVer>
Expand Down
7 changes: 7 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

## Unreleased

* Fix an issue with getting sanitized category name in pass-through table name
mapping cases for `TldLogExporter`.
([#1175](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1175))

* TldLogExporter to export `SpanId` value in `ext_dt_spanId` field instead of
`TraceId` value.
([#1184](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1184))

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

## 1.5.0-alpha.3

Released 2023-Apr-19
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ internal bool IsUsingUnixDomainSocket

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cijothomas @CodeBlanch Okay with this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Doing this suppress-warning, will be yet another validation that the main sdk has done everything in back-compat way!

IReadOnlyList<KeyValuePair<string, object>> listKvp;
if (logRecord.State == null)
{
Expand All @@ -150,6 +152,7 @@ internal int SerializeLogRecord(LogRecord logRecord)
// Attempt to see if State could be ROL_KVP.
listKvp = logRecord.State as IReadOnlyList<KeyValuePair<string, object>>;
}
#pragma warning restore 0618

var buffer = m_buffer.Value;
if (buffer == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ public void Dispose()
internal void SerializeLogRecord(LogRecord logRecord)
{
IReadOnlyList<KeyValuePair<string, object>> listKvp;

// `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)
{
// When State is null, OTel SDK guarantees StateValues is populated
Expand All @@ -198,6 +201,7 @@ internal void SerializeLogRecord(LogRecord logRecord)
// Attempt to see if State could be ROL_KVP.
listKvp = logRecord.State as IReadOnlyList<KeyValuePair<string, object>>;
}
#pragma warning restore 0618

// Structured log.
// 2 scenarios.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,9 @@ private void AssertFluentdForwardModeForLogRecord(GenevaExporterOptions exporter

bool isUnstructuredLog = true;
IReadOnlyList<KeyValuePair<string, object>> stateKeyValuePairList;

// `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)
{
stateKeyValuePairList = logRecord.StateValues;
Expand All @@ -1384,6 +1387,7 @@ private void AssertFluentdForwardModeForLogRecord(GenevaExporterOptions exporter
{
stateKeyValuePairList = logRecord.State as IReadOnlyList<KeyValuePair<string, object>>;
}
#pragma warning restore 0618

if (stateKeyValuePairList != null)
{
Expand All @@ -1392,10 +1396,13 @@ private void AssertFluentdForwardModeForLogRecord(GenevaExporterOptions exporter

if (isUnstructuredLog)
{
// `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)
{
Assert.Equal(logRecord.State.ToString(), mapping["body"]);
}
#pragma warning restore 0618
else
{
Assert.Equal(stateKeyValuePairList[0].Value, mapping["body"]);
Expand Down