(metricType agentproto.Stats_Metric_Type)
| 531 | } |
| 532 | |
| 533 | func asPrometheusValueType(metricType agentproto.Stats_Metric_Type) (prometheus.ValueType, error) { |
| 534 | switch metricType { |
| 535 | case agentproto.Stats_Metric_GAUGE: |
| 536 | return prometheus.GaugeValue, nil |
| 537 | case agentproto.Stats_Metric_COUNTER: |
| 538 | return prometheus.CounterValue, nil |
| 539 | default: |
| 540 | return -1, xerrors.Errorf("unsupported value type: %s", metricType) |
| 541 | } |
| 542 | } |