Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Marius Oehler
    @mariusoe
    Hi,
    when we tried to instrument MSSQL the last time, we had to use the userSQL field instead sql because the other ones where not populated all the time. Maybe you can try this field aswell.
    unknownuu
    @unknownuu
    Thanks @JonasKunz , @mariusoe ... 'userSQL ' worked fines.!
    tgrperf
    @tgrperf
    Hello,
    tgrperf
    @tgrperf
    I implement JDBC tracing for Oracle prepared statement based on the hsql db conf in demo app.but no sql traces shown, only database trace is displayed.
    Here is my conf :
    inspectit:
    instrumentation:
    data:
      db_name: {down-propagation: NONE, is-tag: false}
      sql: {down-propagation: NONE, is-tag: false}
      servicegraph_is_entry: {down-propagation: NONE, is-tag: false}
    
    scopes:
      oracle_prepared_statement_execute:
        type:
          name: oracle.jdbc.OraclePreparedStatement
        methods:
          - name: execute
            matcher-mode: STARTS_WITH
    
    rules:
      # Extract the sql and add it to the trace
      oracle_get_prep_statement_sql:
        scopes:
          oracle_prepared_statement_execute: true
        tracing:
          attributes:
            database: db_name
            sql: sql
        entry:
          db_name:
            action: get_jdbc_statement_connection_name
          sql:
            action: oracle_prepared_statement_get_sql
    
      # We also trace JDBC calls including their target database
      servicegraph_record_jdbc_calls:
        tracing:
          start-span: true
          attributes:
            database: db_name
          start-span-conditions:
            only-if-true: servicegraph_is_entry
        entry:
          db_name:
            action: get_jdbc_statement_connection_name
    
    
    actions:

    Extracts the SQL from a PreparedStatement for ORACLEDB

      oracle_prepared_statement_get_sql:
        imports:
          - oracle.jdbc
          - java.lang.reflect
        input:
          _this: OraclePreparedStatement
          _class: Class
        value-body:
          Field sqlField = _class.getDeclaredField("sql");
          sqlField.setAccessible(true);
          return sqlField.get(_this);
    tgrperf
    @tgrperf
    no errors shown in log files.
    tgrperf
    @tgrperf
    image.png
    image.png
    Jonas Kunz
    @JonasKunz
    You should see an error in the logs because there is no "sql" Field for Oracle
    tgrperf
    @tgrperf
    Hello,
    oracle_prepared_statement_get_sql action was'nt triggered at all !! and my log files does'nt show any errors.so i add sql entry to servicegraph_record_jdbc_calls (sql:
    action: get_oracle_prepared_statement_sql
    and my
    tgrperf
    @tgrperf
    action is now triggered and i can see "sql" Field error in traces. after replacing sql field with originalSql one , sql queries are shown now in zipkin.
    Thanks a lot.
    tgrperf
    @tgrperf
    Hello, now i would like to show business services called through http servlets in zipkin.is there a way to link instrumented services/api to their http calling requests?
    Jonas Kunz
    @JonasKunz
    What do you mean by "show business services" ? You can (a) add attributes to your traces identifying your business transaction or (b) trace the methods identifying your business transaction
    tgrperf
    @tgrperf
    i mean (a) , add methods' name of business transactions processed in one http request.as for (b) , this is already done in my config files, and i can view all my business transactions with response time but in isolation from http requests.
    something like this :
    image.png
    so i wonder how can i add business & dao transactions to my http request tracing in zipkin.
    Jonas Kunz
    @JonasKunz
    You need to instrument the methods of your services, have a look at the following part of the documentation:
    https://inspectit.github.io/inspectit-ocelot/docs/instrumentation/scopes
    tgrperf
    @tgrperf
    I've defined scopes for my business & dao services/transactions, but to which predifined rule i have to attache my scopes? exemple for my oracle sql tracing i've used servicegraph_record_jdbc_calls , which rule to use for my need.
    Jonas Kunz
    @JonasKunz
    There currently is no rule (will soon change), so create one yourself:
    inspectit:
      instrumentation:
        rules:
          trace_service:
            scopes:
              your_scope: true 
            tracing:
              start-span: true
    tgrperf
    @tgrperf
    OK, it's working now with this config, thanks a lot.
    tgrperf
    @tgrperf
    Hello, i'm facing zipkin/elasticsearch disk space issues (high disk consumption), is there a way to limit spans less than 10s for example with inspectit configuration??
    Jonas Kunz
    @JonasKunz
    You have to options to reduce the number of traces:
    cattox
    @cattox
    Hi all, I'm trying to do something that I believe is quite simple, but I'm struggling to find the correct configuration for it. I've spent some time reading the documentation and searching the web with little success. I have my scenario working as I wanted except for a little detail. I want to consider only the spans that take more than 10ms to complete. Can you point me out the correct way to achieve it? Thanks in advance.
    cattox
    @cattox
    I know that the previous message talks about keeping only slow traces, but what I really want is to keep all traces only with slow spans.
    Jonas Kunz
    @JonasKunz

    Unfortunately, here the problem is the same: With OpenCensus / OpenTelemetry / OpenTracing, a span needs to know whether or not it shall be sampled at thepoint in time when it is started.

    Why is this necessary?
    When a span is started, it makes itself the parent of all following spans. Therefore it already needs to know at this point, if it should make itself the parent of following spans or not.

    RRadziejewski
    @RRadziejewski
    How to add some tracing config which can be assigned to every project so i can basically test if traces are working, Im on this from 2 days, please help
    @JonasKunz Can you please help ?
    Jonas Kunz
    @JonasKunz
    As stated in git, by using the configuration provided with the demo you should be able to see traces.
    Alternatively yo ucan wait until we release version 1.3 this week, which will include the tracing configuration in it's core. This means then no additional configuration except for the jaeger exporter is required to see HTTP traces.
    Jonas Kunz
    @JonasKunz
    *in github
    RRadziejewski
    @RRadziejewski
    When will be the release
    ?
    unknownuu
    @unknownuu
    How do we get method level CPU time in inspectIT-ocelot. I googled and found in inspectIT using 'java.lang.management.ThreadMXBean' we can capture 'getCurrentThreadCpuTime' . How do we do it in ocelot. any sample code would really help. do we need to add it in actions?
    Kevin Lotz
    @lotzk

    Hi, im trying to trace an application with ocelot. I need the FQN of each method being called and for this purpose I use the following action

    get_method_fqn:
            input:
              _methodName: String
              _class: Class
            value: "new StringBuilder(_class.getName()).append('.').append(_methodName).toString()"

    However, this does not seem to register constructor calls. Is there a way to trace object creation / constructor calls?

    Patrick-Eichhorn
    @Patrick-Eichhorn

    Hi Kevin, yes, this is possible, but this is not defined in the actions but under the scopes. There you can define if it is a constructor method: with the attribute "is-constructor: true" (see also https://inspectit.github.io/inspectit-ocelot/docs/instrumentation/scopes#method-matcher).

    What does the scope you defined look like?

    Kevin Lotz
    @lotzk

    Hi Patrick, thanks for replying. The scope I'm using looks like this:

      instrumentation:
        scopes:
          allClasses:
            type:
              name: net.ex
              matcher-mode: STARTS_WITH_IGNORE_CASE
    #        methods:
    #          - is-constructor: true

    This works fine als long as the last two lines are commented out. If I include them, no spans are received at all.

    Patrick-Eichhorn
    @Patrick-Eichhorn

    Hi Kevin,
    your configuration is correct, if the last two lines are commented out, this means that only constructors are instrumented. That no spans arrive may be because the constructors are not called. By the way, the constructors in your configuration are instrumented even if the last two lines are commented, because the scope is on all methods of the class.

    Alternatively, it is possible that the span is overlooked accidentally. For this I have a small example from the Petclinic-Demo*:

    Config.png
    Constructors are displayed as {ClassName}.<init> in the spans. For the petclinic example, which instruments the constructors of the class petDetails*, the span would look like in the following picture:
    Span.png
    Malte Hansen
    @Malte-Hansen

    Hi, I am trying to instrument a running JVM process. Running

    java -Dinspectit.config.file-based.path="./" -javaagent:inspectit-ocelot-agent-0.6.jar -jar sampleApplication.jar

    works fine for starting a new application. However, running

    java -jar inspectit-ocelot-agent-0.6.jar 33684 -Dinspectit.config.file-based.path="./"

    whereas 33684 is the PID of the started application does not work. I suspect that the configuration is not loaded correctly. Is there another syntax which I am missing here?

    Patrick-Eichhorn
    @Patrick-Eichhorn
    Hi Malte,
    the problem is: if attaching the agent to a running JVM, the configurations must be set in the process of the application. This is not possible with the java system properties "-Dinspectit", as these only apply to the agent attach process itself.
    You can submit the configuration with the "json" syntax at the end of the command:
    java -jar inspection-ocelot-agent-0.6.jar 33684 '{inspectit:{config:{file-based:{path:"./"}}}}'.
    Please note that the relative path needs to be specified from the application, not from the agent.
    Malte Hansen
    @Malte-Hansen
    Hi Patrick,
    thanks a lot for the advice. With the addition of escaping the double quotation marks within the JSON string on a Windows machine, I managed to monitor a running application as expected. Great!
    Bernd Albersmann
    @albersma69_twitter

    Hi,
    is there any way to tell the inspectIt agent to trace on interfaces instead of implementing classes? I have got my own Spring Classes, which are only interfaces and annotated with "@Repository" as normal procedure for Spring Repositories. The implementation is added by Spring on the fly during compile time / runtime:

    @Repository
    public interface UserAgreementsRepository extends CrudRepository<UserAgreementsEntity, String> {
    
    <UserAgreementsEntity> findByUserId(@NotNull final String teacherUserId);
    }

    I tried all kinds of scope definition, on annotation, on package/class patterns on extending super class pattrens etc, but nothing works. It seems, that interfaces are ignored at all by the ocelot agent. I would like to see, how long f.e. this find-method takes to complete.
    Thanks!

    Marius Oehler
    @mariusoe

    Hi @albersma69_twitter
    a scope for targetting the repository interface could look like this:

    inspectit:
      instrumentation:
        scopes:
          's_spring_repository':
            interfaces:
              - name: 'your.package.UserAgreementsRepository'
            advanced:
              instrument-only-inherited-methods: true

    this will result in an instrumentation of all the methods defined by your interface.