question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

APM Server transport error (400): Unexpected APM Server response APM Server accepted 0 events in the last request Error: Problem validating JSON document against schema: I[#] S[#] doesn't validate with "metricset#" I[#] S[#/allOf/0] allOf failed

See original GitHub issue

Describe the bug APM works well when running my app without docker but once i start the app in docker I get an error:

APM Server transport error (400): Unexpected APM Server response
APM Server accepted 0 events in the last request
Error: Problem validating JSON document against schema: I[#] S[#] doesn't validate with "metricset#"
  I[#] S[#/allOf/0] allOf failed
    I[#/samples/system.process.cpu.total.norm.pct/value] S[#/allOf/0/properties/samples/patternProperties/%5E%5B%5E%2A%22%5D%2A$/properties/value/type] expected number, but got null
  Document: {"metricset":{"timestamp":1548853260277000,"tags":{"hostname":"96d3f45afe38","env":"development"},"samples":{"system.cpu.total.norm.pct":{"value":null},"system.memory.total":{"value":2096164864},"system.memory.actual.free":{"value":1151217664},"system.process.cpu.total.norm.pct":{"value":null},"system.process.memory.size":{"value":1100959744},"system.process.memory.rss.bytes":{"value":190550016}}}}

To Reproduce Steps to reproduce the behavior:

  1. Use this config ’ const apmConfig = { serviceName: process.env.APP_NAME, serverUrl: process.env.APM_SERVER, secretToken: process.env.APM_TOKEN, logLevel: ‘info’, } ’
  2. Then call ’ const apmObject = require(‘elastic-apm-node’).start(apmConfig); ’
  3. Then do ‘’
  4. See error

APM Server transport error (400): Unexpected APM Server response APM Server accepted 0 events in the last request Error: Problem validating JSON document against schema: I[#] S[#] doesn’t validate with “metricset#” I[#] S[#/allOf/0] allOf failed I[#/samples/system.process.cpu.total.norm.pct/value] S[#/allOf/0/properties/samples/patternProperties/%5E%5B%5E%2A%22%5D%2A$/properties/value/type] expected number, but got null Document: {“metricset”:{“timestamp”:1548853260277000,“tags”:{“hostname”:“96d3f45afe38”,“env”:“development”},“samples”:{“system.cpu.total.norm.pct”:{“value”:null},“system.memory.total”:{“value”:2096164864},“system.memory.actual.free”:{“value”:1151217664},“system.process.cpu.total.norm.pct”:{“value”:null},“system.process.memory.size”:{“value”:1100959744},“system.process.memory.rss.bytes”:{“value”:190550016}}}}

Expected behavior Expect the apm to work well with docker as it works without me using it

Environment (please complete the following information)

  • OS: Mac Osx
  • Node.js version: v10.11.0
  • APM Server version:
  • Agent version: 2.5.0

How are you starting the agent? (please tick one of the boxes)

  • Calling agent.start() directly (e.g. require('elastic-apm-node').start(...))
  • Requiring elastic-apm-node/start from within the source code
  • Starting node with -r elastic-apm-node/start

Additional context Add any other context about the problem here.

  • Agent config options

    Click to expand
    replace this line with your agent config options
    
  • package.json dependencies:

    Click to expand
    replace this line with your dependencies section from package.json
    

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Qardcommented, Feb 5, 2019

On further investigation, I found there was a bug. I’ve published 2.5.1, which should fix this.

1reaction
Guikcommented, Feb 4, 2019

Same issue for me.

I’m using up to date alpha version official image: docker.elastic.co/apm/apm-server:7.0.0-alpha2 docker.elastic.co/elasticsearch/elasticsearch:7.0.0-alpha2

Is apm-agent-nodejs compatible with alpha2 ?

Edit: I downgraded to 6.6.0 I have the same behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

APM dotnet 1.1.2 error validating JSON document against ...
We have an issue with our APM dotnet agents (1.1.2) hosted on AWS Lambda which do not seem to collect the system.cpu.total.norm.pct information ......
Read more >
Validating the requests with JSON Schema - KrakenD
When the validation fails, KrakenD returns to the user a status code 400 (Bad Request), and only if it succeeds, the backend receives...
Read more >
Validation-and-Serialization - Fastify
The route validation internally relies upon Ajv v8 which is a high-performance JSON Schema validator. Validating the input is very easy: just add...
Read more >
Implementations - JSON Schema
Validators. Benchmarks; API documentation; Link Description Object utilities. Schema generators. From code; From data. Generators from schemas.
Read more >
Request JSON Schema - Datadog Docs
Metrics. Your data source such as metrics, logs, or traces are the main focus of the graph. You can find the list of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found