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

O11Y-1750: implement spanLinks #56

Merged
merged 4 commits into from
May 25, 2022
Merged

O11Y-1750: implement spanLinks #56

merged 4 commits into from
May 25, 2022

Conversation

changliu-wk
Copy link
Contributor

@changliu-wk changliu-wk commented May 9, 2022

https://jira.atl.workiva.net/browse/O11Y-1750

This PR implements spanLinks.

  • Constructor calls _addLinks to implement spanLinks in a span.
  • Serialize span links by using Protocol Buffers when exporting spans.

There are three limits with spanLinks.

  1. Span can't have more links than maxNumLink.
  2. Span can't have more attributes in a link than maxNumAttributesPerLink.
  3. The string length of each spanLink attribute can't be longer than maxNumAttributeLength.

@Workiva/observability

@rmconsole-wf
Copy link

rmconsole-wf commented May 9, 2022

Merge Requirements Met ✅

Request Rosie to automerge this pull request by including @Workiva/release-management-p in a comment.

General Information

Ticket(s):

Code Review(s): #56
Release Image Tags:

Reviewers: changliu-wk, blakeroberts-wk

Additional Information

Watchlist Notifications: None
Pull Requests included in release:

	When this pull is merged I will add it to the following release:
	Current version: opentelemetry-dart 0.10.1
	Version after merge: opentelemetry-dart 0.11.0
	Release Ticket(s): O11Y-1817

	This pull is considered a release pull
	The options defined for this repo will be carried out


Note: This is a shortened report. Click here to view Rosie's full evaluation.
Last updated on Wednesday, May 25 02:01 PM CST

@aviary2-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@semveraudit-wf
Copy link

semveraudit-wf commented May 10, 2022

Public API Changes

Recommendation: ‼️ Major version bump (fyi @Workiva/semver-audit-group )

@@ line 8: package:opentelemetry/src/sdk/trace/span.dart @@
class Span implements Span
-     Span Span(String name, SpanContext _spanContext, SpanId _parentSpanId, List<SpanProcessor> _processors, TimeProvider _timeProvider, Resource _resource, InstrumentationLibrary _instrumentationLibrary, {SpanKind kind, List<Attribute> attributes, List<SpanLink> links, Context parentContext, SpanLimits spanlimits, Int64 startTime})
+     Span Span(String name, SpanContext _spanContext, SpanId _parentSpanId, List<SpanProcessor> _processors, TimeProvider _timeProvider, Resource _resource, InstrumentationLibrary _instrumentationLibrary, {SpanKind kind, List<Attribute> attributes, List<SpanLink> links, Context parentContext, SpanLimits limits, Int64 startTime})
//    `spanlimits` was removed.
//    Removing a parameter is a major change.

+     List<SpanLink> get links
//    Adding a field is a minor change.

Showing results for 23550bc

Powered by semver-audit-service. Please report any problems by filing an issue.
Reported by the dart semver audit client 2.2.2
Browse public API.

Last edited UTC May 25 at 16:19:33

@changliu-wk
Copy link
Contributor Author

QA +1 Unit test cases passed, used Test App tested new update, didn't break anything. Span links seems no showing in NewRelic.

@blakeroberts-wk
Copy link
Contributor

Span links seems no showing in NewRelic.

New Relic has mentioned in the past that they do not support span links. I assume they just drop that data.

sdk.SpanLimits spanlimits,
sdk.SpanLimits limits,
Copy link
Contributor

Choose a reason for hiding this comment

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

Because we expose the type sdk.Span, this is a breaking change. I think it makes sense to either make this constructor not visible from our public API, or use one of the annotations here:

  1. https://pub.dev/documentation/meta/latest/meta/protected-constant.html
  2. https://pub.dev/documentation/meta/latest/meta/internal-constant.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. I just wanted this parameter have same naming convention with others, it won't break wo11y-dart, which just uses TracerProvider, and didn't think we exposed the type sdk.Span. But I think perhaps no customer use this type so far. Of course, if you think this is not a good change, we can keep it as it was.
  2. If we hide this constructor, is it also a breaking change?
  3. I will try to hide it as you suggested to see how it works.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have any issue with the name change. But going forward we should hide the sdk.Span constructor from consumers (however we do that) so we can continue to make changes to the constructor's arguments post 1.0 release if needed.

One option we may be able to explore is making the constructor private then supplying a protected/internal static method that invokes the private constructor. This static method would be what a tracer invokes to construct a span.

Copy link
Contributor Author

@changliu-wk changliu-wk May 11, 2022

Choose a reason for hiding this comment

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

One option we may be able to explore is making the constructor private then supplying a protected/internal static method that invokes the private constructor. This static method would be what a tracer invokes to construct a span.

I think this is a right way to do it. I will try 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.

I tried to let constructor to be a private method. But since it is an implementation of the abstract class, it would be safe to be remove from exported sdk API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this PR in wo11y-dart, we need to wait until O11Y-1786 is done to remove sdk span from exporting. I created a ticket for this work O11Y-1825.

@rmconsole-wf
Copy link

@changliu-wk This pull request has merge conflicts, please resolve.

@rmconsole-wf
Copy link

@changliu-wk This pull request has merge conflicts, please resolve.

@@ -168,6 +164,58 @@ class Span implements api.Span {
throw UnimplementedError();
}

// This method just can be called once during construction.
static List<api.SpanLink> _addLinks(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: perhaps a method name like _applyLinkLimits is a more descriptive method name?

@changliu-wk
Copy link
Contributor Author

QA +1

@changliu-wk
Copy link
Contributor Author

@Workiva/release-management-p

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@rmconsole2-wf rmconsole2-wf merged commit b141974 into master May 25, 2022
@rmconsole2-wf rmconsole2-wf deleted the Chang/O11Y-1750 branch May 25, 2022 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants