zorkian / go-datadog-api

A Go implementation of the Datadog API.
BSD 3-Clause "New" or "Revised" License
183 stars 156 forks source link

ServiceLevelObjectiveHistory generates error during unmarshalling #316

Open Atilla-Bilgic opened 4 years ago

Atilla-Bilgic commented 4 years ago

Many thanks for your effort to build this flawless component. I hope this contribution may help to improve.

The struct definition for .data.series.denominator.metadata.unit needs to be replaced by an interface or another struct definition. Sample data returned from Datadog through their API that crashes the component can be seen below. **** Sample Data **** "metadata": { "unit": [ { "family": "network", "scale_factor": 1.0, "name": "request", "short_name": "req", "plural": "requests", "id": 19 }, null ], ...} ** End of Sample