# SeriesRef in tsdb Appender

**URL:** https://discuss.prometheus.io/t/seriesref-in-tsdb-appender/884
**Category:** General Help/Support
**Created:** [April 4, 2022, 3:55am UTC](https://discuss.prometheus.io/t/seriesref-in-tsdb-appender/884 "2022-04-04T03:55:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vimalk78](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/vimalk78/32/400_2.png) [@vimalk78](https://discuss.prometheus.io/u/vimalk78)
#### Post date: [April 4, 2022, 3:55am UTC](https://discuss.prometheus.io/t/seriesref-in-tsdb-appender/884/1 "2022-04-04T03:55:31Z")

</div>

Hello,  
I have a query regarding `tsdb` . For a personal study project i am using `tsdb` . I am using `storage.Appender` to add samples into tsdb instance.I am confused about `SeriesRef` . The Appender’s `Append method signature is

```auto
Append(ref SeriesRef, l labels.Labels, t int64, v float64) (SeriesRef, error)

```

Since it needs a `SeriesRef` as an argument, what should be passed in the very first call? Also the recommendation is to use the returned `SeriesRef` in the subsequent calls.So far only thing that worked for me is incrementing the returned SeriesRef before using the same in subsequent calls. I am not sure why this works, but i am able to load data into tsdb.How does a `Counter` or `Gauge` 's name relate to SeriesRef. I want to add two Counters, but i am unable to understand how do i differentiate the two Counters when i am calling `Append` , there is no parameter which can be used as the Name of the Counter.

---

<div class="post-metadata">

### Author: ![roidelapluie](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/roidelapluie/32/6_2.png) [@roidelapluie](https://discuss.prometheus.io/u/roidelapluie)
#### Post date: [April 15, 2022, 11:49am UTC](https://discuss.prometheus.io/t/seriesref-in-tsdb-appender/884/2 "2022-04-15T11:49:09Z")

</div>

SeriesRef must be 0 on the first call. Next calls can use the SeriesRef returned.
