Code Monkey home page Code Monkey logo

clj-newrelic's Introduction

clj-newrelic

Build Status Dependencies Status

This project exports one macro, com.climate.newrelic.trace/defn-traced. Use it as a drop-in replacement for defn if you want calls to a function to show up in New Relic transaction tracing.

To include in your project, add

Clojars Project

to your lein dependencies.

General strategy adapted from Sean Corfield.

clj-newrelic's People

Contributors

michaelblume avatar podviaznikov avatar rcarmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clj-newrelic's Issues

Trace with dispatcher

Hi, great use of macros!, just one little detail, I tried defn-traced but I didn't get the transactions in New Relic's dashboard so I tried the Sean Corfield's strategy and added the dispatcher parameter to the Trace annotation Trace {:dispatcher true} and it worked, so I guess something like defn-dispatcher with the dispatcher parameter set to true could be a workaround.

Doesn't seem to work with lein compile

I'm not familiar enough with Clojure yet to know if maybe I've just misconfigured something, but locally, this macro works almost exactly as expected, a drop in replacement for defn (self referencing functions fail, but that's a limitation I can handle).

When I try to deploy the app to Heroku, I get an error on the line with "defn-traced" though: Can't define method not in interfaces: invoke, compiling:(file.clj:17:1)

I'm not sure why compiling ahead of time makes a difference here, but it happens locally as well.

Fetching repository, done.
Counting objects: 21, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (11/11), 1.21 KiB, done.
Total 11 (delta 6), reused 0 (delta 0)

-----> Clojure (Leiningen 2) app detected
-----> Installing OpenJDK 1.7...done
-----> Using cached Leiningen 2.4.2
       Writing: lein script
-----> Building with Leiningen
       Running: lein with-profile production compile :all
       (Retrieving com/climate/clj-newrelic/0.1.0/clj-newrelic-0.1.0.pom from clojars)
       (Retrieving com/newrelic/agent/java/newrelic-api/3.8.1/newrelic-api-3.8.1.pom from central)
       (Retrieving com/newrelic/agent/java/newrelic-api/3.8.1/newrelic-api-3.8.1.jar from central)
       (Retrieving com/climate/clj-newrelic/0.1.0/clj-newrelic-0.1.0.jar from clojars)
       Jul 24, 2014 20:36:10 +0000 [528 1] com.newrelic INFO: Agent is using Logback
       Jul 24, 2014 20:36:10 +0000 [528 1] com.newrelic INFO: Loading configuration file "newrelic.yml"
       Compiling adstage.metrics.resource.folder-summary
       20:37:05,450 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
       20:37:05,450 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
       20:37:05,450 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/tmp/build_71860258-f0ac-4a7a-8ad3-64d5e6e4f0c6/src/logback.xml]
       20:37:05,519 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
       20:37:05,520 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
       20:37:05,527 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
       20:37:05,830 |-ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Could not find an appropriate class for property [context]
       20:37:05,852 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
       20:37:05,852 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
       20:37:05,853 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
       20:37:05,854 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@18ba8912 - Registering current configuration as safe fallback point

       {"timestamp":"2014-07-24T20:37:05.934Z","level":"WARN","thread":"main","logger":"com.datastax.driver.core.FrameCompressor","message":"Cannot find LZ4 class, you should make sure the LZ4 library is in the classpath if you intend to use it. LZ4 compression will not be available for the protocol.","context":"defa
ult"}
       Exception in thread "main" java.lang.IllegalArgumentException: Can't define method not in interfaces: invoke, compiling:(adstage/metrics/resource/folder_summary.clj:17:1)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6651)
        at clojure.lang.Compiler.analyze(Compiler.java:6445)
        at clojure.lang.Compiler.analyze(Compiler.java:6406)
        at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5782)
        at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6100)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6644)
        at clojure.lang.Compiler.analyze(Compiler.java:6445)
        at clojure.lang.Compiler.analyze(Compiler.java:6406)
        at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5782)
        at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5217)
        at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3846)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6642)

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.