Git Product home page Git Product logo

Comments (39)

dpsoft avatar dpsoft commented on July 23, 2024 2

@anarwal27 please change this : kamon-influxdb.auto-start = no to this: kamon-influxdb.auto-start = yes.

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024 2

@anarwal27 in order to gathering the Traces you need specify in your application.conf the following:

  trace {
    # Level of detail used when recording trace information. The possible values are:
    #  - metrics-only: metrics for all included traces and all segments are recorded, but no Trace messages will be sent (default)
    #    to the subscribers of trace data.
    #  - simple-trace: metrics for all included traces and all segments are recorded and additionally a Trace message
    #    containing the trace and segments details and metadata. 
    level-of-detail = simple-trace
  }

and if you run again the kamon.example project the output should be something like this:

+--------------------------------------------------------------------------------------------------+
[INFO] [06/10/2017 16:42:56.852] [kamon-akka.actor.default-dispatcher-3] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+
|                                                                                                  |
|    Trace: GreetingTrace                                                                          |
|    Count: 10083                                                                                  |
|                                                                                                  |
|  Elapsed Time (nanoseconds):                                                                     |
|    Min: 6560         50th Perc: 11520          90th Perc: 14784          95th Perc: 17024        |
|                      99th Perc: 29952        99.9th Perc: 130048               Max: 348160       |
|                                                                                                  |
+--------------------------------------------------------------------------------------------------+
[INFO] [06/10/2017 16:42:56.852] [kamon-akka.actor.default-dispatcher-3] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+
|                                                                                                  |
|                                         Counters                                                 |
|                                       -------------                                              |
|                            greetingCounter  =>  10083                                            |
|                                                                                                  |
|                                                                                                  |
|                                        Histograms                                                |
|                                      --------------                                              |
|  GreetingHistogram                                                                               |
|    Min: 1640         50th Perc: 2992           90th Perc: 3888           95th Perc: 4448         |
|                      99th Perc: 8832         99.9th Perc: 36608                Max: 139264       |
|                                                                                                  |
|                                                                                                  |
|                                      MinMaxCounters                                              |
|                                    -----------------                                             |
|  GreetingMinMaxCount                                                                             |
|          Min: 0                      Average: 1.0                         Max: 3                 |
|                                                                                                  |
|                                                                                                  |
|                                          Gauges                                                  |
|                                        ----------                                                |
|                                                                                                  |
+--------------------------------------------------------------------------------------------------+

as you can see there is the GreetingTrace in the output ;). Currently the log-reporter not support segments.

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024 1

@please remove:

 modules {
    kamon-annotation.auto-start = yes
    kamon-log-reporter.auto-start = yes
  }

and try again.

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 please take a look here :https://github.com/kamon-io/Kamon/tree/master/kamon-examples/kamon-annotation-example/java

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft I forgot to add one question, i was trying to include influxdb as backend for the project, i was able to implement kamon-annotations package, but where do I specify that report data to influxdb, where should I be configuring that part for kamon-influxdb?

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 the only that you need is:

kamon {
  metric {
    tick-interval = 10 seconds
    default-collection-context-buffer-size = 1000
  }

  influxdb {
    hostname = "127.0.0.1"
    port = 0
    max-packet-size = 1024
    protocol = "udp"

    application-name = "kamon"
    hostname-override = none

    percentiles = [50.0, 70.5]
  }
}

https://github.com/kamon-io/kamon-influxdb/blob/master/src/test/resources/udp_test.conf

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

Great, thanks for the help. Going to try it now

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft what version of kamon dependencies needs to be used?

 <dependency>
                <groupId>org.influxdb</groupId>
                <artifactId>influxdb-java</artifactId>
                <version>2.5</version>
            </dependency>
            <dependency>
                <groupId>io.kamon</groupId>
                <artifactId>kamon-core_2.11</artifactId>
                <version>0.6.6</version>
            </dependency>
            <dependency>
                <groupId>io.kamon</groupId>
                <artifactId>kamon-annotation_2.11</artifactId>
                <version>0.6.6</version>
            </dependency>
            <dependency>
                <groupId>io.kamon</groupId>
                <artifactId>kamon-log-reporter_2.11</artifactId>
                <version>0.6.6</version>
            </dependency>
            <dependency>
                <groupId>io.kamon</groupId>
                <artifactId>kamon-influxdb_2.10</artifactId>
                <version>0.6.6</version>
            </dependency>

