Class Transaction

  • All Implemented Interfaces:
    Recyclable

    public class Transaction
    extends AbstractSpan<Transaction>
    Data captured by an agent representing an event occurring in a monitored service
    • Method Detail

      • getContextEnsureVisibility

        public TransactionContext getContextEnsureVisibility()
        Returns the context and ensures visibility when accessed from a different thread.
        Returns:
        the transaction context
        See Also:
        getContext()
      • withType

        public Transaction withType​(@Nullable
                                    java.lang.String type)
        Keyword of specific relevance in the service's domain (eg: 'request', 'backgroundjob')
      • getResult

        @Nullable
        public java.lang.String getResult()
        The result of the transaction. HTTP status code for HTTP-related transactions.
      • withResultIfUnset

        public Transaction withResultIfUnset​(@Nullable
                                             java.lang.String result)
        The result of the transaction. HTTP status code for HTTP-related transactions. This sets the result only if it is not already set. should be used for instrumentations
      • withResult

        public Transaction withResult​(@Nullable
                                      java.lang.String result)
        The result of the transaction. HTTP status code for HTTP-related transactions. This sets the result regardless of an already existing value. should be used for user defined results
      • setUser

        public void setUser​(java.lang.String id,
                            java.lang.String email,
                            java.lang.String username,
                            java.lang.String domain)
      • getSpanCount

        public SpanCount getSpanCount()
      • isNoop

        public boolean isNoop()
      • ignoreTransaction

        public void ignoreTransaction()
        Ignores this transaction, which makes it a noop so that it will not be reported to the APM Server.
      • getType

        @Nullable
        public java.lang.String getType()
      • addCustomContext

        public void addCustomContext​(java.lang.String key,
                                     java.lang.String value)
      • addCustomContext

        public void addCustomContext​(java.lang.String key,
                                     java.lang.Number value)
      • addCustomContext

        public void addCustomContext​(java.lang.String key,
                                     java.lang.Boolean value)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setFrameworkName

        public void setFrameworkName​(@Nullable
                                     java.lang.String frameworkName)
      • setUserFrameworkName

        public void setUserFrameworkName​(@Nullable
                                         java.lang.String frameworkName)
      • getFrameworkName

        @Nullable
        public java.lang.String getFrameworkName()
      • setFrameworkVersion

        public void setFrameworkVersion​(@Nullable
                                        java.lang.String frameworkVersion)
      • getFrameworkVersion

        @Nullable
        public java.lang.String getFrameworkVersion()