Create a span-based metric
POST {{baseUrl}}/api/v2/apm/config/metrics
Create a metric based on your ingested spans in your organization. Returns the span-based metric object from the request body when the request is successful.
Request Body
{"data"=>{"id"=>"my.metric", "type"=>"spans_metrics", "attributes"=>{"compute"=>{"aggregation_type"=>"distribution", "include_percentiles"=>false, "path"=>"@duration"}, "filter"=>{"query"=>"@http.status_code:200 service:my-service"}, "group_by"=>[{"path"=>"resource_name", "tag_name"=>"resource_name"}, {"path"=>"resource_name", "tag_name"=>"resource_name"}]}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"data":{"attributes":{"compute":{"aggregation_type":"distribution","include_percentiles":false,"path":"@duration"},"filter":{"query":"@http.status_code:200 service:my-service"},"group_by":[{"path":"resource_name","tag_name":"resource_name"},{"path":"resource_name","tag_name":"resource_name"}]},"id":"my.metric","type":"spans_metrics"}}