SeriesRef in tsdb Appender

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

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.

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