influxdb/telemetry
Ayan George ca2055c16c
refactor: Replace ctx.Done() with ctx.Err() (#19546)
* refactor: Replace ctx.Done() with ctx.Err()

Prior to this commit we checked for context cancellation with a select
block and context.Context.Done() without multiplexing over any other
channel like:

  select {
    case <-ctx.Done():
      // handle cancellation
    default:
      // fallthrough
  }

This commit replaces those type of blocks with a simple check of
ctx.Err().  This has the following benefits:

* Calling ctx.Err() is much faster than entering a select block.

* ctx.Done() allocates a channel when called for the first time.

* Testing the result of ctx.Err() is a reliable way of determininging if
  a context.Context value has been canceled.

* fix: Fix data race in execDeleteTagValueEntry()
2020-09-16 12:20:09 -04:00
..
README.md feat(telemetry): add telemetry handler 2019-01-21 13:05:58 -06:00
handler.go refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
handler_test.go refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
metrics.go refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
push.go refactor: Replace ctx.Done() with ctx.Err() (#19546) 2020-09-16 12:20:09 -04:00
push_test.go chore: update staticcheck and fix newly identified lint checks (#18737) 2020-06-26 18:54:09 -05:00
reporter.go refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
reporter_test.go refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
store.go chore: Remove several instances of WithLogger (#15996) 2019-12-04 15:10:23 -08:00
telemetry_test.go chore: update staticcheck and fix newly identified lint checks (#18737) 2020-06-26 18:54:09 -05:00
timestamps.go refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
timestamps_test.go refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00

README.md

Telemetry Data

Telemetry is first collected by retrieving prometheus data from a Gatherer. Next, the collected data is filtered by matching a subset of prometheus families. Finally, the data is transmitted to a prometheus push gateway handler.

The handler enriches the metrics with the timestamp when the data is received.