# Annotation in range

**URL:** <https://community.influxdata.com/t/annotation-in-range/24800>\
**Category:** Grafana\
**Tags:** flux\
**Created:** [April 27, 2022, 6:56am UTC](https://community.influxdata.com/t/annotation-in-range/24800 "2022-04-27T06:56:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![JMU](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JMU](https://community.influxdata.com/u/JMU)\
**Post date:** [April 27, 2022, 6:56am UTC](https://community.influxdata.com/t/annotation-in-range/24800/1 "2022-04-27T06:56:37Z")

</div>

Hi, I’m trying to use the annotations in Grafana. I have managed to show the annotation in a certain timestamp.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/8/88056e11ec459cb03a28b9be53b19be874585fe6.png)

However, I want to know if I can show a annotation in a range to see when the alarm starts and ends.

I hope someone knows if it can be done or not.

Pd: I’m using Flux

Best regards

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [April 27, 2022, 8:39pm UTC](https://community.influxdata.com/t/annotation-in-range/24800/2 "2022-04-27T20:39:06Z")

</div>

Hello @JMU,  
This sounds like more of a grafana question  
Have you tried asking here?

> **[Grafana Labs Community Forums](https://community.grafana.com/)**
>
> Official Grafana Labs community forums. Get technical support for open source Grafana, Loki, and Tempo.

---

<div class="post-metadata">

**Author:** ![JMU](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JMU](https://community.influxdata.com/u/JMU)\
**Post date:** [April 28, 2022, 6:21am UTC](https://community.influxdata.com/t/annotation-in-range/24800/3 "2022-04-28T06:21:43Z")

</div>

Hi Anais,

Yes I tried, but no one is answered me. That is why I have tried in this community because you have solved some problem for me in the past.

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [April 29, 2022, 6:55pm UTC](https://community.influxdata.com/t/annotation-in-range/24800/4 "2022-04-29T18:55:23Z")

</div>

@Jay_Clifford uses grafana more than i maybe he can help? Thank you!!

---

<div class="post-metadata">

**Author:** ![Jay\_Clifford](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jay_clifford/32/8287_2.png) [@Jay\_Clifford](https://community.influxdata.com/u/Jay_Clifford)\
**Post date:** [May 1, 2022, 10:45am UTC](https://community.influxdata.com/t/annotation-in-range/24800/5 "2022-05-01T10:45:18Z")

</div>

Ah! might be a little out of my knowledge range. Will have a play on my end and see if I can figure out something.

---

<div class="post-metadata">

**Author:** ![ypnos](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/ypnos/32/7630_2.png) [@ypnos](https://community.influxdata.com/u/ypnos)\
**Post date:** [May 1, 2022, 8:37pm UTC](https://community.influxdata.com/t/annotation-in-range/24800/6 "2022-05-01T20:37:09Z")

</div>

Yes you can work with ranges if your query provides corresponding output, as you can see in the form you can optionally select a column for “timeEnd” and if you do so, and the time value differs from “time”, you will get a range annotation for each row/event.

To try it out, you could duplicate the \_time column in your query and add a fixed duration to it.

In my scenario, I store two fields “begin” and “end” in the measurement that I use as my annotation source. So I write the timestamps explicitely and “begin” just happens to be the same as “\_time” for convenience in querying. But, you could also use join() to get a single row out of two queries which provide the time for begin, and end, respectively.

---

<div class="post-metadata">

**Author:** ![JMU](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JMU](https://community.influxdata.com/u/JMU)\
**Post date:** [May 2, 2022, 9:36am UTC](https://community.influxdata.com/t/annotation-in-range/24800/7 "2022-05-02T09:36:24Z")

</div>

But how do I get the next rows time column?

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/d/deef0b76b559b41b643a3beac3f7e1b9c637cc63.png)

I would like to add the next \_time column if the value is different. I mean, the first row would have \_time: 2022-02-15T17:25:38 and add a \_time2 column for example with 2022-02-15T17:25:43.

What the query would be like?

---

<div class="post-metadata">

**Author:** ![Juan\_Alonso\_Pla](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/juan_alonso_pla/32/9659_2.png) [@Juan\_Alonso\_Pla](https://community.influxdata.com/u/Juan_Alonso_Pla)\
**Post date:** [May 2, 2022, 11:21am UTC](https://community.influxdata.com/t/annotation-in-range/24800/8 "2022-05-02T11:21:26Z")

</div>

Hey @JMU,

I think that this topic [Find timerange based on the change of a value](https://community.influxdata.com/t/find-timerange-based-on-the-change-of-a-value/16883) solves the problem you are referring to.
