exemplar.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2018, OpenCensus Authors
  2. //
  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
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  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.
  14. package metricdata
  15. import (
  16. "time"
  17. )
  18. // Exemplars keys.
  19. const (
  20. AttachmentKeySpanContext = "SpanContext"
  21. )
  22. // Exemplar is an example data point associated with each bucket of a
  23. // distribution type aggregation.
  24. //
  25. // Their purpose is to provide an example of the kind of thing
  26. // (request, RPC, trace span, etc.) that resulted in that measurement.
  27. type Exemplar struct {
  28. Value float64 // the value that was recorded
  29. Timestamp time.Time // the time the value was recorded
  30. Attachments Attachments // attachments (if any)
  31. }
  32. // Attachments is a map of extra values associated with a recorded data point.
  33. type Attachments map[string]interface{}