Elastic APM @CaptureTransaction

Kibana version: 7.5.2

Elasticsearch version: 7.5.2

APM Server version:

APM Agent language and version: 1.11.0 java

While using the @CaptureTransaction(value = 'Task') it was supposed to create a new tab with all the transactions called under that api but it does not seem to be working.
is there something else i need to mention.

What exactly is not working? Is it creating no transaction at all? Or is it creating a transaction but you would like it to be separated form the rest of your transaction?

Make sure you set application_packages - that's a prerequisite for the @CaptureTransaction annotation to work.

If you want your transactions to be separate, set a different type. The default type is request which makes them appear in the same list as the regular transactions.

For example: @CaptureTransaction(type = "Task")

It is creating a transaction but it is not separating it from the rest. @CaptureTransaction(type = "Task") i have done this as well.
application packages has been set as well

Make sure that you don't set value = "Task" but type = "Task". If that doesn't help, could you send me the JSON document of the transaction form the Discover tab in Kibana?

{
"_index": "apm-7.5.2-span-000003",
"_type": "_doc",
"_id": "9Gc3NXEB7lcn_7V98JI2",
"_score": 1,
"_source": {
"parent": {
"id": "79baefb2785045ef"
},
"agent": {
"name": "java",
"ephemeral_id": "bc164e9e-16b8-47cc-bf1e-649b7ad9027e",
"version": "1.11.0"
},
"processor": {
"name": "transaction",
"event": "span"
},
"observer": {
"hostname": "users-MacBook-Pro.local",
"id": "a1a09d13-5573-4ac0-afc5-4fba6896ae8e",
"ephemeral_id": "8e52bd6c-6a78-4b44-aa5b-dfaa79a15634",
"type": "apm-server",
"version": "7.5.2",
"version_major": 7
},
"trace": {
"id": "9ec0b9895b54be8f7dfd0e5a1bf597bf"
},
"@timestamp": "2020-04-01T10:09:40.737Z",
"ecs": {
"version": "1.1.0"
},
"service": {
"name": "distributor-store-service"
},
"transaction": {
"id": "79baefb2785045ef"
},
"timestamp": {
"us": 1585735780737954
},
"span": {
"duration": {
"us": 573353
},
"stacktrace": [
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "RedirectExec.java",
"line": {
"number": 181
},
"module": "org.apache.http.impl.execchain",
"function": "execute"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "InternalHttpClient.java",
"line": {
"number": 185
},
"module": "org.apache.http.impl.client",
"function": "doExecute"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "CloseableHttpClient.java",
"line": {
"number": 83
},
"module": "org.apache.http.impl.client",
"function": "execute"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "CloseableHttpClient.java",
"line": {
"number": 108
},
"module": "org.apache.http.impl.client",
"function": "execute"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "CloseableHttpClient.java",
"line": {
"number": 56
},
"module": "org.apache.http.impl.client",
"function": "execute"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "ApacheHttpClient.java",
"line": {
"number": 85
},
"module": "feign.httpclient",
"function": "execute"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "TracingFeignClient.java",
"line": {
"number": 100
},
"module": "org.springframework.cloud.sleuth.instrument.web.client.feign",
"function": "execute"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "LazyTracingFeignClient.java",
"line": {
"number": 60
},
"function": "execute",
"module": "org.springframework.cloud.sleuth.instrument.web.client.feign"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "HystrixInvocationHandler.java",
"line": {
"number": 106
},
"module": "feign.hystrix",
"function": "run"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "HystrixCommand.java",
"line": {
"number": 302
},
"module": "com.netflix.hystrix",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "HystrixCommand.java",
"line": {
"number": 298
},
"module": "com.netflix.hystrix",
"function": "call"
},
{
"exclude_from_grouping": false,
"library_frame": true,
"filename": "OnSubscribeDefer.java",
"line": {
"number": 46
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeDefer.java",
"line": {
"number": 35
},
"function": "call",
"module": "rx.internal.operators"
},
{
"exclude_from_grouping": false,
"library_frame": true,
"filename": "OnSubscribeLift.java",
"line": {
"number": 48
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeLift.java",
"line": {
"number": 30
},
"module": "rx.internal.operators",
"function": "call"
},
{
"exclude_from_grouping": false,
"library_frame": true,
"filename": "OnSubscribeLift.java",
"line": {
"number": 48
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeLift.java",
"line": {
"number": 30
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeLift.java",
"line": {
"number": 48
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeLift.java",
"line": {
"number": 30
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "Observable.java",
"line": {
"number": 10151
},
"module": "rx",
"function": "unsafeSubscribe"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeDefer.java",
"line": {
"number": 51
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeDefer.java",
"line": {
"number": 35
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "Observable.java",
"line": {
"number": 10151
},
"module": "rx",
"function": "unsafeSubscribe"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeDoOnEach.java",
"line": {
"number": 41
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeDoOnEach.java",
"line": {
"number": 30
},
"function": "call",
"module": "rx.internal.operators"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeLift.java",
"line": {
"number": 48
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OnSubscribeLift.java",
"line": {
"number": 30
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "Observable.java",
"line": {
"number": 10151
},
"module": "rx",
"function": "unsafeSubscribe"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "OperatorSubscribeOn.java",
"line": {
"number": 94
},
"module": "rx.internal.operators",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "HystrixContexSchedulerAction.java",
"line": {
"number": 56
},
"function": "call",
"module": "com.netflix.hystrix.strategy.concurrency"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "HystrixContexSchedulerAction.java",
"line": {
"number": 47
},
"module": "com.netflix.hystrix.strategy.concurrency",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "TraceCallable.java",
"line": {
"number": 70
},
"module": "org.springframework.cloud.sleuth.instrument.async",
"function": "call"
},
{
"exclude_from_grouping": false,
"library_frame": true,
"filename": "HystrixContexSchedulerAction.java",
"line": {
"number": 69
},
"module": "com.netflix.hystrix.strategy.concurrency",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "ScheduledAction.java",
"line": {
"number": 55
},
"module": "rx.internal.schedulers",
"function": "run"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "SpanInScopeRunnableWrapper.java",
"line": {
"number": 64
},
"module": "co.elastic.apm.agent.impl.async",
"function": "run"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "Executors.java",
"line": {
"number": 515
},
"module": "java.util.concurrent",
"function": "call"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "FutureTask.java",
"line": {
"number": 264
},
"module": "java.util.concurrent",
"function": "run"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "ThreadPoolExecutor.java",
"line": {
"number": 1128
},
"module": "java.util.concurrent",
"function": "runWorker"
},
{
"library_frame": true,
"exclude_from_grouping": false,
"filename": "ThreadPoolExecutor.java",
"line": {
"number": 628
},
"module": "java.util.concurrent",
"function": "run"
},
{
"exclude_from_grouping": false,
"library_frame": true,
"filename": "Thread.java",
"line": {
"number": 830
},
"module": "java.lang",
"function": "run"
}
],
"subtype": "http",
"name": "GET preprod.retailio.in",
"http": {
"response": {
"status_code": 200
},
"url": {
"original": "https://preprod.retailio.in/api/Distributors?filter={"limit"%3A1%2C"offset"%3A0%2C"where"%3A{"id"%3A"1"}}"
}
},
"id": "b5277855fdbca72c",
"type": "external"
}
},
"fields": {
"@timestamp": [
"2020-04-01T10:09:40.737Z"
]
this is the document

This is a span document, not a transaction. You can filter down the discover view filtering for processor.type: "transaction" processor.event: "transaction".

did you mean processor.name: transaction because i do not seem to find processor.type:transaction

Sorry, I mean processor.event

{
"_index": "apm-7.5.2-transaction-000003",
"_type": "_doc",
"_id": "9Wc3NXEB7lcn_7V98JI2",
"_score": 1,
"_source": {
"agent": {
"name": "java",
"ephemeral_id": "bc164e9e-16b8-47cc-bf1e-649b7ad9027e",
"version": "1.11.0"
},
"process": {
"pid": 52057,
"title": "/Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk/Contents/Home/bin/java",
"ppid": 24853
},
"source": {
"ip": "::1"
},
"processor": {
"name": "transaction",
"event": "transaction"
},
"url": {
"path": "/oauth/distributorStoreProducts",
"scheme": "http",
"port": 8090,
"domain": "localhost",
"full": "http://localhost:8090/oauth/distributorStoreProducts"
},
"observer": {
"hostname": "users-MacBook-Pro.local",
"id": "a1a09d13-5573-4ac0-afc5-4fba6896ae8e",
"ephemeral_id": "8e52bd6c-6a78-4b44-aa5b-dfaa79a15634",
"type": "apm-server",
"version": "7.5.2",
"version_major": 7
},
"trace": {
"id": "9ec0b9895b54be8f7dfd0e5a1bf597bf"
},
"@timestamp": "2020-04-01T10:09:40.111Z",
"ecs": {
"version": "1.1.0"
},
"service": {
"node": {
"name": "users-mbp"
},
"name": "distributor-store-service",
"runtime": {
"name": "Java",
"version": "13.0.1"
},
"language": {
"name": "Java",
"version": "13.0.1"
}
},
"host": {
"hostname": "users-mbp",
"os": {
"platform": "Mac OS X"
},
"ip": "127.0.0.1",
"name": "users-mbp",
"architecture": "x86_64"
},
"http": {
"request": {
"headers": {
"X-Username": [
"pankaj"
],
"Accept": [
"/"
],
"Connection": [
"keep-alive"
],
"User-Agent": [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36"
],
"Sec-Fetch-Site": [
"none"
],
"Sec-Fetch-Dest": [
"empty"
],
"Host": [
"localhost:8090"
],
"Accept-Encoding": [
"gzip, deflate, br"
],
"Source": [
"oms-worker"
],
"Sec-Fetch-Mode": [
"cors"
],
"Authorization": [
"[REDACTED]"
],
"Cache-Control": [
"no-cache"
],
"X-Userid": [
"1"
],
"Version": [
"1.0.0"
],
"Postman-Token": [
"[REDACTED]"
],
"Accept-Language": [
"en-GB,en-US;q=0.9,en;q=0.8"
],
"Content-Type": [
"application/json"
]
},
"method": "get",
"socket": {
"encrypted": false,
"remote_address": "0:0:0:0:0:0:0:1"
}
},
"response": {
"headers": {
"X-Frame-Options": [
"DENY"
],
"Authorization": [
"[REDACTED]"
],
"X-Username": [
"distributorStoreCron"
],
"Cache-Control": [
"no-cache, no-store, max-age=0, must-revalidate"
],
"X-Userid": [
"1"
],
"X-Content-Type-Options": [
"nosniff"
],
"X-Xss-Protection": [
"1; mode=block"
],
"Expires": [
"0"
],
"Pragma": [
"no-cache"
]
},
"status_code": 200,
"finished": true,
"headers_sent": false
},
"version": "1.1"
},
"client": {
"ip": "::1"
},
"user_agent": {
"original": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36",
"os": {
"name": "Mac OS X",
"version": "10.15.2",
"full": "Mac OS X 10.15.2"
},
"name": "Chrome",
"device": {
"name": "Other"
},
"version": "80.0.3987"
},
"transaction": {
"duration": {
"us": 1274358
},
"result": "HTTP 2xx",
"name": "OAuthController#authenticateAllApi",
"id": "79baefb2785045ef",
"span_count": {
"dropped": 0,
"started": 1
},
"type": "request",
"sampled": true
},
"timestamp": {
"us": 1585735780111012
}
},
"fields": {
"@timestamp": [
"2020-04-01T10:09:40.111Z"
]
}
}

This is not a transaction created by @CaptureTransaction.

What I'm trying to figure out: When setting @CaptureTransaction(type: "Task"), the transactions created by this annotation should have "type": "Task" in discover. In that case, there's also a selector transaction type selector in the transaction overview/service detail page where you can filter to see transactions of a particular type (default is request).


This picture shows that only one type of transaction type is being created i.e request

We have unit tests that the type is set correctly using @CaptureTransaction(type = "Task").

Please make sure that you set the type and not the value and that there's a recorded transaction for the method you annotated.

I am not able to install any dependency with this
import co.elastic.apm.agent

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