Page MenuHomePhabricator

Observability: Emit counts in data pipeline
Closed, DeclinedPublic

Description

For each run of the data pipeline, emit:

  • number of records updated
  • number of records deleted
  • number of records added
  • number of failed batches in DB
  • Caught "duplicate entry" messages (T356736)
  • total count of rows in actor_data

And we should plot these in a Grafana chart as well. That way, we'll have some visual cues if something is off with the daily imports, and we'll also be able to follow longer historical trends to understand the data update pipeline better.

Event Timeline

@STran is there anything else you think we should emit for observability related to import failures?

To QA this:

  1. Using Docker

You should be able to rebuild with a command like docker-compose up --build --force-recreate --detach and see a new statsd server on localhost:80 by default. Stats get sent to localhost:8125. If you want to change these ports, you can override the docker-compose.yml values by using docker-compose.override.yml. These are the values you should change:

    STATS_SERVER_PORT: 8125 // port to change for where to send stats
stats:
  image: graphiteapp/graphite-statsd
  ports:
    - "8125:8125/udp" // if you change STATS_SERVER_PORT you have to change this too
    - "80:80" // change what port the GUI is accessed from
  1. Baremetal

If you're running baremetal, it seems to be an ordeal to get this set up so docker seems to be strongly recommended. If you want to try though, you'll need to install statsd and graphite and set the url/port variables accordingly. The following variables need to be set:

STATS_SERVER_URL: host.docker.internal
STATS_SERVER_PORT: 8125
SEND_STATS: 1
SERVICE_NAME: ipoid

Once you've done that, you should be able to run any import and observe the stats being fed to the stats server. You can disable the sending of stats by setting SEND_STATS to 0.