Giter Club home page Giter Club logo

newrelic-agent's Introduction

NewRelic Copilot Agent

๐ŸŽ‰ Welcome to New Relic Copilot Agent ๐ŸŽ‰

This is a Node.js application that uses the OpenAI API to enhance the functionality of the New Relic Copilot.


Step 1: Build and Push Docker Image to Azure Container Registry ๐Ÿ“ฆ

Build your Docker image using the existing Dockerfile in your project. Push the image to your Azure Container Registry:

docker push <registry-name>.azurecr.io/newrelic-agent

Replace <registry-name> with the name of your Azure Registry.

Step 2: Create an Azure Container App ๐ŸŒ

Create a new Azure Container App using the following command:

az containerapp create \
   -name <app-name> \
   -resource-group <resource-group> \
   -image <registry-name>.azurecr.io/newrelic-agent \
   -environment-variables "OPENAI_API_KEY=<your-openai-api-key>"

Replace <app-name> with the desired name for your container app, <resource-group> with the resource group where you want to create the app, <registry-name> with the name of your Azure Container Registry, and <your-openai-key> with your actual OpenAI API key.

Step 3: Configure Environment Variables (Optional) ๐ŸŒˆ

If you want to set default values for environment variables in your Docker image, update your index.js file accordingly:

const openaiApiKey = process.env.OPENAI_API_KEY;
if (!openaiApiKey) {
  console.error('OPENAI_API_KEY environment variable is not set');
  process.exit(1);
}
// Use the OpenAI API key
app.get('/', (req, res) => {
  res.send(openaiApiKey);
});

Troubleshooting ๐Ÿšจ

If you encounter any issues during deployment, check the Azure Container App logs for errors:

az containerapp logs show -- <app-name> --resource-group <resource-group>

Replace <app-name> and <resource-group> with your actual values.

That's it! You've successfully deployed the New Relic Copilot Agent to an Azure Container App. ๐ŸŽ‰

newrelic-agent's People

Contributors

rahul188 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.