some of these throw error, am i using correct versions?

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 can you please share the error log?

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

It is not able to resolve dependencies, the process (mvn-validate) keeps running when trying to download and fails after a point.

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

this time it worked, but the process gets too slow!

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft

Could not resolve dependencies for project ******************:jar:1.1-SNAPSHOT: 

The following artifacts could not be resolved: io.kamon:kamon-core_2.11:jar:0.6.6, org.scala-
lang:scala-library:jar:2.11.8, com.typesafe.akka:akka-actor_2.11:jar:2.3.15, io.kamon:kamon-
annotation_2.11:jar:0.6.6, org.glassfish:javax.el:jar:3.0.0, io.kamon:kamon-influxdb_2.10:jar:0.6.6: 
Could not transfer artifact io.kamon:kamon-core_2.11:jar:0.6.6 from/to **************-snapshots 
(http://*******************/nexus/content/repositories/snapshots/libs-snapshots-local): Failed to 
transfer file: http://********************/nexus/content/repositories/snapshots/libs-snapshots-
local/io/kamon/kamon-core_2.11/0.6.6/kamon-core_2.11-0.6.6.jar. Return code is: 400 , 
ReasonPhrase:Repository version policy: SNAPSHOT does not allow version: 0.6.6.

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 you can change the kamon-influx scala dependency version to 2.11 as others:

  <dependency>
                <groupId>io.kamon</groupId>
                <artifactId>kamon-influxdb_2.11</artifactId>
                <version>0.6.6</version>
   </dependency>

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft going to try it out now. I had a question regarding annotations implementation, if I am using annotation do i still need akka package? from reading in your documentation it seems just one out of both is needed.

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 you only need kamon-akka if you want to gather metrics/traces from akka

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft i followed all the steps you suggested, but still it dint work. I have put together a small spring-boot project to show what I am doing
https://github.com/anarwal27/kamon.example
can you check if I am doing anything wrong. The application doesnt even start up, I have local influxdb running on localhost.

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

it keeps on throwing me this error:

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:527)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'requires-aspectj'
        at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124)
        at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:145)
        at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159)
        at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164)
        at com.typesafe.config.impl.SimpleConfig.getBoolean(SimpleConfig.java:174)
        at kamon.ModuleLoaderSettings$$anonfun$5.apply(ModuleLoader.scala:103)
        at kamon.ModuleLoaderSettings$$anonfun$5.apply(ModuleLoader.scala:101)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
        at scala.collection.immutable.Set$Set3.foreach(Set.scala:163)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
        at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
        at scala.collection.SetLike$class.map(SetLike.scala:92)
        at scala.collection.AbstractSet.map(Set.scala:47)
        at kamon.ModuleLoaderSettings$.apply(ModuleLoader.scala:101)
        at kamon.ModuleLoaderExtension.<init>(ModuleLoader.scala:32)
        at kamon.ModuleLoader$.createExtension(ModuleLoader.scala:27)
        at kamon.ModuleLoader$.createExtension(ModuleLoader.scala:25)
        at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:713)
        at kamon.Kamon$Instance._start$lzycompute(Kamon.scala:64)
        at kamon.Kamon$Instance._start(Kamon.scala:58)
        at kamon.Kamon$Instance.start(Kamon.scala:69)
        at kamon.Kamon$.start(Kamon.scala:37)
        at kamon.Kamon.start(Kamon.scala)
        at com.example.Application.main(Application.java:11)

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 how to run the application? mvn run?

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

mvn spring-boot:run

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft feel free to make changes to project, it is just a sample

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft
that worked, one more question how do I verify in influx that metrics are being updated?

or even how do I check logs reported by kamon as I do not see anything in database

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 in your aop.xml you need specify the application package:

