go-datadog-api icon indicating copy to clipboard operation
go-datadog-api copied to clipboard

Adding unaggregated parameter to events.GetEvents

Open EricByers opened this issue 6 years ago • 1 comments

This PR adds support for unaggregated parameter for query events.

See: https://docs.datadoghq.com/api/?lang=python#query-the-event-stream

~~This change is not backwards compatible as it changes the function signature. This function could potentially be rewritten to a variadiac to keep it backwards compatible if needed.~~

Made the new parameter variadic, if more parameters are needed, there would need to be a breaking change (new param or switch to struct), or all the parameters would need to move to be variadic.

EricByers avatar Jan 11 '19 16:01 EricByers

@EricByers hey :wave: thanks for sending the PR. I'd much rather have a new method, e.g. GetEventsWithAggregation(start, end int, priority, sources, tags string, unaggregated bool) and keep the old function intact. I do understand that the variadic argument helps here, but I don't think that this solution scales well with potential new arguments.

The old GetEvents function could then just be a proxy to the new one, calling it with unaggregated=false. WDYT?

bkabrda avatar Feb 03 '20 09:02 bkabrda