1 // Copyright 2018, OpenCensus Authors
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
20 "go.opencensus.io/resource"
23 // Descriptor holds metadata about a metric.
24 type Descriptor struct {
25 Name string // full name of the metric
26 Description string // human-readable description
27 Unit Unit // units for the measure
28 Type Type // type of measure
29 LabelKeys []string // label keys
32 // Metric represents a quantity measured against a resource with different
33 // label value combinations.
35 Descriptor Descriptor // metric descriptor
36 Resource *resource.Resource // resource against which this was measured
37 TimeSeries []*TimeSeries // one time series for each combination of label values
40 // TimeSeries is a sequence of points associated with a combination of label
42 type TimeSeries struct {
43 LabelValues []LabelValue // label values, same order as keys in the metric descriptor
44 Points []Point // points sequence
45 StartTime time.Time // time we started recording this time series