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

Update OpenTelemetry Protocol Exporter #643

Merged
merged 4 commits into from
Apr 30, 2020

Conversation

pjanotti
Copy link
Contributor

Fix Issue #19.

Changes

Update the OTLP to version 0.3.0 of the proto files.

This does not address the issue of how to better handle the proto files, this will be done separately.

Checklist

  • I ran Unit Tests locally.
    Notice: that there were breaks on projects unrelated to the changes (tests on were run via dotnet test OpenTelemetry.sln on a mac.

Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

LGTM. Would you mind filing issues for the TODOs?

{
using var tracerFactory = TracerFactory.Create(builder => builder
.SetResource(Resources.CreateServiceResource("otlp-test"))
.UseOpenTelemetryProtocol(config => config.Endpoint = endpoint));
Copy link
Member

Choose a reason for hiding this comment

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

this is just a point for discussion, not blocking. THis name UseOpenTelemetryProtocol does not sound descriptive enough. Not clear that this is an exporter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think about naming it UseOtlpExporter? OTLP is how this is commonly known.

Copy link
Member

Choose a reason for hiding this comment

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

C# naming guidelines recommend to not abbreviate when possible. Would UseOpenTelemetryProtocolExporter work better? Or you think it's too long?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a bit on the long side but typically it will be used only once per app, will update the PR soon.

private static OtlpTrace.Status ToOtlpStatus(Status status)
{
// At this stage Status.IsValid is always true, just add status message if !Ok
if (status == Status.Ok)
Copy link
Member

Choose a reason for hiding this comment

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

OK may have a description. Why not add it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is comparing the whole struct so if a description was set it will be included. I will add a test to ensure that the behavior is not broken in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I'm not finding a way to set the description. Opened issue #653.


foreach (var resource in resourceToLibraryAndSpans)
{
// TODO: this is a temporary workaround since library is still on the resource, not on its own field.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow-up on issue #649

{
otlpSpan.Attributes.AddRange(spanData.Attributes.Select(ToOtlpAttribute));

// TODO: get dropped count.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow up on #650

["string"] = "text",
["double"] = 3.14,
["unknow_attrib_type"] =
new byte[] { 1 }, // TODO: update when arrays of standard attribute types are supported
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow up on #651

@pjanotti pjanotti force-pushed the update-otlp-trace branch from 8333423 to 23f583e Compare April 30, 2020 01:26
@pjanotti pjanotti force-pushed the update-otlp-trace branch from 7679801 to 4ddfb99 Compare April 30, 2020 21:24
@SergeyKanzhelev SergeyKanzhelev merged commit dacae6d into open-telemetry:master Apr 30, 2020
@pjanotti pjanotti deleted the update-otlp-trace branch May 1, 2020 16:02
Yun-Ting pushed a commit to Yun-Ting/opentelemetry-dotnet that referenced this pull request Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants