# Metrics implementation using data-prepper and opensearch

**URL:** https://forum.opensearch.org/t/metrics-implementation-using-data-prepper-and-opensearch/12433
**Category:** Data Prepper
**Tags:** troubleshoot, configure, install
**Created:** [February 9, 2023, 9:18am UTC](https://forum.opensearch.org/t/metrics-implementation-using-data-prepper-and-opensearch/12433 "2023-02-09T09:18:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![divnoorsingh](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@divnoorsingh](https://forum.opensearch.org/u/divnoorsingh)
#### Post date: [February 9, 2023, 9:18am UTC](https://forum.opensearch.org/t/metrics-implementation-using-data-prepper-and-opensearch/12433/1 "2023-02-09T09:18:04Z")

</div>

Hi

I am using data-prepper with opensearch sink for trace-analytics pipeline. I’m wondering if it’s possible to configure metrics in same pipeline, if yes what’s the procedure and architecture?  
opensearch cluster: v2.3  
data-prepper: latest docker image  
otel-collector: v0.70.0

Also one more question: like, in other project, i’ve implemented metrics → prometheus → grafana pipeline, i want to migrate to opensearch & opensearch dashboards, what will be the difference in doing so?

---

<div class="post-metadata">

### Author: ![graytaylor0](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@graytaylor0](https://forum.opensearch.org/u/graytaylor0)
#### Post date: [February 13, 2023, 8:29pm UTC](https://forum.opensearch.org/t/metrics-implementation-using-data-prepper-and-opensearch/12433/2 "2023-02-13T20:29:10Z")

</div>

Hi @divnoorsingh,

It is possible to use the same pipeline configuration for both trace analytics and metrics. You can add to your trace analytics pipeline configuration with something like the following

```auto
metricpipeline:
  source:
    otel_metrics_source:
      ssl: false
      port: 21892
  processor:
    - otel_metrics_raw_processor:
  sink:
    - opensearch:
        hosts: ["https://localhost:9200"]
        index: metrics_index
        username: "admin"
        password: "admin"
tracepipeline:
  source:
    otel_trace_source:
      port: 21890
      ssl: false
  ... remaining trace analytics processors and sink like you have configured already

```

Note that the `otel_metrics_source` and the `otel_trace_source` must be running on different ports, and you will just need to point your otel exporters to the correct endpoint and port.

---

<div class="post-metadata">

### Author: ![divnoorsingh](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@divnoorsingh](https://forum.opensearch.org/u/divnoorsingh)
#### Post date: [February 14, 2023, 6:00am UTC](https://forum.opensearch.org/t/metrics-implementation-using-data-prepper-and-opensearch/12433/3 "2023-02-14T06:00:40Z")

</div>

Thanks for the reply. I think, i’m eventually on the right track for implementing the same. But one thing that i’m not sure of is there something like auto-instrumentation for emitting metrics on application side, similar to tracing, coz i don’t want to modify the code of different microservices at this point.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)
#### Post date: [April 15, 2023, 6:00am UTC](https://forum.opensearch.org/t/metrics-implementation-using-data-prepper-and-opensearch/12433/4 "2023-04-15T06:00:56Z")

</div>

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