Define field names and types at metric creation time.

This prevents a common problem where users will set different sets of fields on
the same metric, causing their streams to be rejected by the backend.

Also make the description mandatory while we're breaking the API.

This is a major API change, so I'll separately update all ts_mon users when we
roll infra_libs in infra, and again when we roll infra in infra_internal.

BUG=684974

Change-Id: I3dcd524bf7b99ddecbb78b34cbf59a23849cc80f
Reviewed-on: https://chromium-review.googlesource.com/432120
Commit-Queue: Dave Sansome <dsansome@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Sergey Berezin <sergeyberezin@chromium.org>
Cr-Mirrored-From: https://chromium.googlesource.com/infra/infra
Cr-Mirrored-Commit: 15a4affd130d0e270ed520b72c4b8c24c90dbe27
15 files changed
tree: 521061b4e9785d18b34c4aef8dd343d72455ea67
  1. infra_libs/
  2. .coveragerc
  3. setup.py