Metricsedit

Metrics contain application metric data captured by an APM agent.

Metric Schemaedit

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

{
  "$id": "docs/spec/v2/metricset",
  "type": "object",
  "properties": {
    "samples": {
      "description": "Samples hold application metrics collected from the agent.",
      "type": "object",
      "additionalProperties": false,
      "patternProperties": {
        "^[^*\"]*$": {
          "type": [
            "null",
            "object"
          ],
          "properties": {
            "value": {
              "description": "Value holds the value of a single metric sample.",
              "type": "number"
            }
          },
          "required": [
            "value"
          ]
        }
      }
    },
    "span": {
      "description": "Span holds selected information about the correlated transaction.",
      "type": [
        "null",
        "object"
      ],
      "properties": {
        "subtype": {
          "description": "Subtype is a further sub-division of the type (e.g. postgresql, elasticsearch)",
          "type": [
            "null",
            "string"
          ],
          "maxLength": 1024
        },
        "type": {
          "description": "Type expresses the correlated span's type as keyword that has specific relevance within the service's domain, eg: 'request', 'backgroundjob'.",
          "type": [
            "null",
            "string"
          ],
          "maxLength": 1024
        }
      }
    },
    "tags": {
      "description": "Tags are a flat mapping of user-defined tags. On the agent side, tags are called labels. Allowed value types are string, boolean and number values. Tags are indexed and searchable.",
      "type": [
        "null",
        "object"
      ],
      "additionalProperties": {
        "type": [
          "null",
          "string",
          "boolean",
          "number"
        ],
        "maxLength": 1024
      }
    },
    "timestamp": {
      "description": "Timestamp holds the recorded time of the event, UTC based and formatted as microseconds since Unix epoch",
      "type": [
        "null",
        "integer"
      ]
    },
    "transaction": {
      "description": "Transaction holds selected information about the correlated transaction.",
      "type": [
        "null",
        "object"
      ],
      "properties": {
        "name": {
          "description": "Name of the correlated transaction.",
          "type": [
            "null",
            "string"
          ],
          "maxLength": 1024
        },
        "type": {
          "description": "Type expresses the correlated transaction's type as keyword that has specific relevance within the service's domain, eg: 'request', 'backgroundjob'.",
          "type": [
            "null",
            "string"
          ],
          "maxLength": 1024
        }
      }
    }
  },
  "required": [
    "samples"
  ]
}