Git Product home page Git Product logo

new-reliquary's Introduction

New-reliquary

This project is not maintained anymore

Clojure wrapper for New Relic

Build Status Dependencies Status


Installation

Add this to your Leiningen project.clj :dependencies:

Clojars Project

Jar is available in Clojars.


New Relic Transactions

Basic NewRelic transaction tracing utilities located in new-reliquary.core

API

with-newrelic-transaction

(defn with-newrelic-transaction
  ([category transaction-name custom-params callback] ...)
  ([category transaction-name callback]               ...)
  ([callback]                                         ...))

Creates a transaction with optional transaction name and custom params. If transaction name is not passed, then set-transaction-name should be used inside the transaction.

set-transaction-name [category name]

Sets name to the transaction. Must be used if transaction is created with with-newrelic-transaction callback. See http://newrelic.github.io/java-agent-api/javadoc/com/newrelic/api/agent/NewRelic.html#setTransactionName(java.lang.String,%20java.lang.String)

notice-error [error]

See http://newrelic.github.io/java-agent-api/javadoc/com/newrelic/api/agent/NewRelic.html#noticeError(java.lang.String)

ignore-transaction

See http://newrelic.github.io/java-agent-api/javadoc/com/newrelic/api/agent/NewRelic.html#ignoreTransaction()

add-custom-parameter [name value]

Adds new custom parameter to the transaction. Must be called inside the transaction. See: http://newrelic.github.io/java-agent-api/javadoc/com/newrelic/api/agent/NewRelic.html#addCustomParameter(java.lang.String,%20java.lang.String)

Examples

(:require [new-reliquary.core :as newrelic])

(defn update-facebook-likes [] ...)

(newrelic/with-newrelic-transaction
    "My custom category"
    "Facebook data updating"
    {:user "jk" :huge-clojure-fan true}
    update-facebook-likes)

(newrelic/with-newrelic-transaction
  (fn [] (newrelic/set-transaction-name "backend" "poller") ...)

Ring middleware

Middleware to start NewRelic web transaction. Located in new-reliquary.ring

If you want to add query parameters as new relic custom params, make sure that request contains hash map :query-params (not in the default ring setup). This can be achieved easily by using ring.middleware.params/wrap-params.

API

wrap-newrelic-transaction [next-ring-request-handler]

Examples

(ns new-reliquary-example.main
  (:require [new-reliquary.ring :refer [wrap-newrelic-transaction]]
            [ring.middleware.params :refer [wrap-params]]))

(defn request-handler [request] {:body "Hello world"})
(def app (-> request-handler
            (wrap-newrelic-transaction)
            (wrap-params)))

License

Distributed under the Eclipse Public License either version 1.0 or any later version.

new-reliquary's People

Contributors

jaakkos avatar ksnabb avatar mlank avatar mnylen avatar pupeno avatar tommi-h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

new-reliquary's Issues

Transactions not categorized as web

I'm using the Ring middleware like this:

(def app
  (let [handler (wrap-defaults #'routes site-defaults)]
    (if (env :dev)
      (-> handler
          wrap-exceptions
          wrap-reload)
      (-> handler
          wrap-params
          (wrap-newrelic-transaction "Web")))))

and the transactions generated by new-reliquary are categorized as Non-Web:

screen shot 2015-09-07 at 13 49 08

Is this library working?

I just added to a Heroku app and no data is showing up in new relic. I followed the documentation in the README. I haven't started debugging yet though.

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.