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.

newrelic.js config validator

See original GitHub issue

Is your feature request related to a problem? Please describe.

Yes. I added the expected_status_codes property to my project config but didn’t realise it was wrapped in the error_collector object. Took a while to get to the bottom of the problem. Having a little script that can validate the config file and point out errors would be really handy.

Feature Description

A script that the user can run to validate the newrelic.js config file. For example:

$ npx newrelic-validate-config
Found 3 issues:
1. Unexpected property `expected_status_codes`. Did you mean `error_collector.expected_status_codes`?

2. Invalid type given for `app_name` should be `array` found `string`

3. Invalid value given for `logging.level` found "errror" should be one of: "fatal", "error", "warn", "info", "debug" or "trace"

Describe Alternatives

n/a

Additional context

I’m happy to contribute to the solution, just wanted to get an idea if people would find this useful or not?

Priority

Really Want

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
astormnewreliccommented, Jul 24, 2020

That would be a pretty sweet feature @davidnormo – I know I would have liked something similar when I was starting with the Node Agent, and I can think of a bunch of support tickets where having such a thing would have helped.

Do you think you’d use something formal like JSON Schema for this? Or something a bit simpler with a set of type rules for each “path” into the JSON file? Or some third thing?

0reactions
rr0214commented, Aug 18, 2021

@davidnormo is this something you are still working on? If not, we will close this out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Validate config file settings with nrdiag
How to validate your config file settings when using New Relic Diagnostics (nrdiag); for example, with deployments.
Read more >
Node.js agent configuration
The primary method to configure the Node.js agent is the agent configuration file ( newrelic.js ). You can also configure most settings with...
Read more >
NET agent configuration
How to configure the New Relic .NET agent using newrelic.config, including startup and instrumentation options, and disabling unwanted features.
Read more >
Node.js Troubleshooting Framework Configuration
Run the Diagnostics CLI to collect data then validate: Confirm Node. js and NPM version meets requirements.
Read more >
Configure the infrastructure agent
Use a validator to ensure the syntax is accurate before using the file with the infrastructure agent. Configuration management tools. To install and...
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