Batch Get Metric Timeseries
GET {{host}}/{{version}}/{{destination_name}}/metrics:batchGet
Timeseries data for a provided list of metric names for a source-destination pair.
If you have multi-instance destinations configured for your source you must send the destination configuration id of the instance you are fetching metric timeseries data for. An example request, Batch Get Summary - Multi Destination Enabled, can be found in the Example requests dropdown. To find the destinationConfigurationId navigate to the destination overview page of the destination which you are querying metrics for in the Segment app. You can retieve the destinationConfigurationId from the URL where it is configured as instances/$destinationConfigurationId/configuration
.
Request Body
{"names"=>["{{destination_name}}/metrics/successes", "{{destination_name}}/metrics/retried_502"]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"event_delivery_metrics":[{"name":"workspaces/myworkspace/sources/js/destinations/google-analytics/metrics/successes","granularity":"DAY","datapoints":[{"value":172615,"timestamp":"2019-01-20T00:00:00Z"},{"value":170609,"timestamp":"2019-01-21T00:00:00Z"},{"value":170668,"timestamp":"2019-01-22T00:00:00Z"},{"value":170422,"timestamp":"2019-01-23T00:00:00Z"}],"start_time":"2019-01-20T00:00:00Z","end_time":"2019-01-23T00:00:00Z"},{"name":"workspaces/myworkspace/sources/js/destinations/google-analytics/metrics/retried_502","granularity":"DAY","datapoints":[{"value":9,"timestamp":"2019-01-20T00:00:00Z"},{"value":8,"timestamp":"2019-01-21T00:00:00Z"},{"value":17,"timestamp":"2019-01-22T00:00:00Z"},{"value":4,"timestamp":"2019-01-23T00:00:00Z"}],"start_time":"2019-01-20T00:00:00Z","end_time":"2019-01-23T00:00:00Z"}]}