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

apm: add ParentID methods to Span and Transaction #956

Merged
merged 5 commits into from
Apr 23, 2021
Merged

apm: add ParentID methods to Span and Transaction #956

merged 5 commits into from
Apr 23, 2021

Commits on Apr 23, 2021

  1. apm: add ParentID methods to Span and Transaction

    Adds two new methods to the `Span` and `Transaction` types, expanding
    the API so consumers can extract the ParentIDs should they desire to.
    
    The `Transaction.ParentID()` call reuses the already existing method
    `Transaction.EnsureParent()` since it handles all the cases already.
    
    `Span.ParentID()` is much simpler and does not generate a new SpanID
    when `parentID` is zero or nil, simply returns an empty `SpanID` with
    its zero value.
    
    Closes #909.
    
    Signed-off-by: Marc Lopez <marc5.12@outlook.com>
    marclop committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    a97f70c View commit details
    Browse the repository at this point in the history
  2. Address review comments

    Adds a new `parentID` field to both `Transaction` and `Span` structures.
    The `parentID` is only populated at start time and remains immutable
    throughout the lifecycle of the Transaction or Span, making it possible
    to retrieve the `parentID` for either after they have ended.
    However, the `ParentID()` call might return a zero value `SpanID` when
    a trace has no parent.
    
    Signed-off-by: Marc Lopez <marc5.12@outlook.com>
    marclop committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    d34a8a3 View commit details
    Browse the repository at this point in the history
  3. Address review comments

    Removes the `TransactionData.parentSpan` field in favor of the new
    `Transaction.parentID` and updates `EnsureParent()` to update that field
    and `Transaction.ParentID()` to hold a read lock to read `tx.parentID`.
    
    Signed-off-by: Marc Lopez <marc5.12@outlook.com>
    marclop committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    6921148 View commit details
    Browse the repository at this point in the history
  4. Remove SpanData.parentID in favor of Span.parentID

    Signed-off-by: Marc Lopez <marc5.12@outlook.com>
    marclop committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    b77532b View commit details
    Browse the repository at this point in the history
  5. Update changelog

    Signed-off-by: Marc Lopez <marc5.12@outlook.com>
    marclop committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    899c34c View commit details
    Browse the repository at this point in the history