Skip to content
NanoFlags
Start free

Integrations

Datadog

Send release events from NanoFlags to Datadog as events tagged with environment, project, service, flags and revision. Overlay them on any graph to see which flag change lines up with a spike. Team plan and above.

What is sent

NanoFlags eventDatadog eventAlert type
A revision is published (dashboard, API, CLI or schedule)NanoFlags: published r42 to Production (Shop)success
A flag is turned off with the kill switchNanoFlags: kill switch turned new-checkout off in Production (Shop)warning
A change is approved or rejectedNanoFlags: change approved: New checkout (Production, Shop)success / warning
A scheduled publish failsNanoFlags: scheduled publish of Production failed (Shop)error

Each event links back to the change (or the activity log) in NanoFlags. A kill switch is sent once, as the kill-switch event.

Set up

  1. In Datadog, open Organization Settings → API Keys and create a key (32 characters). Use an API key, not an application key: an API key can only submit data.
  2. In NanoFlags, open Settings → Integrations → Datadog as an owner or admin.
  3. Add a destination: a name, your Datadog site (the address you use: app.datadoghq.com is US1, app.datadoghq.eu is EU, also US3, US5, AP1, AP2 and US1-FED), the API key, the events, and optionally the environments and project it covers.
  4. NanoFlags checks the key against the site and posts a test event. Test connection repeats the check at any time.

A destination covers this project or every project of the organization. An organization can have up to 10 destinations, for example one per Datadog organization or per environment.

Tags

TagExampleMeaning
integration:nanoflagsEvery NanoFlags event
nanoflags_eventnanoflags_event:publish.completedThe kind of event
serviceservice:checkoutThe destination's service tag (default nanoflags), so events appear next to that service
envenv:productionThe environment key
projectproject:shopThe project key
revisionrevision:42The published revision
flagflag:new-checkoutOne tag per flag in the change (up to 10)
change_idchange_id:…The NanoFlags change

Add your own tags per destination, such as team:payments.

Deployment markers on dashboards

On a timeseries widget, open Event overlays and search:

text
tags:integration:nanoflags env:production
tags:integration:nanoflags service:checkout nanoflags_event:publish.completed

Kill switches and failed scheduled publishes can also drive monitors: an event monitor on tags:integration:nanoflags nanoflags_event:flag.killed notifies your on-call channel.

Propagation latency metric

Optionally, each publish also sends the gauge nanoflags.publish.propagation_ms: the time from the database commit of the revision to its distribution to connected SDKs, with the same env, project and service tags. It is sent two minutes after the publish, once measured; a publish that was not distributed within a few minutes sends no point.

Delivery and retries

  • Events are queued when they happen and sent within a minute. Failed attempts are retried 5 times (after 1, 2, 4, 8 and 16 minutes) for rate limits, Datadog server errors and timeouts.
  • A refused key (HTTP 403) or an invalid request is not retried: the delivery log on the Datadog settings page shows the answer, and three failures in a row mark the destination as failing.
  • Delivery is at least once: a retry after a lost answer can send an event twice.

How the API key is stored

The key is sent once from your browser to NanoFlags and encrypted (AES-256-GCM) by the NanoFlags notify service with a key the database does not hold. It is never shown again, returned by any API or sent to a browser; the settings page shows only its last four characters. Removing a destination deletes its key. See Security.

Plan
Datadog events are included in the Team plan and above. On a lower plan, existing destinations stay listed but receive nothing.