<aspectj>
    <weaver options="-Xlint:ignore">
        <include within="com.example..*"/>
        <exclude within="org.aspectj.*"/>
    </weaver>
</aspectj>

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft I was able to get the application start, however using mvn package && java -javaagent:/path/to//aspectjweaver.jar -jar target/example-1.0-SNAPSHOT.jar did not work, as it threw me error for unable to locate ascpectj-weaver jar file, so I ran mvn package && java -jar target/example-1.0-SNAPSHOT.jar, by doing this I am able to get the application running and see initial metrics from kamon at start up stage, however later when application start there are no metrics available in influxdb.

I have added my docker-compose file for influxdb in the project to show I am doing it, it still needs some settings for kamon integration I believe which is not specified in the documentation.

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft I have tried running with aspectj-weaver.jar, when I start the application some logs are shown by kamon-log-reporter for CPU and Network, however after that it shows
[INFO] [06/05/2017 11:54:29.674] [kamon-akka.actor.default-dispatcher-8] [akka://kamon/user/kamon-log-reporter] No metrics reported
and nothing is sent to influxdb, is there any config still missing in here?

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft https://groups.google.com/forum/#!topic/kamon-user/YePR30DNmdM

here is the detailed description of my issue, can you have a look to see what is the issue?

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 please remove this line: https://github.com/anarwal27/kamon.example/blob/master/src/main/java/com/example/Application.java#L13
and use something like this:

trait KamonSupport {
  Kamon.start()
  sys.addShutdownHook(Kamon.shutdown())
}

in your Application class, currently you are starting and stopping kamon at application startup ;)

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft that helped with log-reporter, but still nothing is published inside influxdb, anything needs to be updated? This is my main problem, as I want to continously publish data to influxdb in order to monitor via grafana.
Also it still says INFO] [06/05/2017 17:19:50.629] [kamon-akka.actor.default-dispatcher-2] [akka://kamon/user/kamon-log-reporter] **No metrics reported**, is this default?

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft Do i need to configure InfluxdbConnection factory or that is handled by @EnableKamon?

Let me know if you can help me in getting this to work, I can publish example of implementing kamon-influxdb-annotations with a larger project. :)

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

Great!! That was the problem, however I am confused as influxdb is already running on my system, from reading kamon-influxdb.auto-start = no I thought it start influxdb image if it is not running.

In addition, there were 2 last thing in my setup.

  1. As mentioned in http://kamon.io/documentation/kamon-influxdb/0.6.6/overview/
    The data is stored into two measurements in the selected database: kamon-counters and kamon-timers
    image
    It just stores one measurement, I am unable to see. Though I have @Count(name = "greetingCounter") as mentioned in https://github.com/kamon-io/Kamon/blob/master/kamon-examples/kamon-annotation-example/java/src/main/java/kamon/annotation/KamonController.java
  2. I guess it is related to question 1 for counters, in the image below these are just metric names, where will I get actual values?
    image

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 in order to check if the metrics are gathering, please make the following:

1 - mvn package && java -javaagent:/path/to/aspectjweaver-1.8.10.jar -jar target/example-1.0-SNAPSHOT.jar
2 - ab -n10000 -c3 http://localhost:8080/greeting
3 - the output should be something like this:

``

