Skip to content

Commit

Permalink
Allow overriding service information from context. (#1901)
Browse files Browse the repository at this point in the history
* Allow overriding `service` information from `context`.

fixes #1175
  • Loading branch information
simitt authored Feb 8, 2019
1 parent 0eb42aa commit 62fbb81
Show file tree
Hide file tree
Showing 58 changed files with 844 additions and 669 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@
"service": {
"environment": "staging",
"framework": {
"name": "Express",
"version": "1.2.3"
"name": "Node",
"version": "1"
},
"language": {
"name": "ecmascript",
"version": "8"
"version": "1.2"
},
"name": "1234_service-12a3",
"name": "service1",
"runtime": {
"name": "node",
"version": "8.0.0"
Expand Down Expand Up @@ -386,8 +386,8 @@
},
"@timestamp": "2019-01-09T21:40:53.000Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
"name": "elastic-ruby",
"version": "2.1.3"
},
"container": {
"id": "container-id"
Expand Down Expand Up @@ -441,21 +441,21 @@
"name": "error"
},
"service": {
"environment": "staging",
"environment": "testing",
"framework": {
"name": "Express",
"version": "1.2.3"
"name": "Rails",
"version": "5.0"
},
"language": {
"name": "ecmascript",
"version": "8"
"name": "ruby",
"version": "2.5"
},
"name": "1234_service-12a3",
"name": "service1",
"runtime": {
"name": "node",
"version": "8.0.0"
"name": "cruby",
"version": "2.5"
},
"version": "5.1.3"
"version": "2"
},
"timestamp": {
"us": 1547070053000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@
},
"@timestamp": "2019-01-09T21:40:53.000Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
"name": "elastic-ruby",
"version": "2.2"
},
"observer": {
"ephemeral_id": "00000000-0000-0000-0000-000000000000",
Expand All @@ -236,7 +236,7 @@
"name": "transaction"
},
"service": {
"name": "backendspans"
"name": "service1"
},
"span": {
"action": "query",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"name": "1234_service-12a3",
"runtime": {
"name": "node",
"version": "8.0.0"
"version": "7.0"
},
"version": "5.1.3"
},
Expand Down Expand Up @@ -275,8 +275,8 @@
},
"@timestamp": "2018-07-30T18:53:42.281Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
"name": "elastic-ruby",
"version": "2.2"
},
"container": {
"id": "container-id"
Expand Down Expand Up @@ -326,21 +326,21 @@
"name": "transaction"
},
"service": {
"environment": "staging",
"environment": "testing",
"framework": {
"name": "Express",
"version": "1.2.3"
"name": "Rails",
"version": "5.0"
},
"language": {
"name": "ecmascript",
"version": "8"
"name": "ruby",
"version": "2.5"
},
"name": "1234_service-12a3",
"name": "service1",
"runtime": {
"name": "node",
"version": "8.0.0"
"name": "cruby",
"version": "2.5"
},
"version": "5.1.3"
"version": "2"
},
"timestamp": {
"us": 1532976822281000
Expand Down
30 changes: 15 additions & 15 deletions docs/data/elasticsearch/generated/errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,14 @@
"service": {
"environment": "staging",
"framework": {
"name": "Express",
"version": "1.2.3"
"name": "Node",
"version": "1"
},
"language": {
"name": "ecmascript",
"version": "8"
"version": "1.2"
},
"name": "1234_service-12a3",
"name": "service1",
"runtime": {
"name": "node",
"version": "8.0.0"
Expand Down Expand Up @@ -355,8 +355,8 @@
{
"@timestamp": "2018-08-01T10:00:00Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
"name": "elastic-ruby",
"version": "2.1.3"
},
"container": {
"id": "container-id"
Expand Down Expand Up @@ -402,21 +402,21 @@
"name": "error"
},
"service": {
"environment": "staging",
"environment": "testing",
"framework": {
"name": "Express",
"version": "1.2.3"
"name": "Rails",
"version": "5.0"
},
"language": {
"name": "ecmascript",
"version": "8"
"name": "ruby",
"version": "2.5"
},
"name": "1234_service-12a3",
"name": "service1",
"runtime": {
"name": "node",
"version": "8.0.0"
"name": "cruby",
"version": "2.5"
},
"version": "5.1.3"
"version": "2"
},
"timestamp": {
"us": 1533117600000000
Expand Down
6 changes: 3 additions & 3 deletions docs/data/elasticsearch/generated/spans.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@
{
"@timestamp": "2018-08-01T10:00:00.00283092Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
"name": "elastic-ruby",
"version": "2.2"
},
"parent": {
"id": "abcdef0123456789"
Expand All @@ -171,7 +171,7 @@
"name": "transaction"
},
"service": {
"name": "backendspans"
"name": "service1"
},
"span": {
"action": "query",
Expand Down
24 changes: 12 additions & 12 deletions docs/data/elasticsearch/generated/transactions.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"name": "1234_service-12a3",
"runtime": {
"name": "node",
"version": "8.0.0"
"version": "7.0"
},
"version": "5.1.3"
},
Expand Down Expand Up @@ -244,8 +244,8 @@
{
"@timestamp": "2018-07-30T18:53:42.281Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
"name": "elastic-ruby",
"version": "2.2"
},
"container": {
"id": "container-id"
Expand Down Expand Up @@ -287,21 +287,21 @@
"name": "transaction"
},
"service": {
"environment": "staging",
"environment": "testing",
"framework": {
"name": "Express",
"version": "1.2.3"
"name": "Rails",
"version": "5.0"
},
"language": {
"name": "ecmascript",
"version": "8"
"name": "ruby",
"version": "2.5"
},
"name": "1234_service-12a3",
"name": "service1",
"runtime": {
"name": "node",
"version": "8.0.0"
"name": "cruby",
"version": "2.5"
},
"version": "5.1.3"
"version": "2"
},
"timestamp": {
"us": 1532976822281000
Expand Down
5 changes: 5 additions & 0 deletions docs/spec/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"$ref": "tags.json"
},
"user": {
"description": "Describes the correlated user for this event. If user data are provided here, all user related information from metadata is ignored, otherwise the metadata's user information will be stored with the event.",
"$ref": "user.json"
},
"page": {
Expand All @@ -54,6 +55,10 @@
"type": ["string", "null"]
}
}
},
"service": {
"description": "Service related information can be sent per event. Provided information will override the more generic information from metadata, non provided fields will be set according to the metadata information.",
"$ref": "service.json"
}
}
}
12 changes: 11 additions & 1 deletion docs/spec/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
"type": ["object"],
"properties": {
"service": {
"$ref": "service.json"
"$ref": "service.json",
"type": "object",
"properties.agent.required": ["name", "version"],
"properties.agent.properties.name.type": "string",
"properties.agent.properties.version.type": "string",
"properties.runtime.required": ["name", "version"],
"properties.runtime.properties.name.type": "string",
"properties.runtime.properties.version.type": "string",
"properties.language.required": ["name"],
"properties.language.properties.name.type": "string"
},
"process": {
"$ref": "process.json"
Expand All @@ -14,6 +23,7 @@
"$ref": "system.json"
},
"user": {
"description": "Describes the authenticated User for a request.",
"$ref": "user.json"
}
},
Expand Down
28 changes: 12 additions & 16 deletions docs/spec/service.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
{
"$id": "doc/spec/service.json",
"title": "Service",
"type": "object",
"type": ["object", "null"],
"properties": {
"agent": {
"description": "Name and version of the Elastic APM agent",
"type": "object",
"type": ["object", "null"],
"properties": {
"name": {
"description": "Name of the Elastic APM agent, e.g. \"Python\"",
"type": "string",
"type": ["string", "null"],
"maxLength": 1024
},
"version": {
"description": "Version of the Elastic APM agent, e.g.\"1.0.0\"",
"type": "string",
"type": ["string", "null"],
"maxLength": 1024
}
},
"required": ["name", "version"]
}
},
"framework": {
"description": "Name and version of the web framework used",
Expand All @@ -39,19 +38,18 @@
"type": ["object", "null"],
"properties": {
"name": {
"type": "string",
"type": ["string", "null"],
"maxLength": 1024
},
"version": {
"type": ["string", "null"],
"maxLength": 1024
}
},
"required": ["name"]
}
},
"name": {
"description": "Immutable name of the service emitting this event",
"type": "string",
"type": ["string", "null"],
"pattern": "^[a-zA-Z0-9 _-]+$",
"maxLength": 1024
},
Expand All @@ -65,21 +63,19 @@
"type": ["object", "null"],
"properties": {
"name": {
"type": "string",
"type": ["string", "null"],
"maxLength": 1024
},
"version": {
"type": "string",
"type": ["string", "null"],
"maxLength": 1024
}
},
"required": ["name", "version"]
}
},
"version": {
"description": "Version of the service emitting this event",
"type": ["string", "null"],
"maxLength": 1024
}
},
"required": ["agent", "name"]
}
}
Loading

0 comments on commit 62fbb81

Please sign in to comment.