You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-15 01:04:25 +02:00
Rename otel/label -> otel/attribute (#1541)
* Rename otel/label -> otel/attr Leave the imported name alone, to avoid a large diff and conflicts * Better import comment * Update CHANGELOG.md Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> * otel/attr -> otel/attribute * Missed the changelog entry * Get rid of import renaming * Merge remaining conflicts Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
This commit is contained in:
@ -21,7 +21,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"go.opentelemetry.io/otel/label"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/metric"
|
||||
"go.opentelemetry.io/otel/metric/number"
|
||||
export "go.opentelemetry.io/otel/sdk/export/metric"
|
||||
@ -40,14 +40,14 @@ type (
|
||||
// attributes.
|
||||
mapKey struct {
|
||||
desc *metric.Descriptor
|
||||
labels label.Distinct
|
||||
resource label.Distinct
|
||||
labels attribute.Distinct
|
||||
resource attribute.Distinct
|
||||
}
|
||||
|
||||
// mapValue is value stored in a processor used to produce a
|
||||
// CheckpointSet.
|
||||
mapValue struct {
|
||||
labels *label.Set
|
||||
labels *attribute.Set
|
||||
resource *resource.Resource
|
||||
aggregator export.Aggregator
|
||||
}
|
||||
@ -55,7 +55,7 @@ type (
|
||||
// Output implements export.CheckpointSet.
|
||||
Output struct {
|
||||
m map[mapKey]mapValue
|
||||
labelEncoder label.Encoder
|
||||
labelEncoder attribute.Encoder
|
||||
sync.RWMutex
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ type (
|
||||
//
|
||||
// Where in the example A=1,B=2 is the encoded labels and R=V is the
|
||||
// encoded resource value.
|
||||
func NewProcessor(selector export.AggregatorSelector, encoder label.Encoder) *Processor {
|
||||
func NewProcessor(selector export.AggregatorSelector, encoder attribute.Encoder) *Processor {
|
||||
return &Processor{
|
||||
AggregatorSelector: selector,
|
||||
output: NewOutput(encoder),
|
||||
@ -202,7 +202,7 @@ func (testAggregatorSelector) AggregatorFor(desc *metric.Descriptor, aggPtrs ...
|
||||
// (from an Accumulator) or an expected set of Records (from a
|
||||
// Processor). If testing with an Accumulator, it may be simpler to
|
||||
// use the test Processor in this package.
|
||||
func NewOutput(labelEncoder label.Encoder) *Output {
|
||||
func NewOutput(labelEncoder attribute.Encoder) *Output {
|
||||
return &Output{
|
||||
m: make(map[mapKey]mapValue),
|
||||
labelEncoder: labelEncoder,
|
||||
@ -318,7 +318,7 @@ func (o *Output) AddAccumulation(acc export.Accumulation) error {
|
||||
//
|
||||
// Where in the example A=1,B=2 is the encoded labels and R=V is the
|
||||
// encoded resource value.
|
||||
func NewExporter(selector export.ExportKindSelector, encoder label.Encoder) *Exporter {
|
||||
func NewExporter(selector export.ExportKindSelector, encoder attribute.Encoder) *Exporter {
|
||||
return &Exporter{
|
||||
ExportKindSelector: selector,
|
||||
output: NewOutput(encoder),
|
||||
|
Reference in New Issue
Block a user