@ -252,7 +252,7 @@ func (p *OpenMetricsParser) Exemplar(e *exemplar.Exemplar) bool {
// CreatedTimestamp returns the created timestamp for a current Metric if exists or nil.
// NOTE(Maniktherana): Might use additional CPU/mem resources due to deep copy of parser required for peeking given 1.0 OM specification on _created series.
func ( p * OpenMetricsParser ) CreatedTimestamp ( ) * int64 {
if ! T ypeRequiresCT( p . mtype ) {
if ! t ypeRequiresCT( p . mtype ) {
// Not a CT supported metric type, fast path.
return nil
}
@ -302,8 +302,8 @@ func (p *OpenMetricsParser) CreatedTimestamp() *int64 {
}
}
// T ypeRequiresCT returns true if the metric type requires a _created timestamp.
func T ypeRequiresCT( t model . MetricType ) bool {
// t ypeRequiresCT returns true if the metric type requires a _created timestamp.
func t ypeRequiresCT( t model . MetricType ) bool {
switch t {
case model . MetricTypeCounter , model . MetricTypeSummary , model . MetricTypeHistogram :
return true
@ -594,7 +594,7 @@ func (p *OpenMetricsParser) isCreatedSeries() bool {
var newLbs labels . Labels
p . Metric ( & newLbs )
name := newLbs . Get ( model . MetricNameLabel )
if T ypeRequiresCT( p . mtype ) && strings . HasSuffix ( name , "_created" ) {
if t ypeRequiresCT( p . mtype ) && strings . HasSuffix ( name , "_created" ) {
return true
}
return false