GithubHelp home page GithubHelp logo

jamesr2323 / nr-heroku-logs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aminoz007/nr-heroku-logs

0.0 0.0 0.0 4 KB

Application to send logs from Heroku to New Relic

License: MIT License

Ruby 100.00%

nr-heroku-logs's Introduction

GitHub issues License Badges

Heroku forwarder for New Relic

This is a Heroku application which can forward logs to New Relic, it is based on fluentd. This application accepts logs from HTTPS drains and forward the logs to New Relic logs collector using NR logs APIs.

This application is using 3 components:

This application uses the request PATH to specify the fluentd tag to use for routing.

Setup

Heroku doesn't allow users to install separate processes within a single dyno. You will thus need to setup Fluentd as a separate Heroku application. This will become your central log aggregation server.

Follow the steps below to create Fluentd and NR plugin as a Heroku application.

# Get the code
$ git clone git://github.com/aminoz007/NR-Heroku-Logs.git
$ cd NR-Heroku-Logs
$ rm -rf .git
$ git init
$ git add .
$ git commit -m 'initial commit'

# Login to Heroku, then create the app
$ heroku apps:create YOUR-LOGGING-APP-NAME (i.e NR-logs-forwarder)

# Next, configure your API key
$ heroku config:set NR_API_KEY=YOUR-NR-INSERT-API-KEY -a YOUR-LOGGING-APP-NAME

# Deploy
$ git push heroku master

Once the logging apllication is up and running. You can configure Heroku HTTPS log drains to publish logs to this application.

$ heroku drains:add https://YOUR-LOGGING-APP-NAME/newrelic.YOUR-SOURCE-APP-NAME -a YOUR-SOURCE-APP-NAME

PS: You may need to add ".herokuapp.com" to the logging app name depending on the URL of your logging app.

  • Example:
    • URL of logging app: https://NR-logs-forwarder.herokuapp.com/
    • App from where logs should be collected: my-cool-app
    • Command: $ heroku drains:add https://NR-logs-forwarder.herokuapp.com/newrelic.my-cool-app -a my-cool-app

Logs should now be flowing from your service to New Relic ๐Ÿ˜‰.

Troubleshoot

This application supports sending incoming events to STDOUT using a debug tag prefix.

# debug using curl
$ curl "https://YOUR-LOGGING-APP-NAME/debug.YOUR-SOURCE-APP-NAME" -d "60 <13>1 time host app web.1 - myMessage"

nr-heroku-logs's People

Contributors

jamesr2323 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.