Intake API Memory Usage Metricset Does Not Recieve Data

Kibana version: 7.3

Elasticsearch version: 7.3

APM Server version: 7.3

APM Agent language and version: Intake API

Hello,

I am trying to make an agent using the intake API, for the language that our company uses. I was able to successfully find a way to gather the memory usage in our language but when I send the data down to apm, the data does not show on Kibana.

Here is a link to the list of variables I should be using:
https://www.elastic.co/guide/en/apm/server/current/exported-fields-system.html

And here is an example of the JSON I am sending:
{"metricset": {"samples": {"system.memory.total": {"value": 2147483647}, "system.memory.used.bytes": {"value": 1116691496}}, "timestamp": 1568813856000000}}
{"metricset": {"samples": {"system.memory.total": {"value": 2147483647}, "system.memory.used.bytes": {"value": 1116691496}}, "timestamp": 1568813856000000}}
{"metricset": {"samples": {"system.memory.total": {"value": 2147483647}, "system.memory.used.bytes": {"value": 1116691496}}, "timestamp": 1568813857000000}}
{"metricset": {"samples": {"system.memory.total": {"value": 2147483647}, "system.memory.used.bytes": {"value": 1116691496}}, "timestamp": 1568813857000000}}

And here is an example of the CPU usage that I am successfully sending as a reference of a working send:
{"metricset": {"samples": {"system.process.cpu.total.norm.pct": {"value": 0}}, "timestamp": 1568905657000000}}
{"metricset": {"samples": {"system.process.cpu.total.norm.pct": {"value": 0}}, "timestamp": 1568905657000000}}
{"metricset": {"samples": {"system.process.cpu.total.norm.pct": {"value": 0}}, "timestamp": 1568905658000000}}
{"metricset": {"samples": {"system.process.cpu.total.norm.pct": {"value": 0}}, "timestamp": 1568905658000000}}

The metrics you've linked to are metrics relating to the APM Server itself, not for applications. Here's a list of process and memory metrics you should capture for applications: https://github.com/elastic/apm/blob/master/docs/agent-development.md#systemprocess-cpuheap

The APM UI currently only shows the system memory, but it requires both system.memory.total and system.memory.actual.free, and will not show the memory metrics if either of those are missing.

Are you able to share any details about the agent you're writing - which language, and whether you intend to release it as open source?

We are writing in Delphi, which is the object oriented version of pascal. It is compatible with Delphi 5 and up. I don't know how beneficial it would be to the public, as it is a lesser used language but I can check for clearance from within our company.

@axw your solution worked :slight_smile:. Thank you very much.

1 Like

This is an example JSON packet for all those who stumble upon this in the future:

{
	"metricset": {
		"samples": {
			"system.memory.total": {
				"value": 2147483647
			},
			"system.memory.actual.free": {
				"value": 816043786
			}
		},
		"timestamp": 1569249188000000
	}
}

We are writing in Delphi, which is the object oriented version of pascal. It is compatible with Delphi 5 and up. I don't know how beneficial it would be to the public, as it is a lesser used language but I can check for clearance from within our company.

Nice! In case you haven't seen it already, there is another community-developed agent for Delphi: GitHub - ntavendale/opal: Elastic Application Performance Monitoring Client For Delphi. Hasn't been updated in a while though.

Glad to hear the metrics issue is sorted.

@axw Yes we did see this! This was the foundation that we built our application off of. The Delphi agent written by this member did not support early versions of Delphi and we are on Delphi 5, so we had to adjust this to be workable with our applications. Also it was missing metric data entirely, which we have now implemented in full. The agent also seemed to be built on an old iteration of the intake API. Some tags were missing and others were there that no longer exist in the API.

1 Like

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