Hello experts,
My team are trying to reach a solution to the following need that’s comprised of two parts:
- We are looking for a way to group a subset of External/ metrics for the purposes of having them shown as a single data source in dashboards.
For example, we have metrics
External/service-1.com/all
External/service-2.com/all
External/service-3a.com/all
External/sevice-3b.com/all
and we wish to create a dashboard showing the average duration of calls to service-1 and service-2 separately, but group service-3a and service-3b under ‘service-3’.
- We also wish to have a programmatical way to select which services should be grouped, as the list would be large and variable dependent on deployments and also through time. Having to update queries manually is not a sustainable option.
An idea was to leverage custom attributes for this. I.e. identify places in code where the external hosts being called should be grouped, and then use
NewRelic.Api.Agent.NewRelic.GetAgent().CurrentTransaction.AddCustomAttribute({my_service-3_tag}, {external_host})
to ‘mark’ those respective hosts for grouping.
I have been playing around with NRQL queries to try to produce a dashboard based on the data from both Metric and Transaction that would have
service-1
service-2
service-3
on its X axis, and average(newrelic.timeslice.value) on Y. However, I am not very successful at getting the custom attributes data to be used properly. Hoping for some help on that / guidance if there are other ways or this is just not possible at this time.