Comments (9)
How do track cron jobs so that I am alerted if they freeze (do not exit or have a really long run time)? Can that be done with DataDog?
from documentation.
You can use the dogwrap command that comes with the python client lib:
dogwrap -n myscript -k $API_KEY --submit_mode errors "/usr/local/bin/myscript.sh arg1 arg2"
This will call the command at the end of the script and send datadog events if it exits with a non-zero exit code. --submit_mode all
will send events on every run.
(To get the python client lib you can install it with easy_install dogapi
)
from documentation.
This is how we currently do it:
psql -c 'some maintenance query' 2>&1
| tee -a /var/log/postgresql/maintenance.log
| /usr/local/bin/dog event post --tags maintenance 'Doing some maintenance'
from documentation.
Is this up to date?
from documentation.
Yeah, that snippet would work. The pertinent part would be the "dog event post" part of the script. Needs some copy to explain the premise. Something like:
Often, you set cron jobs that trigger some meaningful script that you want to monitor and correlate with other metrics. For example, you might have a cron'd script to vacuum a Postgres table every day:
0 0 * * * psql -c 'vacuum verbose my_table' >> /var/log/postgres_vacuums.log 2>&1
Vacuum are particularly resource-intensive though, so you might want Datadog events for each time they run so you can correlate metrics and other events with vacuums. You can do this with the dog
command line tool provided by the dogapi client library:
0 0 * * * psql -c 'vacuum verbose my_table' 2>&1 | tee -a /var/log/postgres_vacuums.log | /usr/local/bin/dog event post --tags maintenance 'Vacuuming my_table'
This will post an event tagged with #maintenance whose title is "Vacuuming my_table" and body has the log of the vacuum.
from documentation.
Another poke, is this still the official way to track cron runs?
from documentation.
This is exactly what I was looking for, thanks!
from documentation.
@clofresh sorry for digging this up. How can I install dogwrap
these days ? Install dogapi
didn't do it.
from documentation.
@c0ze I think dogapi is deprecated. Try pip install datadog
instead. https://github.com/DataDog/datadogpy#installation
from documentation.
Related Issues (20)
- Hugo shortcode
- Smoothing: Broken link to Stanford ASAP algorithm page HOT 1
- Two different names for enabling tracing via environment variable
- Metric advanced filtering: mixing wildcards and variables? HOT 2
- Log monitors - Log samples and breaching values toplist HOT 2
- Log Status Remapper example is incorrect HOT 2
- Documentation points to a gcp reference rather than Azure
- Inaccurate documentation image for funnel filtering
- wrong `metrics` entry in the API Doc? HOT 5
- Missing required java modules HOT 3
- Clarity around JVM metrics with the Open Telemetry collector HOT 3
- RUM: Incorrect documentation HOT 3
- NDM: Missing endpoint configuration listing HOT 3
- Add time series graph to profiler docs
- Document on connecting OpenTelemetry logs and traces for Java/Spring Boot/Logback unclear HOT 4
- DBM related documentation customer feedback
- Trino integration setup instructions are incomplete
- Hi @fodibaj, I'm going to close this PR, as its purpose is not clear. Please use a draft PR for any works in progress, and when you're ready to submit a PR for review, include an explanation of your intentions in the PR description. Thank you! HOT 1
- Documentation on the integration page is outdated HOT 6
- Remove rsyslog obsolete legacy imfile module directive PollingInterval HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.