Open
Conversation
jonathonmcmurray
previously approved these changes
Aug 8, 2025
Co-authored-by: Jonathon McMurray <jonathon.mcmurray@aquaq.co.uk>
…o big changes). All tests still pass
j-muldoon
reviewed
Nov 13, 2025
j-muldoon
reviewed
Nov 13, 2025
j-muldoon
reviewed
Nov 14, 2025
Co-authored-by: Joseph Muldoon <joseph.muldoon@dataintellect.com>
Co-authored-by: Ben Lord <ben.lord@dataintellect.com>
Example json objects (adapted from datadog docs) have been added in corresponding files. (These will of course be removed eventually and are just for reverse engineering the dictionary formats to go into .j.j)
| opsys:.z.o; | ||
|
|
||
|
|
||
| /eventtitle,eventtext,eventdate,hostname,priority,alerttype,tags,aggregation_key,source_type_name,related_event_id,device,category,cr_name,cr_type,integration_id,message,timestamp,change_metadata,new_value,prev_value |
| if[(first baseurlversion)=`v2;( | ||
| if[(`$category)=`$"alert"; | ||
| json:.j.j(enlist`data)!enlist(`attributes`type!(enlist(`aggregation_key`attributes`category`integration_id`message`tags`timestamp`title!(aggregation_key;enlist(`custom`links`priority`status!(custom;enlist(`category`title`url!(linkcategory;linktitle;linkurl));priority;status));category;integration_id;message;tags;timestamp;title);alerttype)))]; | ||
| / if[(`$category)=`$"change"; |
Member
There was a problem hiding this comment.
don't leave commented out code, if this isn't needed, remove it
| }; | ||
|
|
||
| / the following two functions are used to push data to datadog through https post using .Q.hp | ||
| / the following two functions are used to push data to datadog through https post usSingSS .Q.hp |
Member
There was a problem hiding this comment.
seem to be a few extra Ss in this comment
| metriclog,:(.z.p;.z.h;metric;metricname;`float$metricvalue;0b;response); | ||
| win.sendmetric:{[(pars!args):metfilter] | ||
| leaders:([metricname:"";metricvalue:":";metrictype:"|";samplerate:"|@";tags:"|#"]); | ||
| (metricname;metricvalue):args 0 1; |
Member
There was a problem hiding this comment.
this assumes that metricname & metricvalue are first two keys of dictionary passed in, do we want to enforce that?
Comment on lines
+56
to
+59
| if[useweb;(requiredpars:`metric`points;optionalpars:`interval`tags`type)]; | ||
| if[useweb;( | ||
| if[(first baseurlversion)=`v1;optionalpars,:`host]; | ||
| if[(first baseurlversion)=`v2;optionalpars,:`unit`source_typename`resource_name`resource_type`origin_metric_type`origin_product`origin_service])]; |
Member
There was a problem hiding this comment.
Suggested change
| if[useweb;(requiredpars:`metric`points;optionalpars:`interval`tags`type)]; | |
| if[useweb;( | |
| if[(first baseurlversion)=`v1;optionalpars,:`host]; | |
| if[(first baseurlversion)=`v2;optionalpars,:`unit`source_typename`resource_name`resource_type`origin_metric_type`origin_product`origin_service])]; | |
| if[useweb;requiredpars:`metric`points;optionalpars:`interval`tags`type; | |
| if[(first baseurlversion)=`v1;optionalpars,:`host]; | |
| if[(first baseurlversion)=`v2;optionalpars,:`unit`source_typename`resource_name`resource_type`origin_metric_type`origin_product`origin_service] | |
| ]; |
I think this is the same, with less unnecessary brackets etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on TorQ's datadog.q script
All funcs tested on q 4.1 on homer (Linux)
All funcs tested on q 4.1 locally (Windows 11)