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"=>"<string>", "type"=>"spans_metrics", "attributes"=>{"compute"=>{"aggregation_type"=>"count", "include_percentiles"=>"<boolean>", "path"=>"<string>"}, "filter"=>{"query"=>"*"}, "group_by"=>[{"path"=>"<string>", "tag_name"=>"<string>"}, {"path"=>"<string>", "tag_name"=>"<string>"}]}}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;data&quot;:{&quot;attributes&quot;:{&quot;compute&quot;:{&quot;aggregation_type&quot;:&quot;distribution&quot;,&quot;include_percentiles&quot;:&quot;\u003cboolean\u003e&quot;,&quot;path&quot;:&quot;\u003cstring\u003e&quot;},&quot;filter&quot;:{&quot;query&quot;:&quot;\u003cstring\u003e&quot;},&quot;group_by&quot;:[{&quot;path&quot;:&quot;\u003cstring\u003e&quot;,&quot;tag_name&quot;:&quot;\u003cstring\u003e&quot;},{&quot;path&quot;:&quot;\u003cstring\u003e&quot;,&quot;tag_name&quot;:&quot;\u003cstring\u003e&quot;}]},&quot;id&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;spans_metrics&quot;}}