querypack is a serialization format designed for use by the New Relic Browser Agent.
This repository also contains a reference encoder and decoder (qputil
) to produce querypack from JSON, and to decode querypack to JSON. It also contains querypack schemas and test-cases meant to be consumed by other parser / encoder implementations. The schema used by the Browser Agent is called bel
, and it is currently used to serialize information about single-page app route changes.
For details about the design of the querypack format, see DESIGN.md.
For the repo used by the backend to deserialize BEL payloads see browser/querypack
$ git clone https://github.com/newrelic/nr-querypack.git
$ cd nr-querypack
$ npm install
The schema used by the Browser Agent is defined in the schemas/bel directory.
To encode a JSON message, use the following command:
node bin/qputil.js encode <filename>.json schemas/bel/7.qpschema
To decode a message from querypack to JSON, use the following command:
node bin/qputil.js decode <filename>.querypack
$ bin/qputil.js encode <filename>.json schemas/<schemaName>.qpschema
$ bin/qputil.js decode <filename>.querypack
$ bin/qputil.js validate <filename>.querypack schemas/<schemaName>.qpschema
If you have it in your clipboard, you can use it like this:
pbpaste | tr -d '[:space:]' | bin/qputil.js decode - | less
Sometimes when developing a new feature, the structure of the serialized data the Browser Agent sends needs to change. To do this, follow the example structure below, to create files with an updated version of the schema:
- examples/bel/CURRENT_VERSION/*
- schema/bel/CURRENT_VERSION.qpschema
Any changes to the bel schema should require a new version bump.
This version bump is not a breaking change because each version lives in a separate file, but will require an update to the agent to encode the new format and the data processing pipeline to decode using the new format.
Compile & run test cases, schemas, grammar and parser for QueryPack:
$ npm test
For issues related to querypack, please feel free to either open a GitHub issue in this repository or see our support thread in the New Relic Community.
Should you need assistance with New Relic products, you are in good hands with several support channels.
- New Relic Documentation: Comprehensive guidance for using our platform
- New Relic Community: The best place to engage in troubleshooting questions
- New Relic Developer: Resources for building a custom observability applications
- New Relic University: A range of online training for New Relic users of every level
- New Relic Technical Support 24/7/365 ticketed support. Read more about our Technical Support Offerings.
We encourage your contributions to improve nr-querypack! Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.
If you have any questions, or to execute our corporate CLA (which is required if your contribution is on behalf of a company), drop us an email at opensource@newrelic.com.
A note about vulnerabilities
As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.
If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.
If you would like to contribute to this project, review these guidelines.
To all contributors, we thank you! Without your contribution, this project would not be what it is today. We also host a community project page dedicated to nr-querypack(https://github.com/newrelic/nr-querypack).
The nr-querypack project is licensed under the Apache 2.0 License. The nr-querypack project also uses source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in the third-party notices document.]