# No information going apm server/elasticsearch cluster

**URL:** https://discuss.elastic.co/t/no-information-going-apm-server-elasticsearch-cluster/171858
**Category:** APM
**Created:** [March 12, 2019, 4:38am UTC](https://discuss.elastic.co/t/no-information-going-apm-server-elasticsearch-cluster/171858 "2019-03-12T04:38:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Stephen\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Stephen\_O\_Sullivan](https://discuss.elastic.co/u/Stephen_O_Sullivan)
#### Post date: [March 12, 2019, 4:38am UTC](https://discuss.elastic.co/t/no-information-going-apm-server-elasticsearch-cluster/171858/1 "2019-03-12T04:38:34Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** : 6.6.1

**Elasticsearch version** : 6.6.1

**APM Server version** : 6.6.1

**APM Agent language and version** : java 1.4.0

**Browser version** :n/a

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: docker

\*\*Fresh install or upgraded from other version?\*\*fresh

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc. Nothing special

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**: Simple java jdbc to run a sql statement output results to system.out. But not seeing any information in elastic search. I have a spring boot app and that working fine. All this is running on my desktop and the ELK stack and database is running in docker containers.

Thanks for the help

**Steps to reproduce** :

1. java -javaagent:/Users/steveo/elastic-apm-agent/java/elastic-apm-agent-1.4.0.jar -Delastic.apm.service\_name=my-cool-service -Delastic.apm.application\_packages=com.datawhisperers -Delastic.apm.server\_urls=http://localhost:8200 -jar target/mavenproject2-1.0-SNAPSHOT-shaded.jar
2. 
3. 

\*\*Code:  
package com.datawhisperers.mavenproject2;

```
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author steveo
 */
public class NewMain {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

        try {
            Class.forName("org.postgresql.Driver");
            Connection con = DriverManager.getConnection(
                    "jdbc:postgresql://localhost:5432/drwho", "postgres", "sql");
            Statement stmt = con.createStatement();
            ResultSet rs = stmt.executeQuery("select * from drwho_actors");
            while (rs.next()) {
                System.out.println(rs.getInt(1) + " " + rs.getString(2) + " " + rs.getString(3));
            }
            rs.close();
            stmt.close();
            con.close();
        } catch (ClassNotFoundException | SQLException e) {
            e.printStackTrace();
        }
    }
}

```

**Errors in browser console (if relevant)**:

---

<div class="post-metadata">

### Author: ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)
#### Post date: [March 12, 2019, 4:47am UTC](https://discuss.elastic.co/t/no-information-going-apm-server-elasticsearch-cluster/171858/2 "2019-03-12T04:47:03Z")

</div>

Hi and thanks for using our agent 🙂

In order to trace a span (JDBC span in this instance), it needs to made within a traced transaction (see more in [our data model documentation](https://www.elastic.co/guide/en/apm/get-started/current/apm-data-model.html)).

Since this is done from the Main class, there is no active transaction. If you want to test such code, you can use [our public API](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-current-transaction) to create a transaction before and end end it after you make the DB query.  
Alternatively, you can test your code from within a Servlet running on a [supported servlet container](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html#supported-app-servers).

I hope this helps,  
Eyal.

---

<div class="post-metadata">

### Author: ![Stephen\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Stephen\_O\_Sullivan](https://discuss.elastic.co/u/Stephen_O_Sullivan)
#### Post date: [March 12, 2019, 5:10am UTC](https://discuss.elastic.co/t/no-information-going-apm-server-elasticsearch-cluster/171858/3 "2019-03-12T05:10:44Z")

</div>

Thanks. That worked.

For reference: I added @CaptureTransaction & @CaptureSpan before the main method

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 2, 2019, 1:14am UTC](https://discuss.elastic.co/t/no-information-going-apm-server-elasticsearch-cluster/171858/4 "2019-04-02T01:14:05Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
