Commit Graph

22 Commits

Author SHA1 Message Date
Bogdan Drutu f57f3bae32
Update more links after master->main change (#2419)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-28 14:45:15 -05:00
Andrei Ozerov 953bf83392
Rename opentelemetry-proto-gen package to protogen (#2344)
Remove hyphens sice the idiomatic style is to not have word delimiters
at all, or have `_` as an exception.

Remove `opentelemetry-` prefix since the package is within otlp already and
there a no types in that package directly i.e. alias is not a problem.
2021-01-08 08:33:59 -08:00
Bogdan Drutu eccb1d7e66
Remove deadcode in pdatagen, remove InitEmpty funcs (#2246)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 09:34:23 -05:00
Bogdan Drutu 38c7aa352b
Convert status to not be a pointer in the Span (#2242)
* Convert status to not be a pointer in the Span

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

* Fix lint errors

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-03 13:59:47 -05:00
Bogdan Drutu f4f68db25d
Expose non-nullable elements from slices of pointers (#2200)
Currently for slices of pointers, pdata exposes elements that are pointers to the pointer in the slice (double pointers in the internal implementation). Because of this users have to deal with possible nil values, have to initialize elements (in some cases) etc, but in reality the elements in the slice cannot be nil, so this just adds extra unnecessary complexity. This is possible because:

* Gogo proto (and protobuf) will not unmarshal any nil element in a slice;
* Our APIs to add elements/remove elements from the slice will guarantee that we never have a nil element in the slice between [0, len-1];

This is an important change because will allow us to change the internal representation (use slice of pointers or non-pointers) without affecting the public API.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-01 10:50:19 -08:00
Bogdan Drutu 60498105d4
Change InstrumentationLibrary to be non-nullable (#2196)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-25 09:16:18 -08:00
Bogdan Drutu 9fbd1002f3
Move trace/span ids out of the proto-gen directory. Inlcude codecov, static checks (#2199)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-23 09:58:53 -08:00
Bogdan Drutu b08c6943bc
Optimize copyto/resize to keep capacity (#2064)
Optimizations:
* For `CopyTo` ensures that if spaces enough in the slice (check for capacity not for length) a new slice is not allocated.
* For `Resize` if not enough capacity, allocate the right slice from the beginning instead of keep calling append which may do more allocations.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-11 09:12:53 -08:00
Bogdan Drutu c6b8f28c60
Add ability to generate non nullable messages, convert Resource to test the change (#2005)
* Add ability to generate non nullable messages, convert Resource to test the change

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

* Remove lint errors

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

* Fix more lint errors

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

* Remove unused funcs and vars

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

* Remove IsNil from value structs, update accessor message

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-06 10:36:57 -08:00
Bogdan Drutu b4835bef9b
Simplify MoveAndAppendTo logic in generated slices (#2066)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-05 06:47:07 -08:00
Tigran Najaryan de104da4f1
Update OTLP to 0.6.0 and use the new Span Status code (#2031)
Contributes to https://github.com/open-telemetry/opentelemetry-collector/issues/1841

- Implemented the backward compatibility logic for sending and receiving
  side for DeprecatedCode and Code fields according to OTLP spec.

- Had to modify pdata generator to allow generating fields without setters.
  This is needed because the Status code field needs a custom setter logic
  that implements the DeprecatedCode vs Code handling.

- Added tests that verify OTLP receiver behavior for Status Code/DeprecatedCode.

- Added tests that verify sending/setting behavior for Status Code/DeprecatedCode
  for any component that uses pdata.Traces Status.SetCode().

- Modified all non-OTLP trace receivers and exporters (Jaeger, Zipkin, OpenCensus) to use
  the new Status code.

- Modified correctness tests to use the new status Code instead of DeprecatedCode.
2020-11-03 17:28:43 -05:00
Tigran Najaryan 035aa5cf6c
Use new SpanID data type in OTLP Protobuf message (#1856)
This enables usage of SpanID data type. Now span id is hex encoded
as it is required by OTLP specification.

Contributes to: https://github.com/open-telemetry/opentelemetry-collector/issues/1177
2020-10-01 17:30:35 -04:00
Tigran Najaryan 75b1ac14fb
Use custom data type and custom JSON serialization for traceid (#1840)
Contributes to https://github.com/open-telemetry/opentelemetry-collector/issues/1177

1. The TraceID type uses custom data type so that JSON serialization
is in hex format instead of base64 (which is the default Protobuf JSON
format). Hex format is required by OTLP spec:
https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/protocol/otlp.md#request
SpanID must be also modified similarly. Will be done in a future PR
to avoid creating a huge PR.

2. Moved pdata.TraceID to its own file. Note that there is pdata.TraceID which
is different from otlp TraceID custom data type. Due to the way packages are
structured we need both to keep OTLP generated data types decoupled from pdata
data types.

The majority of the changes in this commit are simply type changes from
[]byte to TraceID.
2020-09-24 10:13:42 -04:00
Bogdan Drutu 96643c6852
Fix slice Append to accept by value the element in pdata (#1784)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-15 09:18:05 -07:00
Ben Keith 55b6458538
Add Append to Generated pdata Structs (#1157)
This makes it a bit more convenient to assemble data structures.

It is also congruent with the existing Go slice functionality with
the same name.
2020-06-30 11:50:05 -07:00
Tigran Najaryan ffd2a1eb98
Generate OTLP Go code in this repositorry (#1037)
* Generate OTLP Go code in this repo

Generate ProtoBufs in this repository instead of importing from opentelemetry-proto.
This allows us to customize the generation process.

- Added opentelemetry-proto as a submodule.
- Added `make genproto` target that generates Go ProtoBufs from opentelemetry-proto
  submodule and puts them in internal/opentelemetry-proto-gen.
  Generation is done using Gogoproto instead of Go Protobuf.
- Modified all files to import OTLP Go code from internal/opentelemetry-proto-gen.

* Add wire compatibility tests
2020-05-28 11:16:56 -07:00
Bruno Garcia 8aa2731844
Remove year from copyright (#964) 2020-05-26 12:44:22 -04:00
Bogdan Drutu 8de13ba2c8
Move data_generator to cmd/pdatagen (#949)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-11 15:09:55 -07:00
Bogdan Drutu ca4b8231de
Rename MoveTo to MoveAndAppendTo. (#875)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-27 08:06:35 -07:00
Bogdan Drutu 9919d2cf92
Add CopyTo function to all the generated structs. (#870)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-24 10:20:56 -07:00
Dmitrii Anoshin 6358a1a631
Update internal data generator templates (#850)
- Fix typos
- Update package name
2020-04-20 09:23:04 -07:00
Bogdan Drutu 995b153e23
Move internal/data to consumer/pdata. (#835)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-15 13:13:55 -07:00