cardi-c

A Datadog metrics cardinality calculator

cardi-c

https://bit.ly/3J20nnD

A Datadog metrics cardinality calculator - not just another female rapper w/ a fast flow :)

description

  • Run Datadog Synthetics Tests vs. 3rd-party crystal-lang API running on Heroku
  • Pass Datadog credentials in the standard way via HTTP headers
  • Delegate all the heavy lifting (Datadog API calls) to said 3rd-party API
  • Crystal API responds w/ concatenated Datadog API responses (acts as a smart proxy)
  • Bonus : Crystal API also ships responses as logs to Datadog to allow in-app creation of custom metrics from logs
  • Benefit : This makes it possible to track & alert on Datadog metrics spikes & cardinality spikes in realtime

usage

runs from heroku

https://cardi-c.herokuapp.com/

Expects Datadog credentials to be passed as headers - will respond w/ 400 if ecxpected headers are missing

heroku query

curl \
    -sw'\n' \
    -H "DD-API-KEY: $DD_API_KEY" \
    -H"DD-APPLICATION-KEY: $DD_APPLICATION_KEY" \
    -H"DD-SITE: $DD_SITE" \
    https://cardi-c.herokuapp.com/

local run

# crystal cardi-c.cr
[production] Kemal is ready to lead at http://0.0.0.0:8080
2022-02-03 18:58:49 UTC 200 GET / 3031.61ms

local build & run compiled version

# shards install
# shards build
# bin/cardinality-calculator
[production] Kemal is ready to lead at http://0.0.0.0:8080
  2022-02-03 18:58:49 UTC 200 GET / 3031.61ms

local query

curl \
    -sw'\n' \
    -H "DD-API-KEY: $DD_API_KEY" \
    -H"DD-APPLICATION-KEY: $DD_APPLICATION_KEY" \
    -H"DD-SITE: $DD_SITE" \
    127.0.0.1:8080

endpoints

Datadog API Endpoints used :

  • active metrics
  • top average custom metrics
  • metrics metadata
  • metrics volumes
  • metrics tags
Repository

cardi-c

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 1
  • almost 3 years ago
  • February 3, 2022
License

Links
Synced at

Sun, 22 Dec 2024 00:44:08 GMT

Languages