# Custom Transaction not showing up in APM

**URL:** <https://discuss.elastic.co/t/custom-transaction-not-showing-up-in-apm/219310>\
**Category:** APM\
**Tags:** nodejs\
**Created:** [February 14, 2020, 5:10am UTC](https://discuss.elastic.co/t/custom-transaction-not-showing-up-in-apm/219310 "2020-02-14T05:10:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![baerrach](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baerrach/32/48119_2.png) [@baerrach](https://discuss.elastic.co/u/baerrach)\
**Post date:** [February 14, 2020, 5:10am UTC](https://discuss.elastic.co/t/custom-transaction-not-showing-up-in-apm/219310/1 "2020-02-14T05:10:29Z")

</div>

Running on [cloud.elastic.co](http://cloud.elastic.co)

**Kibana version** :  
v7.5.0

**Elasticsearch version** :  
v7.5.0

**APM Server version** :  
v7.5.0

**APM Agent language and version** :  
Node.js via "elastic-apm-node": "^3.3.0"

**Browser version** :  
N/A

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

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

**Is there anything special in your setup?**  
No

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
I have a custom cli node app that I wan't to add APM metrics too.

I can see see in the APM page that something has half worked as the APM page has  
headers ready for my transctions but not transactional data. See **Provide logs  
and/or server output** for more detail.

**Steps to reproduce** :

I have `const apm = require('elastic-apm-node');` at the top of the entry point.

I've configured and invoked `apm.start(config)` with the correct values.

I create a transaction `const trans = apm.startTransaction('cli', 'job');`

On success/failure I set

```auto
    trans.result = `success`;
or
    apm.captureError(err);
    trans.result = `error`;
finally
    trans.end();
    apm.flush();

```

**Provide logs and/or server output (if relevant)**:

I can see my `Service` named correctly, but when I drill down there are no Transactions.

When I show the `Metrics` tab the `Host` filter correcly lists my hostname.

The `environment` drop down correcly lists my environment `development`

When I set `ELASTIC_APM_LOG_LEVEL=trace` and run my node program  
I can see that it is attempting to transmit it to my APM server.

But I get no information on whether it was successful sent to the  
APM server or not in the console output.

I've also tried adding `apm.flush()` after `trans.end()`.

```auto
setting transaction result { trans: '935441245482b465',
  parent: undefined,
  trace: 'e069a3022ae80770da995b7dfe60af03',
  result: 'success' }
sending transaction { trans: '935441245482b465',
  trace: 'e069a3022ae80770da995b7dfe60af03' }
ended transaction { trans: '935441245482b465',
  parent: undefined,
  trace: 'e069a3022ae80770da995b7dfe60af03',
  type: 'job',
  result: 'success',
  name: 'gb-job' }
no active transaction found - cannot build new span
intercepted call to https.request { id: null }

```

Cheers  
Barrie

---

<div class="post-metadata">

**Author:** ![baerrach](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baerrach/32/48119_2.png) [@baerrach](https://discuss.elastic.co/u/baerrach)\
**Post date:** [February 14, 2020, 5:30am UTC](https://discuss.elastic.co/t/custom-transaction-not-showing-up-in-apm/219310/2 "2020-02-14T05:30:43Z")

</div>

Now that some time has passed, and I've run this a few more times, I can finally see some dots on the screen.

I suspect that the problem is the graphs do not show single values well when they are at the far right edge of the graph, as will happen when you check on the most recent transaction.

With only a single transaction the transactions per minute is doesn't show any lines at all. Now that there is more than one transaction a green line is displayed, even if it still shows 0 tpm.

I can now see something under `Transactions` at the bottom of the page.  
I do not recall if that was populated or not when I first posted.  
Clicking on it, drills down into the most recent trace sample and I can see that it is doing something.

---

<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:** [March 6, 2020, 1:30am UTC](https://discuss.elastic.co/t/custom-transaction-not-showing-up-in-apm/219310/3 "2020-03-06T01:30:51Z")

</div>

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