go-agent: github.com/newrelic/go-agent/v3/internal/cat Index | Files

package cat

import "github.com/newrelic/go-agent/v3/internal/cat"

Package cat provides functionality related to the wire format of CAT headers.

Index

Package Files

appdata.go errors.go headers.go id.go path_hash.go synthetics.go txndata.go

Constants

const (
    NewRelicIDName         = "X-Newrelic-Id"
    NewRelicTxnName        = "X-Newrelic-Transaction"
    NewRelicAppDataName    = "X-Newrelic-App-Data"
    NewRelicSyntheticsName = "X-Newrelic-Synthetics"
)

These header names don't match the spec in terms of their casing, but does match what Go will give us from http.CanonicalHeaderKey(). Besides, HTTP headers are case insensitive anyway. Rejoice!

func GeneratePathHash Uses

func GeneratePathHash(referringPathHash, txnName, appName string) (string, error)

GeneratePathHash generates a path hash given a referring path hash, transaction name, and application name. referringPathHash can be an empty string if there was no referring path hash.

type AppDataHeader Uses

type AppDataHeader struct {
    CrossProcessID        string
    TransactionName       string
    QueueTimeInSeconds    float64
    ResponseTimeInSeconds float64
    ContentLength         int64
    TransactionGUID       string
}

AppDataHeader represents a decoded AppData header.

func (*AppDataHeader) MarshalJSON Uses

func (appData *AppDataHeader) MarshalJSON() ([]byte, error)

MarshalJSON marshalls an AppDataHeader as raw JSON.

func (*AppDataHeader) UnmarshalJSON Uses

func (appData *AppDataHeader) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshalls an AppDataHeader from raw JSON.

type IDHeader Uses

type IDHeader struct {
    AccountID int
    Blob      string
}

IDHeader represents a decoded cross process ID header (generally encoded as a string in the form ACCOUNT#BLOB).

func NewIDHeader Uses

func NewIDHeader(in []byte) (*IDHeader, error)

NewIDHeader parses the given decoded ID header and creates an IDHeader representing it.

type SyntheticsHeader Uses

type SyntheticsHeader struct {
    Version    int
    AccountID  int
    ResourceID string
    JobID      string
    MonitorID  string
}

SyntheticsHeader represents a decoded Synthetics header.

func (*SyntheticsHeader) UnmarshalJSON Uses

func (s *SyntheticsHeader) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshalls a SyntheticsHeader from raw JSON.

type TxnDataHeader Uses

type TxnDataHeader struct {
    GUID     string
    TripID   string
    PathHash string
}

TxnDataHeader represents a decoded TxnData header.

func (*TxnDataHeader) MarshalJSON Uses

func (txnData *TxnDataHeader) MarshalJSON() ([]byte, error)

MarshalJSON marshalls a TxnDataHeader as raw JSON.

func (*TxnDataHeader) UnmarshalJSON Uses

func (txnData *TxnDataHeader) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshalls a TxnDataHeader from raw JSON.

Package cat imports 10 packages (graph) and is imported by 2 packages. Updated 2019-12-02. Refresh now. Tools for package owners.