-
Notifications
You must be signed in to change notification settings - Fork 773
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
OTLP exporter: use Grpc.Net.Client for netstandard2.1 #1662
Merged
cijothomas
merged 8 commits into
open-telemetry:master
from
alanwest:alanwest/oltp-use-grpc-dotnet
Jan 4, 2021
+88
−10
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
212ad73
Use Grpc.Net.Client for netstandard2.1
alanwest 7baca2f
Fix AspNetCore example app
alanwest cbf8578
Better comment for Http2UnencryptedSupport switch
alanwest 11401aa
Update PublicAPI
alanwest 53136d8
Update changelog
alanwest 64777d3
Fix line endings
alanwest 382a1da
Suppress instrumentation on export
alanwest c5bb486
Merge branch 'master' into alanwest/oltp-use-grpc-dotnet
cijothomas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
18 changes: 18 additions & 0 deletions
18
...elemetry.Exporter.OpenTelemetryProtocol/.publicApi/netstandard2.1/PublicAPI.Unshipped.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporter | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporter.OtlpExporter(OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions options) -> void | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions<System.Diagnostics.Activity> | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.BatchExportProcessorOptions.set -> void | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.GrpcChannelOptions.get -> Grpc.Net.Client.GrpcChannelOptions | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.GrpcChannelOptions.set -> void | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.Endpoint.get -> System.Uri | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.Endpoint.set -> void | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.ExportProcessorType.get -> OpenTelemetry.ExportProcessorType | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.ExportProcessorType.set -> void | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.Headers.get -> Grpc.Core.Metadata | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.Headers.set -> void | ||
OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions.OtlpExporterOptions() -> void | ||
OpenTelemetry.Trace.OtlpExporterHelperExtensions | ||
override OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporter.Export(in OpenTelemetry.Batch<System.Diagnostics.Activity> activityBatch) -> OpenTelemetry.ExportResult | ||
override OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporter.OnShutdown(int timeoutMilliseconds) -> bool | ||
static OpenTelemetry.Trace.OtlpExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Exporter.OpenTelemetryProtocol.OtlpExporterOptions> configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 9 additions & 2 deletions
11
...emetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,13 @@ | |
// limitations under the License. | ||
// </copyright> | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using Grpc.Core; | ||
#if NETSTANDARD2_1 | ||
using Grpc.Net.Client; | ||
#endif | ||
|
||
namespace OpenTelemetry.Exporter.OpenTelemetryProtocol | ||
{ | ||
|
@@ -25,27 +29,42 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol | |
/// </summary> | ||
public class OtlpExporterOptions | ||
{ | ||
#if NETSTANDARD2_1 | ||
/// <summary> | ||
/// Gets or sets the target to which the exporter is going to send traces or metrics. | ||
/// The valid syntax is described at https://github.com/grpc/grpc/blob/master/doc/naming.md. | ||
/// </summary> | ||
public Uri Endpoint { get; set; } = new Uri("http://localhost:55680"); | ||
#else | ||
/// <summary> | ||
/// Gets or sets the target to which the exporter is going to send traces or metrics. | ||
/// The valid syntax is described at https://github.com/grpc/grpc/blob/master/doc/naming.md. | ||
/// </summary> | ||
public string Endpoint { get; set; } = "localhost:55680"; | ||
#endif | ||
|
||
#if NETSTANDARD2_1 | ||
/// <summary> | ||
/// Gets or sets the gRPC channel options. | ||
/// </summary> | ||
public GrpcChannelOptions GrpcChannelOptions { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
#else | ||
/// <summary> | ||
/// Gets or sets the client-side channel credentials. Used for creation of a secure channel. | ||
/// The default is "insecure". See detais at https://grpc.io/docs/guides/auth/#credential-types. | ||
/// </summary> | ||
public ChannelCredentials Credentials { get; set; } = ChannelCredentials.Insecure; | ||
|
||
/// <summary> | ||
/// Gets or sets optional headers for the connection. | ||
/// Gets or sets the gRPC channel options. | ||
/// </summary> | ||
public Metadata Headers { get; set; } = new Metadata(); | ||
public IEnumerable<ChannelOption> ChannelOptions { get; set; } | ||
#endif | ||
|
||
/// <summary> | ||
/// Gets or sets the gRPC channel options. | ||
/// Gets or sets optional headers for the connection. | ||
/// </summary> | ||
public IEnumerable<ChannelOption> ChannelOptions { get; set; } | ||
public Metadata Headers { get; set; } = new Metadata(); | ||
|
||
/// <summary> | ||
/// Gets or sets the export processor type to be used with the OpenTelemetry Protocol Exporter. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the
netstandard2.1
build, I changed the Endpoint to be aUri
instead ofstring
. This is because if the scheme is not present then the client throws:I figure using
Uri
helps mitigate this.