Skip to content

Commit

Permalink
a lot of code
Browse files Browse the repository at this point in the history
  • Loading branch information
jalvz committed Mar 11, 2020
1 parent 3069584 commit 08ead1c
Show file tree
Hide file tree
Showing 39 changed files with 2,404 additions and 1,522 deletions.
2 changes: 1 addition & 1 deletion beater/api/profile/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func Handler(
err: errors.Wrap(err, "invalid metadata"),
}
}
metadata, err := metadata.DecodeMetadata(raw)
metadata, err := metadata.DecodeMetadata(raw, false)
if err != nil {
return nil, requestError{
id: request.IDResponseErrorsDecode,
Expand Down
18 changes: 14 additions & 4 deletions docs/data/intake-api/generated/rum_v3_events.ndjson
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{"metadata":{"process":{"pid":1234,"title":"/usr/lib/jvm/java-10-openjdk-amd64/bin/java","ppid":1,"argv":["-v"]},"system":{"architecture":"amd64","detected_hostname":"8ec7ceb99074","configured_hostname":"host1","platform":"Linux","container":{"id":"8ec7ceb990749e79b37f6dc6cd3628633618d6ce412553a552a0fa6b69419ad4"},"kubernetes":{"namespace":"default","pod":{"uid":"b17f231da0ad128dc6c6c0b2e82f6f303d3893e3","name":"instrumented-java-service"},"node":{"name":"node-name"}}},"service":{"name":"1234_service-12a3","version":"4.3.0","node":{"configured_name":"8ec7ceb990749e79b37f6dc6cd3628633618d6ce412553a552a0fa6b69419ad4"},"environment":"production","language":{"name":"Java","version":"10.0.2"},"agent":{"version":"1.10.0","name":"java","ephemeral_id":"e71be9ac-93b0-44b9-a997-5638f6ccfc36"},"framework":{"name":"spring","version":"5.0.0"},"runtime":{"name":"Java","version":"10.0.2"}},"labels":{"group":"experimental","ab_testing":true,"segment":5}}}
{"error":{"id":"9876543210abcdeffedcba0123456789","timestamp":1571657444929001,"trace_id":"0123456789abcdeffedcba0123456789","parent_id":"9632587410abcdef","transaction_id":"1234567890987654","transaction":{"sampled":true,"type":"request"},"culprit":"opbeans.controllers.DTInterceptor.preHandle(DTInterceptor.java:73)","log":{"message":"Request method 'POST' not supported","param_message":"Request method 'POST' /events/:event not supported","logger_name":"http404","level":"error","stacktrace":[{"abs_path":"/tmp/Socket.java","filename":"Socket.java","classname":"Request::Socket","function":"connect","vars":{"key":"value"},"pre_context":["line1","line2"],"context_line":"line3","library_frame":true,"lineno":3,"module":"java.net","colno":4,"post_context":["line4","line5"]},{"filename":"SimpleBufferingClientHttpRequest.java","lineno":102,"function":"executeInternal","abs_path":"/tmp/SimpleBufferingClientHttpRequest.java","vars":{"key":"value"}}]},"exception":{"message":"Theusernamerootisunknown","type":"java.net.UnknownHostException","handled":true,"module":"org.springframework.http.client","code":42,"handled":false,"attributes":{"foo":"bar"},"cause":[{"type":"InternalDbError","message":"something wrong writing a file","cause":[{"type":"VeryInternalDbError","message":"disk spinning way too fast"},{"type":"ConnectionError","message":"on top of it,internet doesn't work"}]}],"stacktrace":[{"abs_path":"/tmp/AbstractPlainSocketImpl.java","filename":"AbstractPlainSocketImpl.java","function":"connect","vars":{"key":"value"},"pre_context":["line1","line2"],"context_line":"3","library_frame":true,"lineno":3,"module":"java.net","colno":4,"post_context":["line4","line5"]},{"filename":"AbstractClientHttpRequest.java","lineno":102,"function":"execute","vars":{"key":"value"}}]},"context":{"request":{"socket":{"remote_address":"12.53.12.1","encrypted":true},"http_version":"1.1","method":"POST","url":{"protocol":"https:","full":"https://www.example.com/p/a/t/h?query=string#hash","hostname":"www.example.com","port":8080,"pathname":"/p/a/t/h","search":"?query=string","hash":"#hash","raw":"/p/a/t/h?query=string#hash"},"headers":{"Forwarded": "for=192.168.0.1", "host":"opbeans-java:3000","content-length":"0","cookie":["c1=v1","c2=v2"],"Elastic-Apm-Traceparent":"00-8c21b4b556467a0b17ae5da959b5f388-31301f1fb2998121-01"},"cookies":{"c1":"v1","c2":"v2"},"env":{"SERVER_SOFTWARE":"nginx","GATEWAY_INTERFACE":"CGI/1.1"},"body":"HelloWorld"},"response":{"status_code":200,"headers":{"content-type":"application/json"},"headers_sent":true,"finished":true},"user":{"id":99,"username":"foo","email":"[email protected]"},"tags":{"organization_uuid":"9f0e9d64-c185-4d21-a6f4-4673ed561ec8"},"custom":{"my_key":1,"some_other_value":"foobar","and_objects":{"foo":["bar","baz"]}},"service":{"name":"service1","node":{"configured_name":"node-xyz"},"language":{"version":"1.2"},"framework":{"version":"1","name":"Node"}}}}}
{"span":{"timestamp":1571657444929001,"type":"external","subtype":"http","id":"1234567890aaaade","transaction_id":"1234567890987654","trace_id":"abcdef0123456789abcdef9876543210","parent_id":"abcdef0123456789","action":"connect","sync":true,"name":"GET users-authenticated", "duration":3.781912,"stacktrace":[{"filename":"DispatcherServlet.java","lineno":547},{"function":"render","abs_path":"/tmp/AbstractView.java","filename":"AbstractView.java","lineno":547,"library_frame":true,"vars":{"key":"value"},"module":"org.springframework.web.servlet.view","colno":4,"context_line":"line3"}],"context":{"db":{"instance":"customers","statement":"SELECT * FROM product_types WHERE user_id = ?","type":"sql","user":"postgres","link":"other.db.com"},"http":{"url":"http://localhost:8000","status_code":200,"method":"GET"},"service":{"name":"opbeans-java-1","agent":{"version":"1.10.0-SNAPSHOT","name":"java","ephemeral_id":"e71be9ac-93b0-44b9-a997-5638f6ccfc36"}}}}}
{"transaction":{"timestamp":1571657444929001,"name":"ResourceHttpRequestHandler","type":"http","id":"4340a8e0df1906ecbfa9","trace_id":"0acd456789abcdef0123456789abcdef","parent_id":"abcdefabcdef01234567","span_count":{"started":17,"dropped":0},"duration":32.592981,"result":"HTTP2xx","sampled":true,"context":{"service":{"name":"experimental-java","agent":{"version":"1.10.0-SNAPSHOT","ephemeral_id":"e71be9ac-93b0-44b9-a997-5638f6ccfc36"}},"request":{"socket":{"remote_address":"12.53.12.1:8080","encrypted":true},"http_version":"1.1","method":"POST","url":{"protocol":"https:","full":"https://www.example.com/p/a/t/h?query=string#hash","hostname":"www.example.com","port":"8080","pathname":"/p/a/t/h","search":"?query=string","hash":"#hash","raw":"/p/a/t/h?query=string#hash"},"headers":{"user-agent":["Mozilla/5.0(Macintosh;IntelMacOSX10_10_5)AppleWebKit/537.36(KHTML,likeGecko)Chrome/51.0.2704.103Safari/537.36","MozillaChromeEdge"],"content-type":"text/html","cookie":"c1=v1,c2=v2","Elastic-Apm-Traceparent":["00-33a0bd4cceff0370a7c57d807032688e-69feaabc5b88d7e8-01"]},"cookies":{"c1":"v1","c2":"v2"},"env":{"SERVER_SOFTWARE":"nginx","GATEWAY_INTERFACE":"CGI/1.1"},"body":{"string":"helloworld","additional":{"foo":{},"bar":123,"req":"additionalinformation"}}},"response":{"status_code":200,"headers":{"content-type":"application/json"},"headers_sent":true,"finished":true}, "user":{"id":"99","username":"foo","email":"[email protected]"},"tags":{"organization_uuid":"9f0e9d64-c185-4d21-a6f4-4673ed561ec8","tag5":null},"custom":{"my_key":1,"some_other_value":"foobar","and_objects":{"foo":["bar","baz"]},"(":"notavalidregexandthatisfine"}}}}
{"m":{"se":{"n":"apm-a-rum-test-e2e-general-usecase","ve":"0.0.1","a":{"n":"js-base","ve":"4.8.1"},"la":{"n":"javascript"}},"l":{"testTagKey":"testTagValue"}}}
{"x":{"id":"ec2e280be8345240","trace_id":"286ac3ad697892c406528f13c82e0ce1","n":"general-usecase-initial-p-load","t":"p-load","d":295,"c":{"p":{"rf":"h://localhost:8000/test/e2e/","url":"h://localhost:8000/test/e2e/general-usecase/"},"r":{"ts":983,"ebs":690,"dbs":690},"u":{"id":"uId","un":"un","em":"em"},"cu":{"testContext":"testContext"},"g":{"testTagKey":"testTagValue"}},"k":{"a":{"lp":131.03000004775822,"fb":5,"di":120,"dc":138,"fp":70.82500003930181},"nt":{"fs":0,"ls":0,"le":0,"cs":0,"ce":0,"qs":4,"rs":5,"re":6,"dl":14,"di":120,"ds":120,"de":122,"dc":138,"es":138,"ee":138}},"yc":{"sd":8},"sm":true}}
{"y":{"id":"bbd8bcc3be14d814","x_id":"ec2e280be8345240","parent_id":"ec2e280be8345240","trace_id":"286ac3ad697892c406528f13c82e0ce1","n":"Requesting and receiving the document","t":"hard-navigation","su":"browser-timing","s":4,"d":2}}
{"y":{"id":"fc546e87a90a774f","x_id":"ec2e280be8345240","parent_id":"ec2e280be8345240","trace_id":"286ac3ad697892c406528f13c82e0ce1","n":"Parsing the document, executing sy. scripts","t":"hard-navigation","su":"browser-timing","s":14,"d":106}}
{"y":{"id":"fb8f717930697299","x_id":"ec2e280be8345240","parent_id":"ec2e280be8345240","trace_id":"286ac3ad697892c406528f13c82e0ce1","n":"h://localhost:8000/test/e2e/general-usecase/app.e2e-bundle.min.js","t":"rc","su":"script","s":22.53499999642372,"d":35.060000023804605,"c":{"h":{"url":"h://localhost:8000/test/e2e/general-usecase/app.e2e-bundle.min.js?token=REDACTED","r":{"ts":677175,"ebs":676864,"dbs":676864}},"dt":{"se":{"n":"h://localhost:8000","rc":"localhost:8000","t":"rc"},"ad":"localhost","po":8000}}}}
{"y":{"id":"9b80535c4403c9fb","x_id":"ec2e280be8345240","parent_id":"ec2e280be8345240","trace_id":"286ac3ad697892c406528f13c82e0ce1","n":"OpenTracing y","t":"cu","s":96.92999999970198,"d":198.07000000029802}}
{"y":{"id":"5ecb8ee030749715","x_id":"ec2e280be8345240","parent_id":"ec2e280be8345240","trace_id":"286ac3ad697892c406528f13c82e0ce1","n":"GET /test/e2e/common/data.json","t":"external","su":"h","sy":true,"s":98.94000005442649,"d":6.72499998472631,"c":{"h":{"mt":"GET","url":"h://localhost:8000/test/e2e/common/data.json?test=hamid","sc":200},"dt":{"se":{"n":"h://localhost:8000","rc":"localhost:8000","t":"external"},"ad":"localhost","po":8000}}}}
{"y":{"id":"27f45fd274f976d4","x_id":"ec2e280be8345240","parent_id":"ec2e280be8345240","trace_id":"286ac3ad697892c406528f13c82e0ce1","n":"POST h://localhost:8003/data","t":"external","su":"h","sy":true,"s":106.52000003028661,"d":11.584999971091747,"c":{"h":{"mt":"POST","url":"h://localhost:8003/data","sc":200},"dt":{"se":{"n":"h://localhost:8003","rc":"localhost:8003","t":"external"},"ad":"localhost","po":8003}}}}
{"y":{"id":"a3c043330bc2015e","x_id":"ec2e280be8345240","parent_id":"ec2e280be8345240","trace_id":"286ac3ad697892c406528f13c82e0ce1","n":"POST h://localhost:8003/fetch","t":"external","su":"h","sy":false,"s":119.93500008247793,"d":15.949999913573265,"c":{"h":{"mt":"POST","url":"h://localhost:8003/fetch","sc":200},"dt":{"se":{"n":"h://localhost:8003","rc":"localhost:8003","t":"external"},"ad":"localhost","po":8003}}}}
{"y":{"id":"bc7665dc25629379","x_id":"ec2e280be8345240","parent_id":"ec2e280be8345240","trace_id":"286ac3ad697892c406528f13c82e0ce1","n":"Fire \"DOMContentLoaded\" event","t":"hard-navigation","su":"browser-timing","s":120,"d":2}}
{"me":{"x":{"n":"general-usecase-initial-p-load","t":"p-load"},"sa":{"xdc":{"v":1},"xds":{"v":295},"xbc":{"v":1}}}}
{"me":{"x":{"n":"general-usecase-initial-p-load","t":"p-load"},"y":{"t":"Request"},"sa":{"ysc":{"v":1},"yss":{"v":1}}}}
{"me":{"x":{"n":"general-usecase-initial-p-load","t":"p-load"},"y":{"t":"Response"},"sa":{"ysc":{"v":1},"yss":{"v":1}}}}
{"me":{"x":{"n":"general-usecase-initial-p-load","t":"p-load"},"y":{"t":"Processing"},"sa":{"ysc":{"v":1},"yss":{"v":124}}}}
56 changes: 28 additions & 28 deletions docs/spec/errors/rum_v3_error.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"type": ["string", "null"],
"maxLength": 1024
},
"transaction_id": {
"xid": {
"type": ["string", "null"],
"description": "Hex encoded 64 random bits ID of the correlated transaction. Must be present if trace_id and parent_id are set.",
"maxLength": 1024
Expand All @@ -26,66 +26,66 @@
"type": ["string", "null"],
"maxLength": 1024
},
"transaction": {
"x": {
"type": ["object", "null"],
"description": "Data for correlating errors with transactions",
"properties": {
"sampled": {
"sm": {
"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."
},
"type": {
"t": {
"type": ["string", "null"],
"description": "Keyword of specific relevance in the service's domain (eg: 'request', 'backgroundjob', etc)",
"maxLength": 1024
}
}
},
"context": {
"$ref": "./../context.json"
"c": {
"$ref": "./../rum_v3_context.json"
},
"culprit": {
"cu": {
"description": "Function call which was the primary perpetrator of this event.",
"type": ["string", "null"],
"maxLength": 1024
},
"exception": {
"ex": {
"description": "Information about the originally thrown error.",
"type": ["object", "null"],
"properties": {
"code": {
"cd": {
"type": ["string", "integer", "null"],
"maxLength": 1024,
"description": "The error code set when the error happened, e.g. database error code."
},
"message": {
"mg": {
"description": "The original error message.",
"type": ["string", "null"]
},
"module": {
"mo": {
"description": "Describes the exception type's module namespace.",
"type": ["string", "null"],
"maxLength": 1024
},
"attributes": {
"at": {
"type": ["object", "null"]
},
"stacktrace": {
"st": {
"type": ["array", "null"],
"items": {
"$ref": "./../stacktrace_frame.json"
"$ref": "./../rum_v3_stacktrace_frame.json"
},
"minItems": 0
},
"type": {
"t": {
"type": ["string", "null"],
"maxLength": 1024
},
"handled": {
"hd": {
"type": ["boolean", "null"],
"description": "Indicator whether the error was caught somewhere in the code or not."
},
"cause": {
"ca": {
"type": ["array", "null"],
"items": {
"type": ["object", "null"],
Expand All @@ -96,57 +96,57 @@
}
},
"anyOf": [
{"required": ["message"], "properties": {"message": {"type": "string"}}},
{"required": ["type"], "properties": {"type": {"type": "string"}}}
{"required": ["mg"], "properties": {"mg": {"type": "string"}}},
{"required": ["t"], "properties": {"t": {"type": "string"}}}
]
},
"log": {
"type": ["object", "null"],
"description": "Additional information added when logging the error.",
"properties": {
"level": {
"lv": {
"description": "The severity of the record.",
"type": ["string", "null"],
"maxLength": 1024
},
"logger_name": {
"ln": {
"description": "The name of the logger instance used.",
"type": ["string", "null"],
"default": "default",
"maxLength": 1024
},
"message": {
"mg": {
"description": "The additionally logged error message.",
"type": "string"
},
"param_message": {
"pmg": {
"description": "A parametrized message. E.g. 'Could not connect to %s'. The property message is still required, and should be equal to the param_message, but with placeholders replaced. In some situations the param_message is used to group errors together. The string is not interpreted, so feel free to use whichever placeholders makes sense in the client languange.",
"type": ["string", "null"],
"maxLength": 1024

},
"stacktrace": {
"st": {
"type": ["array", "null"],
"items": {
"$ref": "./../stacktrace_frame.json"
"$ref": "./../rum_v3_stacktrace_frame.json"
},
"minItems": 0
}
},
"required": ["message"]
"required": ["mg"]
}
},
"allOf": [
{ "required": ["id"] },
{ "if": {"required": ["transaction_id"], "properties": {"transaction_id": { "type": "string" }}},
{ "if": {"required": ["xid"], "properties": {"xid": { "type": "string" }}},
"then": { "required": ["trace_id", "parent_id"], "properties": {"trace_id": { "type": "string" }, "parent_id": {"type": "string"}}}},
{ "if": {"required": ["trace_id"], "properties": {"trace_id": { "type": "string" }}},
"then": { "required": ["parent_id"], "properties": {"parent_id": { "type": "string" }}} },
{ "if": {"required": ["parent_id"], "properties": {"parent_id": { "type": "string" }}},
"then": { "required": ["trace_id"], "properties": {"trace_id": { "type": "string" }}} }
],
"anyOf": [
{ "required": ["exception"], "properties": {"exception": { "type": "object" }} },
{ "required": ["ex"], "properties": {"ex": { "type": "object" }} },
{ "required": ["log"], "properties": {"log": { "type": "object" }} }
]
}
Expand Down
Loading

0 comments on commit 08ead1c

Please sign in to comment.