+--------------------------------------------------------------------------------------------------+
[INFO] [06/05/2017 21:23:03.395] [kamon-akka.actor.default-dispatcher-3] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+
|                                                                                                  |
|    CPU (ALL)                                                                                     |
|                                                                                                  |
|    User (percentage)       System (percentage)    Wait (percentage)   Idle (percentage)          |
|       Min: 75                    Min: 12                Min: 0             Min: 8                |
|       Avg: 75.0                   Avg: 12.0               Avg: 0.0           Avg: 8.0              |
|       Max: 75                    Max: 12                Max: 0             Max: 8                |
|                                                                                                  |
|                                                                                                  |
+--------------------------------------------------------------------------------------------------+
[INFO] [06/05/2017 21:23:03.396] [kamon-akka.actor.default-dispatcher-3] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+
|                                                                                                  |
|    Process-CPU                                                                                   |
|                                                                                                  |
|             User-Percentage                           Total-Percentage                           |
|                Min: 74                                   Min: 79                                 |
|                Avg: 74.0                                 Avg: 79.0                               |
|                Max: 74                                   Max: 79                                 |
|                                                                                                  |
+--------------------------------------------------------------------------------------------------+
[INFO] [06/05/2017 21:23:03.396] [kamon-akka.actor.default-dispatcher-3] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+
|                                                                                                  |
|    Network (ALL)                                                                                 |
|                                                                                                  |
|     Rx-Bytes (KB)                Tx-Bytes (KB)              Rx-Errors            Tx-Errors       |
|      Min: 128                   Min: 0                    Total: 0             Total: 0         |
|      Avg: 128.0                Avg: 0.0                                                      |
|      Max: 128                   Max: 0                                                          |
|                                                                                                  |
+--------------------------------------------------------------------------------------------------+
[INFO] [06/05/2017 21:23:03.396] [kamon-akka.actor.default-dispatcher-3] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+
|                                                                                                  |
|    Context-Switches                                                                              |
|                                                                                                  |
|        Global                Per-Process-Non-Voluntary            Per-Process-Voluntary          |
|    Min: 1551892480                     Min: 1                             Min: 1                 |
|    Avg: 1.55189248E9                   Avg: 1.0                           Avg: 1.0               |
|    Max: 1551892480                     Max: 1                             Max: 1                 |
|                                                                                                  |
+--------------------------------------------------------------------------------------------------+
[INFO] [06/05/2017 21:23:03.397] [kamon-akka.actor.default-dispatcher-3] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+
|                                                                                                  |
|    Trace: GreetingTrace                                                                          |
|    Count: 1059                                                                                   |
|                                                                                                  |
|  Elapsed Time (nanoseconds):                                                                     |
|    Min: 15808        50th Perc: 31360          90th Perc: 50176          95th Perc: 66048        |
|                      99th Perc: 346112       99.9th Perc: 733184               Max: 819200       |
|                                                                                                  |
+--------------------------------------------------------------------------------------------------+
[INFO] [06/05/2017 21:23:03.397] [kamon-akka.actor.default-dispatcher-3] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+
|                                                                                                  |
|                                         Counters                                                 |
|                                       -------------                                              |
|                            greetingCounter  =>  1062                                             |
|                                                                                                  |
|                                                                                                  |
|                                        Histograms                                                |
|                                      --------------                                              |
|                                                                                                  |
|                                      MinMaxCounters                                              |
|                                    -----------------                                             |
|  GreetingMinMaxCount                                                                             |
|          Min: 0                      Average: 0.0                         Max: 2                 |
|                                                                                                  |
|                                                                                                  |
|                                          Gauges                                                  |
|                                        ----------                                                |
|                                                                                                  |
+--------------------------------------------------------------------------------------------------+

this is for check that the metrics are there.

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft Thanks, can you explain, what step 2 is actually doing?

Also these values are in log-reporter, are these added to influxdb also? If yes, do you have a sample query for influxdb to get these values in database?

For example, I was trying to get values of cpu-user from measurement: greeting-timer, with tag: metric, but it return nothing for the queries I was writing, though I know I need to better with these queries however, I wanted to see how you are getting these values.

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 ab = https://httpd.apache.org/docs/2.4/programs/ab.html, maybe you should try do a tcp dump in order to view is the metrics are sending from kamon to influxdb.

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft Thanks for the help throughout, I am working on creating a more elaborate example for my tea, you can include it if you would like.

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft In the below code

 @RequestMapping("/greeting")
    @Trace("GreetingTrace")
    @Histogram(name = "GreetingHistogram")
    @Count(name = "greetingCounter")
    @MinMaxCount(name = "GreetingMinMaxCount")
    public Greeting greeting(@RequestParam(value = "name", defaultValue = "World") String name) throws InterruptedException {
        return new Greeting(counter.incrementAndGet(),
                String.format(template, name));
    }

