Skip to content

Commit

Permalink
Merge branch 'main' into 1997-multiple-connection-support
Browse files Browse the repository at this point in the history
  • Loading branch information
YayBurritos authored Sep 9, 2024
2 parents 74f9f46 + 8606d7d commit efe14d0
Show file tree
Hide file tree
Showing 121 changed files with 3,228 additions and 1,242 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/Component.BuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
required: false
type: string
tfm-list:
default: '[ "net462", "net6.0", "net7.0", "net8.0" ]'
default: '[ "net462", "net6.0", "net8.0" ]'
required: false
type: string

Expand Down Expand Up @@ -78,7 +78,6 @@ jobs:
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: dotnet restore ${{ steps.resolve-project.outputs.title }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-Exporter.OneCollector-Integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
version: [ net462, net6.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
with:
project-name: OpenTelemetry.Instrumentation.AspNetCore
code-cov-name: Instrumentation.AspNetCore
tfm-list: '[ "net6.0", "net7.0", "net8.0" ]'
tfm-list: '[ "net6.0", "net8.0" ]'

build-test-instrumentation-aws:
needs: detect-changes
Expand All @@ -219,7 +219,7 @@ jobs:
with:
project-name: Component[OpenTelemetry.Instrumentation.AWSLambda]
code-cov-name: Instrumentation.AWSLambda
tfm-list: '[ "net6.0", "net7.0", "net8.0" ]'
tfm-list: '[ "net6.0", "net8.0" ]'

build-test-instrumentation-cassandra:
needs: detect-changes
Expand Down Expand Up @@ -285,7 +285,7 @@ jobs:
with:
project-name: OpenTelemetry.Instrumentation.EventCounters
code-cov-name: Instrumentation.EventCounters
tfm-list: '[ "net6.0", "net7.0", "net8.0" ]'
tfm-list: '[ "net6.0", "net8.0" ]'

build-test-instrumentation-grpccore:
needs: detect-changes
Expand Down Expand Up @@ -485,6 +485,7 @@ jobs:
with:
project-name: Component[OpenTelemetry.Resources.Host]
code-cov-name: Resources.Host
os-list: '[ "windows-latest", "ubuntu-latest", "macos-latest" ]'

build-test-resources-operatingsystem:
needs: detect-changes
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [net6.0, net7.0, net8.0]
version: [net6.0, net8.0]
steps:
- uses: actions/checkout@v4

Expand All @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [net6.0, net7.0, net8.0]
version: [net6.0, net8.0]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You can contribute to this project from a Windows, macOS or Linux machine.
On all platforms, the minimum requirements are:

* Git client and command line tools.
* .NET 7.0+
* .NET 8.0+

Please note that individual project requirements might vary.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ repository](https://github.com/open-telemetry/community/blob/main/community-memb
* [Cijo Thomas](https://github.com/cijothomas), Microsoft
* [Mikel Blanchard](https://github.com/CodeBlanch), Microsoft
* [Piotr Kiełkowicz](https://github.com/Kielek), Splunk
* [Vishwesh Bankwar](https://github.com/vishweshbankwar), Microsoft

*Find more about the maintainer role in [community
repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).*
Expand All @@ -104,6 +103,7 @@ repository](https://github.com/open-telemetry/community/blob/main/community-memb
* [Prashant Srivastava](https://github.com/srprash)
* [Sergey Kanzhelev](https://github.com/SergeyKanzhelev)
* [Utkarsh Umesan Pillai](https://github.com/utpilla)
* [Vishwesh Bankwar](https://github.com/vishweshbankwar)

Even though, anybody can contribute, there are benefits of being a member of our
community. See to the [community membership
Expand Down
9 changes: 3 additions & 6 deletions build/Common.nonprod.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,20 @@
Refer to https://docs.microsoft.com/en-us/nuget/concepts/package-versioning for semver syntax.
-->
<BenchmarkDotNetPkgVer>[0.13.12,0.14)</BenchmarkDotNetPkgVer>
<DotNetXUnitCliVer>[2.3.1,3.0)</DotNetXUnitCliVer>
<MicrosoftExtensionsHostingPkgVer>8.0.0</MicrosoftExtensionsHostingPkgVer>
<MicrosoftNETTestSdkPkgVer>[17.9.0,18.0)</MicrosoftNETTestSdkPkgVer>
<MicrosoftNETTestSdkPkgVer>[17.11.0,18.0)</MicrosoftNETTestSdkPkgVer>
<OpenTelemetryExporterInMemoryPkgVer>$(OpenTelemetryCoreLatestVersion)</OpenTelemetryExporterInMemoryPkgVer>
<OpenTelemetryExporterInMemoryLatestPreReleasePkgVer>$(OpenTelemetryCoreLatestPrereleaseVersion)</OpenTelemetryExporterInMemoryLatestPreReleasePkgVer>
<SupportedNetTargets>net8.0;net7.0;net6.0</SupportedNetTargets>
<SupportedNetTargets>net8.0;net6.0</SupportedNetTargets>
<XUnitRunnerVisualStudioPkgVer>[2.8.2,3.0)</XUnitRunnerVisualStudioPkgVer>
<XUnitPkgVer>[2.9.0,3.0)</XUnitPkgVer>
<WiremockNetPkgVer>[1.5.58,2.0)</WiremockNetPkgVer>
<WiremockNetPkgVer>[1.6.1,2.0)</WiremockNetPkgVer>
</PropertyGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPkgVer)" />
<PackageReference Include="xunit" Version="$(XUnitPkgVer)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVisualStudioPkgVer)" PrivateAssets="All" />

<DotNetCliToolReference Include="dotnet-xunit" Version="$(DotNetXUnitCliVer)" />
</ItemGroup>

<Target Name="SkipVSTestForInvalidTargetFramework" BeforeTargets="VSTest" Condition="'$(IsTestProject)' == 'true'">
Expand Down
2 changes: 1 addition & 1 deletion build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<OpenTelemetryCoreLatestVersion>[1.9.0,2.0)</OpenTelemetryCoreLatestVersion>
<OpenTelemetryCoreLatestPrereleaseVersion>[1.9.0-rc.1]</OpenTelemetryCoreLatestPrereleaseVersion>
<StackExchangeRedisPkgVer>[2.6.122,3.0)</StackExchangeRedisPkgVer>
<ConfluentKafkaPkgVer>[2.3.0,3.0)</ConfluentKafkaPkgVer>
<ConfluentKafkaPkgVer>[2.4.0,3.0)</ConfluentKafkaPkgVer>
<CassandraCSharpDriverPkgVer>[3.16.0,4.0)</CassandraCSharpDriverPkgVer>
<StyleCopAnalyzersPkgVer>[1.2.0-beta.507,2.0)</StyleCopAnalyzersPkgVer>
<SystemNetHttp>[4.3.4,)</SystemNetHttp>
Expand Down
2 changes: 2 additions & 0 deletions build/OpenTelemetryContrib.prod.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
<Rule Id="SA1401" Action="None" />
<Rule Id="SA1512" Action="None" />
<Rule Id="SA1600" Action="None" />
<Rule Id="SA1601" Action="None" />
<Rule Id="SA1602" Action="None" />
</Rules>
</RuleSet>
9 changes: 0 additions & 9 deletions build/docker-compose.net7.0.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/AspNet/Examples.AspNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<PackageReference Include="Microsoft.AspNet.Mvc" Version="[5.3.0,6.0)" />
<PackageReference Include="Microsoft.AspNet.WebPages" Version="[3.3.0,4.0)" />
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestVersion)" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="$(OpenTelemetryCoreLatestVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="$(OpenTelemetryCoreLatestVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="$(OpenTelemetryCoreLatestVersion)" />
Expand Down
4 changes: 2 additions & 2 deletions examples/InfluxDB/Examples.InfluxDB/Examples.InfluxDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Examples.InfluxDB</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.4.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/wcf/client-core/Examples.Wcf.Client.DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{824BD1DE
build\Common.targets = build\Common.targets
build\debug.snk = build\debug.snk
build\docker-compose.net6.0.yml = build\docker-compose.net6.0.yml
build\docker-compose.net7.0.yml = build\docker-compose.net7.0.yml
build\docker-compose.net8.0.yml = build\docker-compose.net8.0.yml
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
build\OpenTelemetryContrib.prod.ruleset = build\OpenTelemetryContrib.prod.ruleset
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/EventNameExportMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace OpenTelemetry.Exporter.Geneva;

/// <summary>
/// Contains the event name export mode defintions.
/// </summary>
[Flags]
public enum EventNameExportMode
{
Expand Down
10 changes: 10 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/ExceptionStackExportMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@

namespace OpenTelemetry.Exporter.Geneva;

/// <summary>
/// Contains the exception stack trace export mode defintions.
/// </summary>
public enum ExceptionStackExportMode
{
/// <summary>
/// Exception stack traces are dropped.
/// </summary>
Drop,

/// <summary>
/// Exception stack traces are exported as strings.
/// </summary>
ExportAsString,

// ExportAsArrayOfStacks - future if stacks can be exported in more structured way
Expand Down
6 changes: 5 additions & 1 deletion src/OpenTelemetry.Exporter.Geneva/GenevaBaseExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

namespace OpenTelemetry.Exporter.Geneva;

/// <summary>
/// GenevaExporter base class.
/// </summary>
/// <typeparam name="T">The type of object to be exported.</typeparam>
public abstract class GenevaBaseExporter<T> : BaseExporter<T>
where T : class
where T : class
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

namespace OpenTelemetry.Exporter.Geneva;

/// <summary>
/// Contains extension methods to register the Geneva trace exporter.
/// </summary>
public static class GenevaExporterHelperExtensions
{
/// <summary>
Expand Down
24 changes: 24 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/GenevaExporterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace OpenTelemetry.Exporter.Geneva;

/// <summary>
/// Contains Geneva exporter options.
/// </summary>
public class GenevaExporterOptions
{
private IReadOnlyDictionary<string, object> _fields = new Dictionary<string, object>(1)
Expand All @@ -15,16 +18,34 @@ public class GenevaExporterOptions

private IReadOnlyDictionary<string, string> _tableNameMappings;

/// <summary>
/// Gets or sets the connection string.
/// </summary>
public string ConnectionString { get; set; }

/// <summary>
/// Gets or sets custom fields.
/// </summary>
public IEnumerable<string> CustomFields { get; set; }

/// <summary>
/// Gets or sets the exception stack trace export mode.
/// </summary>
public ExceptionStackExportMode ExceptionStackExportMode { get; set; }

/// <summary>
/// Gets or sets the event name export mode.
/// </summary>
public EventNameExportMode EventNameExportMode { get; set; }

/// <summary>
/// Gets or sets a value indicating whether or not trace state should be included when exporting traces.
/// </summary>
public bool IncludeTraceStateForSpan { get; set; }

/// <summary>
/// Gets or sets table name mappings.
/// </summary>
public IReadOnlyDictionary<string, string> TableNameMappings
{
get => this._tableNameMappings;
Expand Down Expand Up @@ -72,6 +93,9 @@ public IReadOnlyDictionary<string, string> TableNameMappings
}
}

/// <summary>
/// Gets or sets prepopulated fields.
/// </summary>
public IReadOnlyDictionary<string, object> PrepopulatedFields
{
get => this._fields;
Expand Down
9 changes: 9 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/GenevaLogExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

namespace OpenTelemetry.Exporter.Geneva;

/// <summary>
/// An exporter for Geneva logs.
/// </summary>
public class GenevaLogExporter : GenevaBaseExporter<LogRecord>
{
internal bool IsUsingUnixDomainSocket;
Expand All @@ -20,6 +23,10 @@ public class GenevaLogExporter : GenevaBaseExporter<LogRecord>

private readonly IDisposable exporter;

/// <summary>
/// Initializes a new instance of the <see cref="GenevaLogExporter"/> class.
/// </summary>
/// <param name="options"><see cref="GenevaExporterOptions"/>.</param>
public GenevaLogExporter(GenevaExporterOptions options)
{
Guard.ThrowIfNull(options);
Expand Down Expand Up @@ -76,11 +83,13 @@ public GenevaLogExporter(GenevaExporterOptions options)
}
}

/// <inheritdoc/>
public override ExportResult Export(in Batch<LogRecord> batch)
{
return this.exportLogRecord(in batch);
}

/// <inheritdoc/>
protected override void Dispose(bool disposing)
{
if (this.isDisposed)
Expand Down
19 changes: 15 additions & 4 deletions src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@

namespace Microsoft.Extensions.Logging;

/// <summary>
/// Contains extension methods to register the Geneva log exporter.
/// </summary>
public static class GenevaLoggingExtensions
{
public static OpenTelemetryLoggerOptions AddGenevaLogExporter(this OpenTelemetryLoggerOptions options, Action<GenevaExporterOptions> configure)
/// <summary>
/// Adds <see cref="GenevaLogExporter"/> to the <see cref="OpenTelemetryLoggerOptions"/>.
/// </summary>
/// <param name="options"><see cref="OpenTelemetryLoggerOptions"/>.</param>
/// <param name="configure">Callback action for configuring <see cref="GenevaExporterOptions"/>.</param>
/// <returns>The instance of <see cref="OpenTelemetryLoggerOptions"/> to chain the calls.</returns>
public static OpenTelemetryLoggerOptions AddGenevaLogExporter(
this OpenTelemetryLoggerOptions options,
Action<GenevaExporterOptions> configure)
{
Guard.ThrowIfNull(options);

Expand All @@ -31,15 +42,15 @@ public static OpenTelemetryLoggerOptions AddGenevaLogExporter(this OpenTelemetry
}

/// <summary>
/// Adds Geneva exporter to the LoggerProvider.
/// Adds <see cref="GenevaLogExporter"/> to the <see cref="LoggerProviderBuilder"/>.
/// </summary>
/// <param name="builder"><see cref="LoggerProviderBuilder"/> builder to use.</param>
/// <returns>The instance of <see cref="LoggerProviderBuilder"/> to chain the calls.</returns>
public static LoggerProviderBuilder AddGenevaLogExporter(this LoggerProviderBuilder builder)
=> AddGenevaLogExporter(builder, name: null, configureExporter: null);

/// <summary>
/// Adds Geneva exporter to the LoggerProvider.
/// Adds <see cref="GenevaLogExporter"/> to the <see cref="LoggerProviderBuilder"/>.
/// </summary>
/// <param name="builder"><see cref="LoggerProviderBuilder"/> builder to use.</param>
/// <param name="configureExporter">Callback action for configuring <see cref="GenevaExporterOptions"/>.</param>
Expand All @@ -48,7 +59,7 @@ public static LoggerProviderBuilder AddGenevaLogExporter(this LoggerProviderBuil
=> AddGenevaLogExporter(builder, name: null, configureExporter);

/// <summary>
/// Adds Geneva exporter to the LoggerProvider.
/// Adds <see cref="GenevaLogExporter"/> to the <see cref="LoggerProviderBuilder"/>.
/// </summary>
/// <param name="builder"><see cref="LoggerProviderBuilder"/> builder to use.</param>
/// <param name="name">Optional name which is used when retrieving options.</param>
Expand Down
Loading

0 comments on commit efe14d0

Please sign in to comment.