Transactionsedit

Transactions are events corresponding to an incoming request or similar task occurring in a monitored service.

Transaction Schemaedit

APM Server uses JSON Schema to validate requests. The specification for transactions is defined on GitHub and included below:

{
    "$id": "docs/spec/transactions/transaction.json",
    "type": "object",
    "description": "An event corresponding to an incoming request or similar task occurring in a monitored service",
    "allOf": [
        { "$ref": "../timestamp_epoch.json" },
        { "$ref": "../transaction_name.json" },
        { "$ref": "../transaction_type.json" },
        {
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Hex encoded 64 random bits ID of the transaction.",
                    "maxLength": 1024
                },
                "trace_id": {
                    "description": "Hex encoded 128 random bits ID of the correlated trace.",
                    "type": "string",
                    "maxLength": 1024
                },
                "parent_id": {
                    "description": "Hex encoded 64 random bits ID of the parent transaction or span. Only root transactions of a trace do not have a parent_id, otherwise it needs to be set.",
                    "type": ["string", "null"],
                    "maxLength": 1024
                },
                "sample_rate": {
                    "description": "Sampling rate",
                    "type": ["number", "null"]
                },
                "span_count": {
                    "type": "object",
                    "properties": {
                        "started": {
                            "type": "integer",
                            "description": "Number of correlated spans that are recorded."

                        },
                        "dropped": {
                            "type": ["integer","null"],
                            "description": "Number of spans that have been dropped by the agent recording the transaction."

                        }
                    },
                    "required": ["started"]
                },
                "context": {
                    "$ref": "../context.json"
                },
                "duration": {
                    "type": "number",
                    "description": "How long the transaction took to complete, in ms with 3 decimal points",
                    "minimum": 0
                },
                "result": {
                    "type": ["string", "null"],
                    "description": "The result of the transaction. For HTTP-related transactions, this should be the status code formatted like 'HTTP 2xx'.",
                    "maxLength": 1024
                },
                "outcome": {
                    "$ref": "../outcome.json",
                    "description": "The outcome of the transaction: success, failure, or unknown. This is similar to 'result', but has a limited set of permitted values describing the success or failure of the transaction from the service's perspective. This field can be used for calculating error rates for incoming requests."
                },
                "marks": {
                    "type": ["object", "null"],
                    "description": "A mark captures the timing of a significant event during the lifetime of a transaction. Marks are organized into groups and can be set by the user or the agent.",
                    "patternProperties": {
                        "^[^.*\"]*$": {
                            "$ref": "mark.json"
                        }
                    },
                    "additionalProperties": false
                },
                "sampled": {
                    "type": ["boolean", "null"],
                    "description": "Transactions that are 'sampled' will include all available information. Transactions that are not sampled will not have 'spans' or 'context'. Defaults to true."
                },
                "experience": {
                    "$ref": "rum_experience.json"
                }
            },
            "required": ["id", "trace_id", "span_count", "duration", "type"]
        }
    ]
}