I'm using the events intake API to send logs to APM server and I'm receiving status 202.
My request:
curl -i -H "Authorization: Bearer mytoken" -H "Content-type: application/x-ndjson" --data-binary @logs.ndjson https://{hostname}:{ports}/intake/v2/events
My file @logs.ndjson content:
{"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":"8ec7ceb990749e79b37f6dc6cd3628633618d6ce412553a552a0fa6b69419ad8"},"kubernetes":{"namespace":"default","pod":{"uid":"b17f231da0ad128dc6c6c0b2e82f6f303d3893e3","name":"instrumented-java-service"},"node":{"name":"node-name"}}},"service":{"name":"poc-open-telemetry-nodejs","version":"1.0.0","node":{"configured_name":"8ec7ceb990749e79b37f6dc6cd3628633618d6ce412553a552a0fa6b69419ad4"},"environment":"development","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":"9876543210abcdeffedcba0123456780","timestamp":1710964392143,"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":"user@foo.mail"},"tags":{"organization_uuid":"9f0e9d64-c185-4d21-a6f4-4673ed561ec8"},"custom":{"my_key":1,"some_other_value":"foobar","and_objects":{"foo":["bar","baz"]}},"service":{"name":"poc-open-telemetry-nodejs","node":{"configured_name":"node-xyz"},"language":{"version":"1.2"},"framework":{"version":"1","name":"Node"}}}}}
I get this payload example from: Example request body | Elastic Observability [8.12] | Elastic and change some information
The CURL returns:
(I can't put all return because of the information)
But after all that work I can't see this logs on my APM dashboard or seach on dataview of APM, can be some problem?
In the payload example I change the timestamp, some IDs and service.name