Kibana: [APM] Requests per minute graph: Show "n/a" when `transaction.result` is empty

Created on 16 Jan 2019  路  13Comments  路  Source: elastic/kibana

Transactions with an empty transaction.result are shown on the graph, but has no label in the chart legend. The UI should show "n/a" as fallback value.

_Metrics page_
Screenshot 2019-01-16 at 16.04.39.png

_Transactions page_
image

apm bug v6.7.0

Most helpful comment

Just to be clear: The UI will show "n/a" when the string is empty? I don't have to change anything, right?

No, you don't have to do anything. The UI will take care of empty transaction.result and displaying them as "n/a".

Although it might make sense to look into why transaction.result is sometimes empty for transactions sent by the ruby agent :)

All 13 comments

Pinging @elastic/apm-ui

It's also prevalent on the Transactions list page for the same chart

_Ruby agent example_
screenshot 2019-01-16 at 16 08 19

It's can also be reproduced in 6.6 builds Screenshot 2019-01-16 at 16.12.41.png

transactions without result

Can you explain what that means, @formgeist ?

@jasonrhodes We would assign transactions that didn't have a status_code a default name like "Transactions" i.e. for custom transaction types or not-HTTP transactions, so the legend would have a label in the chart. Derived from the default chart name as well "Transactions per minute".

This is not necessarily tied to to status codes. We derive the status code from transaction.result - which could actually be any string, eg "Success", "Fatal" etc.
Currently we don't handle it if the transaction.result field is empty (we do handle missing though!).

To find transactions without a result:

GET apm-*/_search
{
  "size": 20,
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "processor.event": "transaction"
          }
        },
        {
          "term": { "transaction.result": "" }
        }
      ]
    }
  }
}

I'm not sure how we should solve this. I think the best option is to filter this data out.
It only happens for the ruby agent, so perhaps @mikker can help us out a little.

transaction.result is not required in apm-server intake but perhaps empty values should be disallowed?

I'm not sure how they occur either. @formgeist can you provide a sample document with an empty "" result?

@mikker Like this?

{
  "_index": "apm-7.0.0-2019.01.17",
  "_type": "_doc",
  "_id": "mp65XWgB8CmowIumbEdd",
  "_score": 1,
  "_source": {
    "parent": {
      "id": "8a9f48b069c5410a"
    },
    "processor": {
      "name": "transaction",
      "event": "transaction"
    },
    "observer": {
      "hostname": "01fe82bd5515",
      "id": "3403e42a-42ff-4eb3-bb80-308f41cba8b6",
      "ephemeral_id": "1ab19885-5a64-483d-ae2b-86c20654c644",
      "type": "apm-server",
      "version": "7.0.0"
    },
    "trace": {
      "id": "e7275157da263726c466edd0d4fd9902"
    },
    "@timestamp": "2019-01-17T21:30:54.950Z",
    "ecs": {
      "version": "1.0.0-beta2"
    },
    "host": {
      "name": "01fe82bd5515"
    },
    "context": {
      "request": {
        "headers": {
          "Accept": "*/*",
          "Version": "HTTP/1.1",
          "Connection": "keep-alive",
          "User-Agent": "python-requests/2.21.0",
          "Host": "opbeans-ruby:3000",
          "Accept-Encoding": "gzip, deflate",
          "Elastic-Apm-Traceparent": "00-e7275157da263726c466edd0d4fd9902-8a9f48b069c5410a-00"
        },
        "method": "GET",
        "http_version": "1.1",
        "socket": {
          "remote_addr": "172.18.0.8",
          "encrypted": false
        },
        "env": {
          "GATEWAY_INTERFACE": "CGI/1.2",
          "ORIGINAL_FULLPATH": "/api/types",
          "SERVER_PORT": "3000",
          "ROUTES_47181410207140_SCRIPT_NAME": "",
          "SERVER_PROTOCOL": "HTTP/1.1",
          "REQUEST_URI": "/api/types",
          "REMOTE_ADDR": "172.18.0.8",
          "ORIGINAL_SCRIPT_NAME": "",
          "SERVER_SOFTWARE": "puma 3.12.0 Llamas in Pajamas",
          "QUERY_STRING": "",
          "REQUEST_METHOD": "GET",
          "SCRIPT_NAME": "",
          "SERVER_NAME": "opbeans-ruby",
          "REQUEST_PATH": "/api/types",
          "PATH_INFO": "/api/types"
        },
        "body": "[FILTERED]",
        "url": {
          "search": "",
          "protocol": "http",
          "hostname": "opbeans-ruby",
          "port": "3000",
          "pathname": "/api/types",
          "full": "http://opbeans-ruby:3000/api/types"
        }
      },
      "process": {
        "pid": 82,
        "title": "/usr/local/bundle/bin/puma",
        "argv": [
          "-C",
          "config/puma.rb"
        ]
      },
      "system": {
        "hostname": "91150acafdbb",
        "ip": "172.18.0.11",
        "platform": "linux",
        "architecture": "x86_64"
      },
      "service": {
        "environment": "production",
        "agent": {
          "name": "ruby",
          "version": "2.0.1"
        },
        "framework": {
          "name": "Ruby on Rails",
          "version": "5.2.1"
        },
        "name": "opbeans-ruby",
        "runtime": {
          "name": "ruby",
          "version": "2.5.3"
        },
        "language": {
          "name": "ruby",
          "version": "2.5.3"
        },
        "version": "72676346748083292998b7b29bd2230cf246fc9b"
      }
    },
    "transaction": {
      "result": "",
      "duration": {
        "us": 1414
      },
      "name": "Rack",
      "span_count": {
        "dropped": {
          "total": 0
        },
        "started": 0
      },
      "id": "211c43b5f9791e39",
      "type": "request",
      "sampled": false
    },
    "timestamp": {
      "us": 1547760654950460
    }
  },
  "fields": {
    "@timestamp": [
      "2019-01-17T21:30:54.950Z"
    ]
  }
}

I'm not sure how they occur either.

How ironic. I wonder if we can use some apm tool to figure that out :D

We agreed to use "n/a" for these case

Just to be clear: The UI will show "n/a" when the string is empty? I don't have to change anything, right?

Just to be clear: The UI will show "n/a" when the string is empty? I don't have to change anything, right?

No, you don't have to do anything. The UI will take care of empty transaction.result and displaying them as "n/a".

Although it might make sense to look into why transaction.result is sometimes empty for transactions sent by the ruby agent :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timroes picture timroes  路  3Comments

LukeMathWalker picture LukeMathWalker  路  3Comments

Ginja picture Ginja  路  3Comments

celesteking picture celesteking  路  3Comments

bhavyarm picture bhavyarm  路  3Comments