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)