Comments (4)
Thanks a lot for the detailed explanations @gnarf !
I like the idea of making the 'trim' strategy configurable. I reckon 'head' should probably be the default behavior.
We'll work on it for the next version 🚀
from datadogpy.
Considering the errors are USUALLY at the bottom when there are errors, I
like the one that mixes a bit of head and a bit of tail best
On Mon, Oct 19, 2015 at 6:55 PM, Yann [email protected] wrote:
Thanks a lot for the detailed explanations @gnarf
https://github.com/gnarf !I like the idea of making the 'trim' strategy configurable. I reckon
'head' should probably be the default behavior.We'll work on it for the next version [image: 🚀]
—
Reply to this email directly or view it on GitHub
#91 (comment).
from datadogpy.
You make a point, the third option sounds more reasonable.
Thanks again @gnarf.
from datadogpy.
This code is like really quick and dirty, but this is what I implemented in my own node.js script (if it helps at all)
Note: output
contains stderr + stdout
module.exports = function(err, event) {
var text = "%%%\nExit Code: " + event.exit + " Time: " + (event.time/1000).toFixed(3) + "s\n";
var payload_text_limit = 4000;
if (event.output.length > (payload_text_limit - text.length - 100) ) {
text += 'Start:\n```\n';
var lines = event.output.split('\n');
while (text.length < (payload_text_limit / 3)) {
text += lines.shift() + '\n';
}
text += '```\n';
text += '...trimmed...\n';
text += '```\n';
var ending = '```\n';
while ((ending.length + text.length + lines[lines.length-1].length + 1) < payload_text_limit) {
ending = lines.pop() + '\n' + ending;
}
text += ending;
} else {
text += 'Output:\n```\n' + event.output + '\n```\n';
}
var properties = {
tags: [ '#deploy:' + event.eventData.owner + '/' + event.eventData.repo, '#env:{{ deploy_env }}' ],
host: os.hostname(),
alert_type: event.exit ? 'error' : 'success',
date_happened: event.start,
source_type_name: 'deploy',
};
dogapi.event.create("[" + os.hostname() + "] deploy " + event.filename, text, properties);
};
I'm not proud of the readability or methods this thing uses, but hey - it works ;)
from datadogpy.
Related Issues (20)
- Mock statsd during tests
- 'DogStatsd' object has no attribute 'guage' HOT 1
- DowntimesApi: canceled downtime still visible in response of list_downtimes() HOT 5
- Disable info log around https://api.datadoghq.com/api/v1/series HOT 2
- AWSIntegration response obj missing aws account id HOT 1
- Upgrading to DD 0.45.0 breaks StatsD metrics HOT 9
- Disable EC2/EKS tags from statsd custom metric ingestion HOT 1
- Add support for timing functions using histograms like the timed and distributed decorators HOT 1
- dogshell and dogwrap dont support ddgov and ap1 sites HOT 1
- Sending an event adds tags from agent config HOT 1
- Allow disabling statsd export via constructor arg HOT 1
- Support IPv6 hostnames in `dogstatsd` HOT 1
- dog event post does not type --related_event_id properly HOT 1
- Changing Statsd to UDS does not reset telemetry labels / max payload size HOT 2
- bytes_dropped is no longer available on DogStatsD client HOT 1
- Type statsd.timed HOT 4
- urllib3 2.0+ breaks tests? HOT 2
- dogwrap with StatsD instead of API HOT 1
- Support the standard DD_DOGSTATSD_URL environment variable HOT 4
- Report traceback error for http_client errors 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 datadogpy.