From my understanding after reading documentation, I understand @trace should start traceContext for the functionality, however I have add

   final TraceContext testTrace = Kamon.tracer().newContext("test-trace");
        Thread.sleep(5000);
        testTrace.finish();

Shouldn't annotation take care of starting traceContext?

Also Trace should keep fetching details for that particular functionality as mentioned here (http://kamon.io/documentation/kamon-annotation/0.6.6/overview/) however so far, I am just able to understand use of segment and not trace, can you please explain in the above context how trace would used or in any general way for spring-boot how trace would be used?

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 You could read the Annotation Module documentation? there explain the diference between @trace and @segment

Manipulating Traces and Segments

Delimiting traces and segments are one of the most basic tasks you would want to perform to start monitoring your
application using Kamon, and the @Trace and @Segment annotations allow you to do just that:

  • @trace: when a method is marked with this annotation a new Trace will be started every time the method is called
    and automatically finished once the method returns. Also, the generated TraceContext becomes the current context while
    the method is executing, making it possible to propagate it at will.

  • @segment: when a method is marked with this annotation a new Segment will be created only if there is a current
    TraceContext while the annotated method is called.

  • The Segment live in the context of a Trace.

underlying the @trace and @segment are doing this: https://github.com/kamon-io/kamon-annotation/blob/master/src/main/scala/kamon/annotation/instrumentation/BaseAnnotationInstrumentation.scala#L100-L117

Of course instead use the annotations, you could instrument all manually with the Trace API and the effect will be the same

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft Makes sense, I did understand what was in documentation, the reason I asked the question was because, when I use @Trace and @Segment, I do not see anything in logs/influxdb for time taken by method (which should have been give elapsed time). I only see counters, histogram, minmaxcounters.

I want to store elapsed time which @Trace and @Segment stores with Trace-Context ( which is explained as functionality of trace http://kamon.io/documentation/kamon-core/0.6.6/tracing/core-concepts/)

[INFO] [06/09/2017 11:48:05.029] [kamon-akka.actor.default-dispatcher-6] [akka://kamon/user/kamon-log-reporter]
+--------------------------------------------------------------------------------------------------+
| |

Counters
GetAllEnvCounter => 1000
Histograms
--------------
GetAllEnvTime
Min: 47616 50th Perc: 91648 90th Perc: 132096 95th Perc: 164864
99th Perc: 313344 99.9th Perc: 688128 Max: 688128
MinMaxCounters
-----------------
Gauges
----------
+--------------------------------------------------------------------------------------------------+

My functionality of controller:


 @Autowired
 SomeEnvDao someEnvDao;


 @Trace("SomeTrace")
 @Count(name="SomeCounter")
 @Time(name = "SomeTime")
 @ApiOperation(value = "Some API Operation")
 @RequestMapping(value = RequestMappingConstants.Configurations.SomeEnvs.BASE, method = RequestMethod.GET)
 public List<SomeEnv> getAll() throws InterruptedException {
     return SomeEnvDao.getAll();
 }

Corresponding Segment created in Dao:

   /**
     * Get all {@link Envs} objects.
     * @return List of {@link Env}s
     */

    @Segment(name="someSegmentName", category = "database", library="SomeService",tags = "${'method':'getAllEnvDao'}")
    public List<SomeEnv> getAll() {
        return jdbcTemplate.query(sql(GET_ALL_ENVS), rowMapper);
    }

For above functionality there is no elapsed time reported in log reporter, if there is how should it be found?

from kamon-influxdb.

anarwal27 avatar anarwal27 commented on July 23, 2024

@dpsoft Thanks, the annotations defined takes EL. So, I was trying to use something like this:
@trace("${this.class.simpleName}"+"-trace")
It doesn't work this way, have you guys defined it in a different way?

from kamon-influxdb.

dpsoft avatar dpsoft commented on July 23, 2024

@anarwal27 take a look to the tests: java: https://github.com/kamon-io/kamon-annotation/blob/master/src/test/java/kamon/annotation/AnnotatedJavaClass.java

scala: https://github.com/kamon-io/kamon-annotation/blob/master/src/test/scala/kamon/annotation/AnnotationInstrumentationSpec.scala#L142

from kamon-influxdb.

narsinghcharan avatar narsinghcharan commented on July 23, 2024

Hello @dpsoft @anarwal27 ,
I have joined a new project where Kamon was already configured 1.6 year ago and now that same task has been assigned to me. now when I am enabling kamon it is throwing exception.
in this project scala+akka has been used and SBT as a build tool has been used.

in build.sbt file, the kamon dependencies are :-

  "io.kamon" %% "kamon-core"         % "0.6.7",
  "io.kamon" %% "kamon-scala"        % "0.6.7" ,
  "io.kamon" %% "kamon-log-reporter" % "0.6.7"

the kamon configuration in application.conf file is :-

# -------------------
# Kamon configuration
# -------------------
kamon {
  //enabled = off
  enabled = on
  modules {
    #kamon-system-metrics.auto-start = false
    kamon-system-metrics.auto-start = yes
    kamon-opentsdb {
      auto-start = yes
      requires-aspectj = no
      extension-class = "kamon.opentsdb.OpenTSDB"
    }

    kamon-log-reporter {
      auto-start = off
    }
  }


  opentsdb {

    # Hostname and port in which your OpenTsdb is running.
    hostname = "127.0.0.1"
    port = 4242

    flush-interval = 10 seconds

    # prefix metric
    application = "app.mts"

    # Subscription patterns used to select which metrics will be pushed to StatsD. Note that first, metrics
    # collection for your desired entities must be activated under the kamon.metrics.filters settings.
    subscriptions {
      histogram = ["**"]
      min-max-counter = ["**"]
      gauge = ["**"]
      counter = ["**"]
      trace = []
      trace-segment = []
      akka-actor = []
      akka-dispatcher = []
      akka-router = []
      system-metric = []
      http-server = []
    }

  }

  #statsd {
  #simple-metric-key-generator.application = "mts"
  #subscriptions {
  #mts-transfer = [ "**" ] #Push transfer metrics
  #}
  #}
}

and the exception what I am getting is :-

10:42:14.090 [main] INFO  kamon.Kamon$Instance - Initializing Kamon...
Exception in thread "main" java.lang.ExceptionInInitializerError
	at ccp.mts.server.broker.MessageTransferServiceApp.main(MessageTransferService.scala)
Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'requires-aspectj'
	at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:156)
	at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:174)
	at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:188)
	at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:193)
	at com.typesafe.config.impl.SimpleConfig.getBoolean(SimpleConfig.java:218)
	at kamon.ModuleLoaderSettings$.$anonfun$apply$1(ModuleLoader.scala:103)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.immutable.Set$Set4.foreach(Set.scala:206)
	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
	at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
	at scala.collection.SetLike.map(SetLike.scala:101)
	at scala.collection.SetLike.map$(SetLike.scala:101)
	at scala.collection.AbstractSet.map(Set.scala:47)
	at kamon.ModuleLoaderSettings$.apply(ModuleLoader.scala:101)
	at kamon.ModuleLoaderExtension.<init>(ModuleLoader.scala:32)
	at kamon.ModuleLoader$.createExtension(ModuleLoader.scala:27)
	at kamon.ModuleLoader$.createExtension(ModuleLoader.scala:25)
	at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:913)
	at kamon.Kamon$Instance._start$lzycompute(Kamon.scala:64)
	at kamon.Kamon$Instance._start(Kamon.scala:58)
	at kamon.Kamon$Instance.start(Kamon.scala:69)
	at kamon.Kamon$.start(Kamon.scala:37)
	at ccp.mts.common.metrics.KamonMetricsModule$.start(KamonMetricsModule.scala:22)
	at ccp.mts.server.broker.MessageTransferServiceApp$.<init>(MessageTransferService.scala:98)
	at ccp.mts.server.broker.MessageTransferServiceApp$.<clinit>(MessageTransferService.scala)
	... 1 more

please provide me some help on the same. Thank you for your valuable time.

from kamon-influxdb.

Related Issues (10)

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.