# Opentelemetry:  setting span time?

**URL:** <https://community.dynatrace.com/t/opentelemetry-setting-span-time/34725>\
**Category:** OpenTelemetry\
**Tags:** opentelemetry\
**Created:** [April 5, 2022, 2:25pm UTC](https://community.dynatrace.com/t/opentelemetry-setting-span-time/34725 "2022-04-05T14:25:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://community.dynatrace.com/u/danielbr)\
**Post date:** [April 5, 2022, 2:25pm UTC](https://community.dynatrace.com/t/opentelemetry-setting-span-time/34725/1 "2022-04-05T14:25:05Z")

</div>

Hi,

I’m&nbsp; able to capture spans with Oneagent.  
However,&nbsp; in my app I try to set a defined time for the spans:

Span span1 = spanbuilder1.setStartTimestamp(timestamp1.getTime(),TimeUnit.MILLISECONDS).startSpan();  
span1.end(endtimestamp1.getTime(), TimeUnit.MILLISECONDS);

However, on the PP I see the recorded times.  
Am i doing something wrong or is this feature not yet available ?

Daniel

 ![danielbr_0-1649168642840.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/591e72448869caef7adcf165abfcea68b110b80e.png)

---

<div class="post-metadata">

**Author:** ![harald\_berger](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/harald_berger/32/31754_2.png) [@harald\_berger](https://community.dynatrace.com/u/harald_berger)\
**Post date:** [April 6, 2022, 8:56am UTC](https://community.dynatrace.com/t/opentelemetry-setting-span-time/34725/2 "2022-04-06T08:56:10Z")

</div>

Hi&nbsp;Daniel,

Actually custom timestamps are not supported, but support for this is on the roadmap.

Best

Harry

---

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://community.dynatrace.com/u/danielbr)\
**Post date:** [April 7, 2022, 8:35am UTC](https://community.dynatrace.com/t/opentelemetry-setting-span-time/34725/3 "2022-04-07T08:35:41Z")

</div>

Hi Harry,  
Really appreciate your answer, I’ve been busting my head over this!

May I ask - is this true for both Oneagent and the Trace Ingest API?

Daniel

Daniel

---

<div class="post-metadata">

**Author:** ![Christoph\_Neum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christoph_neum/32/21662_2.png) [@Christoph\_Neum](https://community.dynatrace.com/u/Christoph_Neum)\
**Post date:** [April 7, 2022, 8:59am UTC](https://community.dynatrace.com/t/opentelemetry-setting-span-time/34725/4 "2022-04-07T08:59:59Z")

</div>

This limitation only applies to OneAgent/OpenTel integration at the moment.

For Trace Ingest, custom timestamps are supported (assuming the the used OpenTelemetry SDK supports it, which is usually the case).

---

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://community.dynatrace.com/u/danielbr)\
**Post date:** [April 7, 2022, 9:02am UTC](https://community.dynatrace.com/t/opentelemetry-setting-span-time/34725/5 "2022-04-07T09:02:09Z")

</div>

Hi,

Alright,&nbsp; thank you !

Daniel
