# Injecting dependencies in workflowImpl

**URL:** <https://community.temporal.io/t/injecting-dependencies-in-workflowimpl/3100>\
**Category:** Community Support\
**Tags:** java-sdk, metrics\
**Created:** [October 5, 2021, 9:13pm UTC](https://community.temporal.io/t/injecting-dependencies-in-workflowimpl/3100 "2021-10-05T21:13:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkatre](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nkatre](https://community.temporal.io/u/nkatre)\
**Post date:** [October 5, 2021, 9:13pm UTC](https://community.temporal.io/t/injecting-dependencies-in-workflowimpl/3100/1 "2021-10-05T21:13:18Z")

</div>

Hello,

I have a usecase where I need to report metrics from workflow to dd. I wanted to check if there is a way to inject dependencies in workflowImpl so that these metrics can be reported to dd ?

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [October 5, 2021, 9:16pm UTC](https://community.temporal.io/t/injecting-dependencies-in-workflowimpl/3100/2 "2021-10-05T21:16:52Z")

</div>

Injecting dependencies to workflows is not recommended and supported as it is very error prone due to determinism requirements.

For metrics we recommend using the included integration. See [Workflow.getMetricsScope](https://github.com/temporalio/sdk-java/blob/b9b41e0cabae0208b2d6c8efc0cdc5156b52fdbe/temporal-sdk/src/main/java/io/temporal/workflow/Workflow.java#L1220).
