# How to display custom metrics of "openTelemetry" by "service.name" ？

**URL:** <https://discuss.elastic.co/t/how-to-display-custom-metrics-of-opentelemetry-by-service-name/279824>\
**Category:** APM\
**Tags:** go, server\
**Created:** [July 28, 2021, 8:29am UTC](https://discuss.elastic.co/t/how-to-display-custom-metrics-of-opentelemetry-by-service-name/279824 "2021-07-28T08:29:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tttoad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tttoad/32/91162_2.png) [@tttoad](https://discuss.elastic.co/u/tttoad)\
**Post date:** [July 28, 2021, 8:29am UTC](https://discuss.elastic.co/t/how-to-display-custom-metrics-of-opentelemetry-by-service-name/279824/1 "2021-07-28T08:29:25Z")

</div>

I have reported some custom metrics through "openTeletemtry". I would like to be able to customize the data charts in the "metrics" module within "APM".Or is there another way to generate different graphs by different "service.name"?  
I see "go pprof" data when I use "[go.elastic.co/apm](http://go.elastic.co/apm)" to report data, which module in "APM" can I see this information?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [July 29, 2021, 3:26am UTC](https://discuss.elastic.co/t/how-to-display-custom-metrics-of-opentelemetry-by-service-name/279824/2 "2021-07-29T03:26:04Z")

</div>

> I have reported some custom metrics through "openTeletemtry". I would like to be able to customize the data charts in the "metrics" module within "APM".Or is there another way to generate different graphs by different "service.name"?

You cannot currently customise the Metrics panel. You can use Lens instead. I'll demonstrate how you can do that.

Say for example your application reports a metric called `ex.com.one`, like in the opentelemetry-go getting started guide: [Getting Started | OpenTelemetry](https://opentelemetry.io/docs/go/getting-started/#creating-metric-instruments). These metrics will be written to indices matching the pattern `apm-*-metric-*`, and will look something like this:

```json
{
  "_index": "apm-8.0.0-metric-000001",
  "_id": "I_VB8HoBV8NbQ8CgPGVv",
  "_score": 1,
  "_source": {
    "agent": {
      "name": "opentelemetry/go",
      "version": "1.0.0-RC1"
    },
    "processor": {
      "name": "metric",
      "event": "metric"
    },
    "metricset.name": "app",
    "observer": {
      "hostname": "goat",
      "id": "152d9100-2793-4c91-8de2-6314be9e1783",
      "ephemeral_id": "1d233a8e-fbb4-4bac-a2b3-9abd45aae8a5",
      "type": "apm-server",
      "version": "8.0.0",
      "version_major": 8
    },
    "@timestamp": "2021-07-29T03:14:04.030Z",
    "ex.com.one": 1,
    "ecs": {
      "version": "1.10.0"
    },
    "service": {
      "name": "unknown_service_otel-collector",
      "language": {
        "name": "go"
      }
    },
    "event": {
      "ingested": "2021-07-29T03:14:05.038237154Z"
    }
  }
}

```

You can find these documents in Discover in Kibana, and find the metric field you are interested in visualising:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/b/2b9d7b3f318d3f30fb95ce9bb01fd4d584783158.png)

When you click Visualize, you will be taken to the Lens app. You can then set "Break down by" to the `service.name` field:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/b/1b47996b3420c2a8d3fdc42a193d6dea404361a4.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/f/ff451eda5f0f30fccbc191a36d5c3a55e500bbb4.png)

> I see "go pprof" data when I use "[go.elastic.co/apm](http://go.elastic.co/apm)" to report data, which module in "APM" can I see this information?

The APM UI does not currently support visualising pprof data.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 18, 2021, 11:26pm UTC](https://discuss.elastic.co/t/how-to-display-custom-metrics-of-opentelemetry-by-service-name/279824/3 "2021-08-18T23:26:54Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
