1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-12 10:04:29 +02:00
opentelemetry-go/exporters/otlp
Krzesimir Nowak a01f63bec4
Replace Ordered with an iterator in export.Labels. (#567)
* Do not expose a slice of labels in export.Record

This is really an inconvenient implementation detail leak - we may
want to store labels in a different way. Replace it with an iterator -
it does not force us to use slice of key values as a storage in the
long run.

* Add Len to LabelIterator

It may come in handy in several situations, where we don't have access
to export.Labels object, but only to the label iterator.

* Use reflect value label iterator for the fixed labels

* add reset operation to iterator

Makes my life easier when writing a benchmark. Might also be an
alternative to cloning the iterator.

* Add benchmarks for iterators

* Add import comment

* Add clone operation to label iterator

* Move iterator tests to a separate package

* Add tests for cloning iterators

* Pass label iterator to export labels

* Use non-addressable array reflect values

By not using the value created by `reflect.New()`, but rather by
`reflect.ValueOf()`, we get a non-addressable array in the value,
which does not infer an allocation cost when getting an element from
the array.

* Drop zero iterator

This can be substituted by a reflect value iterator that goes over a
value with a zero-sized array.

* Add a simple iterator that implements label iterator

In the long run this will completely replace the LabelIterator
interface.

* Replace reflect value iterator with simple iterator

* Pass label storage to new export labels, not label iterator

* Drop label iterator interface, rename storage iterator to label iterator

* Drop clone operation from iterator

It's a leftover from interface times and now it's pointless - the
iterator is a simple struct, so cloning it is a simple copy.

* Drop Reset from label iterator

The sole existence of Reset was actually for benchmarking convenience.
Now we can just copy the iterator cheaply, so a need for Reset is no
more.

* Drop noop iterator tests

* Move back iterator tests to export package

* Eagerly get the reflect value of ordered labels

So we won't get into problems when several goroutines want to iterate
the same labels at the same time. Not sure if this would be a big
deal, since every goroutine would compute the same reflect.Value, but
concurrent write to the same memory is bad anyway. And it doesn't cost
us any extra allocations anyway.

* Replace NewSliceLabelIterator() with a method of LabelSlice

* Add some documentation

* Documentation fixes
2020-03-19 15:01:34 -07:00
..
internal/transform Replace Ordered with an iterator in export.Labels. (#567) 2020-03-19 15:01:34 -07:00
alignment_test.go opentelemetry collector trace exporter (#497) 2020-03-06 22:01:02 -08:00
connection.go opentelemetry collector trace exporter (#497) 2020-03-06 22:01:02 -08:00
doc.go opentelemetry collector trace exporter (#497) 2020-03-06 22:01:02 -08:00
example_test.go add shorter version for global providers (#538) 2020-03-11 08:23:32 -07:00
go.mod Update OTLP exporter with latest proto (#550) 2020-03-16 16:43:54 -07:00
go.sum Update OTLP exporter with latest proto (#550) 2020-03-16 16:43:54 -07:00
mock_collector_test.go add resource option to Provider. (#545) 2020-03-13 13:07:36 -07:00
options.go Add metrics support to the OTLP exporter (#544) 2020-03-13 11:42:20 -07:00
otlp_test.go Refactor the SDK helpers, create MeterImpl (#560) 2020-03-19 12:02:46 -07:00
otlp.go Replace ErrNoLastValue and ErrEmptyDataSet by ErrNoData (#557) 2020-03-16 16:28:33 -07:00
README.md opentelemetry collector trace exporter (#497) 2020-03-06 22:01:02 -08:00
transform_spans_test.go add resource option to Provider. (#545) 2020-03-13 13:07:36 -07:00
transform_spans.go add resource option to Provider. (#545) 2020-03-13 13:07:36 -07:00

OpenTelemetry Collector Go Exporter

![GoDoc][godoc-image]

This exporter converts OpenTelemetry SpanData to OpenTelemetry Protocol Span and exports them to OpenTelemetry Collector.

Installation

$ go get -u go.opentelemetry.io/otel/exporters/otlp