-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Added table of contents to help community navigate the examples.
- Loading branch information
Showing
133 changed files
with
104 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## AI Monitoring | ||
|
||
This folder contains example applications interacting with various LLM libraries that produce [AI monitoring telemetry](https://docs.newrelic.com/docs/ai-monitoring/intro-to-ai-monitoring/) | ||
|
||
* [AWS Bedrock](./aws-bedrock-app) - AWS Bedrock example that can make requests to all [supported LLM models](https://aws.amazon.com/ai/generative-ai/). | ||
* [Langchain](./langchain) - [Langchain.js](https://js.langchain.com/v0.2/docs/introduction/) example that interacts with chains, vector stores, and tools. | ||
* [OpenAI](./openai) - [OpenAI](https://github.com/openai/openai-node) example that can make requests to create chat completions and embeddings. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Application Logging | ||
|
||
This folder contains example applications interacting with various logging libraries that provide [logs in context](https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-nodejs/) | ||
|
||
* [ESM logs in context](./esm-logs-in-context) - An [ESM](https://nodejs.org/api/esm.html) application that uses winston to create logs. | ||
* [Log generator](./log-generator) - An application used to produce logs with either winston or pino. | ||
* [Log enrichers](./legacy-logs-in-context) - **deprecated** - An application that uses deprecated log enrichers for pino and winston. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
## Custom instrumentation | ||
This folder contains example applications using the [Agent API](https://newrelic.github.io/node-newrelic/API.html) to do custom instrumentation. | ||
|
||
* [instrumentMessages](./instrument-messages) - example application that uses the [newrelic.instrumentMessages](https://newrelic.github.io/node-newrelic/API.html#instrumentMessages) and associated [messaging shim API](https://newrelic.github.io/node-newrelic/MessageShim.html) to instrument a toy messaging library called Nifty Messages | ||
* [instrumentWebframework](./instrument-webframework ) - example application that uses the [newrelic.instrumentWebframework](https://newrelic.github.io/node-newrelic/API.html#instrumentWebframework) and associated [WebFramework shim API](https://newrelic.github.io/node-newrelic/WebFrameworkShim.html) to instrument a hypothetical web framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Mock Infinite Tracing gRPC Server | ||
|
||
This is a gRPC server used to test our [infinite tracing](https://docs.newrelic.com/docs/distributed-tracing/infinite-tracing/introduction-infinite-tracing/) with the Node.js agent. | ||
|
||
|
||
## Setup | ||
|
||
To setup gRPC run | ||
|
||
```sh | ||
npm install | ||
node index.js | ||
``` | ||
|
||
## Test | ||
|
||
Once the gPRC server is started, you can use it in an example application and set the following in `newrelic.js` | ||
|
||
|
||
```js | ||
exports.config = { | ||
license_key: <your-license-key>, | ||
infinite_tracing: { | ||
trace_observer: { | ||
host: 'localhost:50051 | ||
} | ||
} | ||
} | ||
``` | ||
As you use the application the mock gPRC server will log to console the number of spans seen. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
This is an example of an instrumented Nest.js app, using Prisma and Winston. | ||
# Nestjs examples | ||
|
||
Get it running: | ||
This folder contains 2 different [Nestjs](https://github.com/nestjs/nest) examples that demonstrate producing telemetry with the Node.js agent. | ||
|
||
1. Copy sample.env to .env | ||
2. Edit .env to add your New Relic ingest key, and any other desired changes. | ||
3. Start with `docker-compose up --build`. | ||
* [basic Nestjs example](./nestjs-example) - full Nestjs example to demonstrate the telemetry the agent provides | ||
* [Nestjs example with agent config as typescript](./nestjs-config-file) - Nestjs example application that relies on agent configuration as `newrelic.ts` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This is an example of an instrumented Nest.js app, using Prisma and Winston. | ||
|
||
Get it running: | ||
|
||
1. Copy sample.env to .env | ||
2. Edit .env to add your New Relic ingest key, and any other desired changes. | ||
3. Start with `docker-compose up --build`. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Next.js examples | ||
|
||
This folder contains Next.js example applications that leverage its different routers and demonstrate the telemetry the Node.js agent provides. | ||
|
||
* [App Router](./nextjs-app-router) - Example using [App Router](https://nextjs.org/docs/app) | ||
* [Pages Router](./nextjs-legacy) - Example using [Pages Router](https://nextjs.org/docs/pages) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Express example | ||
|
||
This example application uses [express](https://github.com/expressjs/express) and has 2 endpoints to demonstrate telemetry produced by Node.js agent with express and AWS SNS. | ||
|
||
## Setup | ||
|
||
1. Run `npm install` | ||
1. Start application with `NEW_RELIC_LICENSE_KEY=<your-key> node index.js` | ||
|
||
|
||
## Test | ||
|
||
Once the application is started you can make requests to the 2 endpoints to see the telemetry it generates. | ||
|
||
|
||
```sh | ||
curl http://localhost:3000/named-route | ||
curl http://localhost:3000/sns | ||
``` |