Commit Graph

51 Commits

Author SHA1 Message Date
Nathan Dias aa450a0bf2
all: remove OtlpProtoSize in favor of Sizer interface (#3818)
* all: remove OtlpProtoSize in favor of Sizer interface

* add {Metrics|Traces|Logs}Sizer, fix test commenting

* move size tests to pb_test, fix metrics+logs parameter names

* uncommented batch_processor tests + adjusted them to use *Sizer

* I forgot BenchmarkTraceSizeBytes :(

* Add docs for NewProtobof*Sizer + update docs for NewProtobuf*Marshaler

* cast *Marshaler to *Sizer for now

* add casts to batch_processor_test
2021-08-17 11:10:33 -07:00
alrex e08485709e
convert incoming labels to attributes (#3805)
- don't modify labels, only add attributes
- dont do anything if both labels and attributes are present
2021-08-16 11:38:34 -07:00
alrex 7f8f3211a5
move AttributeValueToString and AttributeMapToMap to pdata (#3820)
Moving AttributeValueToString and AttributeMapToMap from `tracetranslator` to `pdata` for common use across signals. The original functions were left as wrappers to their `pdata` counterparts and marked as deprecated.

**Link to tracking Issue:** First part of https://github.com/open-telemetry/opentelemetry-collector/issues/3815

**Testing:** Moved existing tests to common_test
2021-08-13 12:21:45 +04:00
alrex 3a69fa61ef
adding Attributes to NumberDataPoint, HistogramDataPoint, SummaryDataPoint (#3761) 2021-08-06 17:04:49 -07:00
alrex 28888dae32
adding SchemaUrl field (#3759) 2021-08-06 11:02:21 -07:00
alrex 3cfe4f8c5d
adding support for Bytes attribute type (#3756)
* adding support for Bytes attribute type

* adding warning comment

* update comments

* update comments
2021-08-04 12:15:44 -07:00
alrex 9808622f70
update OTLP proto to v0.9.0 (#3740)
* update proto to 0.9.0

* make genproto, note the sed patch needed an update to support both deprecated and nullable

* add comment in sed patch
2021-08-03 12:14:55 -07:00
alrex b51b9f298a
fix minor typo in documentation (#3755) 2021-08-02 11:07:35 -07:00
alrex 6b4a70b84e
remove IntDataPoint from pdata (#3735)
* remove IntDataPoint from pdata

* remove unused var
2021-08-02 10:50:15 -07:00
alrex 5929f4fd5c
Remove IntGauge/IntSum (#3731)
Follow up to https://github.com/open-telemetry/opentelemetry-collector/pull/3730, removing `IntGauge` and `IntSum`.

**Link to tracking Issue:** Part of #3534 

Will rebase once #3730 is merged.
2021-07-30 07:23:38 +04:00
alrex f804c9c443
remove SetValue/Value func for NumberDataPoint/Exemplar (#3730) 2021-07-28 10:47:28 -07:00
Bogdan Drutu 88b2935343
Convert temporality and monotonicity for deprecated sums (#3729)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-27 11:51:45 -07:00
Bogdan Drutu 3256c9808d
Remove last usages of Int[Gauge|Sum] from tests (#3724)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-27 10:05:45 -07:00
Bogdan Drutu 2b8047ec8d
Remove usage of deprecated IntSum/IntGauge in pdata tests (#3720)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-26 17:54:07 -07:00
alrex 3893e951b7
remove IntExemplar and IntExemplarSlice (#3705) 2021-07-26 12:30:06 -07:00
alrex e13fe3d9f1
mark IntGauge/IntSum/IntDataPoint as deprecated (#3707) 2021-07-25 09:04:53 -07:00
alrex 4af2bdd3e2
rename NumberDataPointType to MetricValueType (#3700) 2021-07-22 18:01:02 -07:00
alrex 638c96cbbe
update Exemplar to use oneOfPrimitiveValue (#3699) 2021-07-22 15:29:52 -07:00
alrex 1ede290c00
update NumberDataPoint to support DoubleVal and IntVal (#3689) 2021-07-22 14:02:35 -07:00
Jacob Marble 681453691a
pdata: add [Type]Slice.Sort(func) to sort slices (#3671)
* pdata: add TypeSlice.Sort(func) to sort slices

Comparing two generated slices can be tedious when the slices are not
ordered, and order does not matter for the test.

This change adds a .Sort(func(i, j int) bool) method to generated [Type]Slice. This is
similar to method StringMap.Sort(), but takes a less function because
the order may differ by context, where the sort order of a map is obvious (by key).

* fix: improve TypeSlice.Sort(less) signature

* fix: resolve goimports CI check

* chore: make genpdata
2021-07-22 08:16:55 -07:00
Blake Roberts 6cce4224c6
fix bool attribute equality (#3688) 2021-07-21 14:48:06 -07:00
alrex f46871afda
remove IntHistogram (#3676)
* remove IntHistogram

* fix test

* rename histogram in golden dataset
2021-07-20 14:58:59 -07:00
Anthony Mirabella 78a6becd45
Remove deprecated pdata slice resize API (#3675)
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-07-20 10:17:57 -07:00
alrex c6f9f29fca
Rename DoubleDataPoint to NumberDataPoint (#3633) 2021-07-15 19:02:36 -07:00
alrex 22496b70ae
translate IntSum to Sum in otlp_wrappers (#3621)
* translate IntSum to Sum in otlp_wrappers

* fix tests
2021-07-15 18:02:25 -07:00
alrex ed5efb7a6b
fix DoubleExemplar mention in sed file (#3632)
This changes the slice of pointers into a slice of values, regenerated
pdata accordingly.
2021-07-15 13:16:28 -07:00
Bogdan Drutu bcf0c20429
Fix tests in pdata after changes in metrics compatibility (#3631)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-15 10:43:51 -07:00
Bogdan Drutu 16264bb721
Consolidate where compatibility changes are executed (#3623)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-14 12:59:03 -07:00
Punya Biswal 856de274a3
Doc improvements (#3611)
* Doc improvements

* function -> func to match Go syntax
* clarify that AttributeValue is actually a mutable cell

* Range() code examples shouldn't have a return value

* Fix return type in doc
2021-07-14 12:58:25 -07:00
alrex 20695b1edc
translate IntGauge to Gauge in otlp_wrappers (#3619) 2021-07-14 12:54:39 -07:00
alrex 7e7ee8fb3a
translate IntHistogram to Histogram in otlp_wrappers (#3613) 2021-07-14 11:39:52 -07:00
Punya Biswal 071268f981
Implement Equal() for map-valued AttributeValues (#3612)
* Implement Equal() for map-valued AttributeValues

Resolves a TODO in the implementation

* Make lint happier
2021-07-14 11:39:37 -07:00
Anthony Mirabella 9e8bded5b4
Deprecate Resize() from pdata slice APIs (#3573)
* Remove Resize() from pointer slice API

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* model/pdata: refactor value slice interfaces

* Removed Resize()
* Added EnsureCapacity() and AppendEmptyN()

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* -Fix function signature in cpu_scraper_linux.go

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Fix remaining Resize() calls

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Fix OS-specific processes scraper

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Remove tests for equality of value slices that aren't comparable

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Remove AppendEmptyN from pdata slice APIs

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* batchprocessor: improve splitMetric() to avoid copying entire metric unless necessary

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* model/pdata: restore Resize() for slice types, mark as deprecated

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update metrics_test.go

* Update metrics_test.go

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Bogdan Drutu <lazy@splunk.com>
2021-07-12 19:01:24 -07:00
alrex f9dacb8402
rename DoubleGauge -> Gauge (#3599) 2021-07-12 16:59:08 -07:00
alrex aa60edff16
rename DoubleSum -> Sum (#3583)
* rename DoubleSum -> Sum

* update changelog

* revert pict changes
2021-07-12 15:21:51 -07:00
José Carlos Chávez 29f7673de6
docs: fixes AttributeMap.Range docs. (#3586) 2021-07-09 14:39:42 -07:00
alrex 642a8e0c97
update OTLP to v0.8.0 (#3572)
* update proto to v0.8.0

* regenerate protos using 0.8.0

* update uses of DoubleGauge, DoubleSum, DoubleHistogram, DoubleSummary, DoubleDataPoint, DoubleHistogramDataPoint, DoubleSummaryDataPoint, DoubleExemplar

* update ExemplarSlice to use []*otlpmetrics.Exemplar

* suppress deprecation warnings for metrics

* update pdatagen generator code to support AsDouble fields

* run make genpdata
2021-07-08 10:34:40 -07:00
Bogdan Drutu d1fced9688
Refactor MetricAndDataPointCount to DataPointCount (#3547)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-01 13:43:31 -07:00
Bogdan Drutu b2ca27e00d
Create an go.opentelemetry.io/collector/model as a separate module (#3530)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-30 08:26:47 -07:00
Bogdan Drutu 14d917479e
Move internal/data to model so cannot be accessed outside of model (#3529)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-29 17:35:19 -07:00
Bogdan Drutu a16c84ba83
Remove deprecated Append func from generated slices (#3522)
* Remove usage of deprecated append in translator/jaeger

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Remove deprecated Append func from generated slices

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-29 14:47:51 -07:00
Bogdan Drutu cfe32ae8fa
Remove usage of deprecated append in pdata/common_test (#3519)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-29 09:26:10 -07:00
Bogdan Drutu 719469e26d
Remove usage of internal/data in OpenCensus translator (#3516)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-29 08:02:33 -07:00
Bogdan Drutu 061d61d17f
Remove to from proto in pdata, can use OTLP marshaler/unmarshaler (#3515)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-29 06:47:58 -07:00
Bogdan Drutu 3acff6cea5
Move internal data wrappers to model/internal (#3514)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-29 06:46:01 -07:00
Bogdan Drutu 6986310ab4
Move opentelemetry-proto submodule to model/internal (#3510)
* Removed submodule internal/data/opentelemetry-proto

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Move opentelemetry-proto submodule to model/internal

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-28 17:02:22 -07:00
Bogdan Drutu 4b05de18c2
Move internal/otlp to model/otlp (#3508)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-28 16:02:31 -07:00
Bogdan Drutu 75ebb88e22
Move internal/pdatagrpc to model/otlpgrpc (#3507)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-28 14:59:02 -07:00
Bogdan Drutu 9ee7e2d9f1
Remove unnecessary interfaces from pdata (#3506)
Based on the current experience, they are not necessary.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-28 14:15:09 -07:00
Bogdan Drutu 6cafee91d2
Change Marshaler/Unmarshaler to be consistent with other interfaces (#3502)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-28 09:48:29 -07:00