0

I'm really new to APM & Kibana, but ok with Python & ElasticSearch. Before I had Graphite and it was quite easy to do custom tracking.

I'm looking to track 3 simple custom metrics and their evolution over time.

  1. CounterName and it's value. For example queue_size: 23 and send it by any of the workers. What happens when different workers send different values? (because of the time, the value might increase/decrease rapidly).

I do have 20 names of queues to track. Should I put all under a service_name or should I use labels?

Before I used:

self._graphite.gauge("service.queuesize", 3322)

No idea what to have here now: ....

  1. Time spent within a method. I saw here it's possible to have a context manager.

Before I had:

with self._graphite.timer("service.action")

Will become

with elasticapm.capture_span('service.action')
  1. Number of requests. (only count no other tracking)

Before I had

self._graphite.incr("service.incoming_requests")

Is this correct?

client.begin_transaction('processors')
client.end_transaction('processors')
...

THanks a lot!

Alexandru R
  • 8,560
  • 16
  • 64
  • 98

1 Answers1

0
  1. You can add a couple of different types of metadata to your events in APM. Since it sounds like you want to be able to search/dashboard/aggregate over these counters, you probably want labels, using elasticapm.label().

  2. elasticapm.capture_span is indeed the correct tool here. Note that it can be used either as a function decorator, or as a context manager.

  3. Transactions are indeed the best way to keep track of request volume. If you're using one of the supported frameworks these transactions will be created automatically, so you don't have to deal with keeping track of the Client object or starting the transactions yourself.

Colton Myers
  • 1,321
  • 9
  • 12