I'm working with Elasticsearch APM monitoring performance of our services, and I'm interested in estimating the network traffic (in MB/s) generated by the requests and responses logged by APM for APIs, or Paths.
First what the APM agent might provide automatically. The agent does record the "encoded_body_size" on some spans. However, this is only recording the content-length header value from the HTTP response for client HTTP requests, and only for some instrumentations. For example, when the AWS S3 client is used to make a request to S3, the Content-Length of the HTTP response from S3 is recorded.
Because this data is limited to client HTTP requests, an is only recorded by some instrumentations, I think this would be too limited. I'm guessing from your question that you are more interested in the bytes in and out to your service's endpoints.
This allows you to the OpenTelemetry Metrics API to define metrics and update them in your code. The APM agent translates those Metrics API calls into metrics that are sent to the APM server and stored in Elasticsearch. You would then need to create your own dashboard/charts in Kibana to visualize those metrics.
If I understand what you want correctly, you might want to define Histogram metrics to capture the HTTP server request body size and response body size. You'd need a handler on your API server object that update each metric on each request (after the request and response body sizes are known).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.