Skip to content

Commit

Permalink
internal/apmschema: update JSON Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
axw committed Sep 24, 2020
1 parent 6a36e8a commit a0f668f
Show file tree
Hide file tree
Showing 16 changed files with 411 additions and 55 deletions.
108 changes: 108 additions & 0 deletions internal/apmschema/jsonschema/cloud.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"$id": "docs/spec/cloud.json",
"title": "Cloud",
"type": [
"object",
"null"
],
"properties": {
"account": {
"properties": {
"id": {
"description": "Cloud account ID",
"type": [
"string",
"null"
],
"maxLength": 1024
},
"name": {
"description": "Cloud account name",
"type": [
"string",
"null"
],
"maxLength": 1024
}
}
},
"availability_zone": {
"description": "Cloud availability zone name. e.g. us-east-1a",
"type": [
"string",
"null"
],
"maxLength": 1024
},
"instance": {
"properties": {
"id": {
"description": "Cloud instance/machine ID",
"type": [
"string",
"null"
],
"maxLength": 1024
},
"name": {
"description": "Cloud instance/machine name",
"type": [
"string",
"null"
],
"maxLength": 1024
}
}
},
"machine": {
"properties": {
"type": {
"description": "Cloud instance/machine type",
"type": [
"string",
"null"
],
"maxLength": 1024
}
}
},
"project": {
"properties": {
"id": {
"description": "Cloud project ID",
"type": [
"string",
"null"
],
"maxLength": 1024
},
"name": {
"description": "Cloud project name",
"type": [
"string",
"null"
],
"maxLength": 1024
}
}
},
"provider": {
"description": "Cloud provider name. e.g. aws, azure, gcp, digitalocean.",
"type": [
"string"
],
"maxLength": 1024
},
"region": {
"description": "Cloud region name. e.g. us-east-1",
"type": [
"string",
"null"
],
"maxLength": 1024
}
},
"required": [
"provider"
]
}
41 changes: 18 additions & 23 deletions internal/apmschema/jsonschema/context.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "doc/spec/context.json",
"$id": "docs/spec/context.json",
"title": "Context",
"description": "Any arbitrary contextual information regarding the event, captured by the agent, optionally provided by the user",
"type": ["object", "null"],
Expand All @@ -14,31 +14,26 @@
},
"response": {
"type": ["object", "null"],
"properties": {
"finished": {
"description": "A boolean indicating whether the response was finished or not",
"type": ["boolean", "null"]
},
"headers": {
"description": "A mapping of HTTP headers of the response object",
"type": ["object", "null"],
"patternProperties": {
"[.*]*$": {
"type": ["string", "array", "null"],
"items": {
"type": ["string"]
}
"allOf": [
{ "$ref": "./http_response.json" },
{
"properties": {
"finished": {
"description": "A boolean indicating whether the response was finished or not",
"type": [
"boolean",
"null"
]
},
"headers_sent": {
"type": [
"boolean",
"null"
]
}
}
},
"headers_sent": {
"type": ["boolean", "null"]
},
"status_code": {
"description": "The HTTP status code of the response.",
"type": ["integer", "null"]
}
}
]
},
"request": {
"$ref": "request.json"
Expand Down
35 changes: 35 additions & 0 deletions internal/apmschema/jsonschema/http_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$id": "docs/spec/http_response.json",
"title": "HTTP response object",
"description": "HTTP response object, used by error, span and transction documents",
"type": ["object", "null"],
"properties": {
"status_code": {
"type": ["integer", "null"],
"description": "The status code of the http request."
},
"transfer_size": {
"type": ["number", "null"],
"description": "Total size of the payload."
},
"encoded_body_size": {
"type": ["number", "null"],
"description": "The encoded size of the payload."
},
"decoded_body_size": {
"type": ["number", "null"],
"description": "The decoded size of the payload."
},
"headers": {
"type": ["object", "null"],
"patternProperties": {
"[.*]*$": {
"type": ["string", "array", "null"],
"items": {
"type": ["string"]
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion internal/apmschema/jsonschema/message.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "doc/spec/message.json",
"$id": "docs/spec/message.json",
"title": "Message",
"description": "Details related to message receiving and publishing if the captured event integrates with a messaging system",
"type": ["object", "null"],
Expand Down
Loading

0 comments on commit a0f668f

Please sign in to comment.