Skip to content

Commit 66569b1

Browse files
authored
Merge pull request scribd#66 from scribd/jimp/datadog_backup
feat: Add Datadog Backup post
2 parents 7e3412a + 0f4ddbe commit 66569b1

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

_data/authors.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,7 @@ jimp:
8989
paha:
9090
name: Patrick H
9191
github: glerb
92+
93+
kamranf:
94+
name: Kamran Farhadi
95+
github: kamranf

_posts/2020-08-10-datadog-backup.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
layout: post
3+
title: Backing up Datadog and Performing Bulk Edits
4+
tags:
5+
- datadog
6+
- monitoring
7+
- featured
8+
team: Core Infrastructure
9+
authors:
10+
- jimp
11+
- kamranf
12+
13+
---
14+
15+
16+
What would happen if someone accidentally deleted a dashboard or important
17+
monitor in Datadog? How would we know that it had changed? All of our monitoring
18+
and metrics at Scribd are configured in [Datadog](https://www.datadoghq.com), so
19+
it was important to have a mechanism to **track changes** across all these
20+
resources and be able to **revert back** to a previous state in case of a bad
21+
change. We also wanted the ability to **search and edit** across all dashboards
22+
and monitors (to refactor a tag, for example).
23+
24+
When composing dashboards and monitors, immediate feedback is critical.
25+
Therefore, as we evaluated existing tools, we looked for the ability to coexist
26+
with Datadog’s native user interface.
27+
28+
Finding none that exactly fit our needs, we wrote [Datadog
29+
Backup](https://github.com/scribd/datadog_backup), an open source Ruby gem.
30+
Datadog Backup focuses on the ability to perform global backups and bulk editing
31+
without impeding the free use of the Datadog User Interface.
32+
33+
Aspects of this project were inspired by the likes of
34+
[Doggy](https://github.com/Shopify/doggy). As you consider your approach to
35+
Datadog management, we highly recommend you also take a look at it and other
36+
client libraries at
37+
[https://docs.datadoghq.com/developers/libraries/#datadog-client-community-libraries](https://docs.datadoghq.com/developers/libraries/#datadog-client-community-libraries).
38+
39+
40+
## How to use Datadog Backup
41+
42+
The intended use case for Datadog Backup is as a component of a Github Action
43+
workflow, or similar CD pipeline, that takes regular backups of Datadog, then
44+
commits to a git repository. This enables such a repository to be used as an
45+
audit trail, capturing the state of Datadog configuration at regular intervals.
46+
47+
A local backup will additionally enable performing a search against the YAML or
48+
JSON definitions and performing mass updates which can then be pushed back to
49+
Datadog. To use the tool to make a mass edit to Datadog configuration, one
50+
modifies the repository locally, then runs the command in “restore” mode.
51+
52+
53+
### Running the tool
54+
![demo](https://github.com/scribd/datadog_backup/raw/434268667359500ee3739b1fb3cb595a46ae43a8/images/demo.gif)
55+
56+
```
57+
gem install datadog_backup
58+
export DATADOG_API_KEY=abc123
59+
export DATADOG_APP_KEY=abc123
60+
61+
# Perform backup to optional/path/to/backupdir using YAML encoding
62+
datadog_backup backup --backup-dir optional/path/to/backupdir
63+
64+
# Make some changes
65+
66+
# Just review the changes since last backup
67+
datadog_backup diffs --backup-dir optional/path/to/backupdir
68+
69+
# Review and apply local changes to datadog
70+
71+
datadog_backup restore --backup-dir optional/path/to/backupdir
72+
```
73+
74+
### Using the tool in Github Actions
75+
76+
Included in the git repo for Datadog Backup is an [example Github Actions
77+
workflow](https://github.com/scribd/datadog_backup/tree/master/example) for
78+
periodically backing up your Datadog deployment.
79+
80+
### Further development
81+
82+
Some areas to further expand the gem are:
83+
84+
- Backup of metadata
85+
86+
If you find this Gem useful, and would like to expand on it, [contributions are
87+
welcome](https://github.com/scribd/datadog_backup)! Find out more about what the
88+
Core Infrastructure team is up to by [reading more of our
89+
posts](https://tech.scribd.com/blog/category/core-infrastructure#posts).
90+
If shipping metrics and managing cloudy things is up your alley, you just might
91+
be the kind of person who'd love to work here, so [click
92+
here](https://www.scribd.com/about/engineering) to review our open positions!

0 commit comments

Comments
 (0)