Commit Graph

18 Commits

Author SHA1 Message Date
Alex Boten 062d0a7ffc
[chore] remove unnecessary underscores (#9580)
As per feedback from my previous PR

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-02-13 13:34:53 -08:00
Alex Boten 4688461318
[chore] fix unused params (#9578)
Related to #9577

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-02-13 11:04:48 -08:00
Pablo Baeyens 704a16c2cd
[pdata] Document that Marshalers/Unmarshalers use OTLP/JSON format explicitly (#8974)
Explicitly documents that the `JSONMarshaler` and `JSONUnmarshaler` as
conforming to the format in the OTLP/JSON specification.

The intent is to be explicit that we follow this spec and that
deviations (such as supporting snake case) are bugs that can be removed
in a minor version update.

**Link to tracking Issue:** Relates to #6287
2023-11-21 08:46:32 -08:00
Bogdan Drutu 18a11ec09b
Change JSON unmarshalling to be a func on pdata types (#7701)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-05-22 06:19:52 -07:00
Alex Boten 80d704deb4
[chore] use license shortform (#7694)
* [chore] use license shortform

To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052

Signed-off-by: Alex Boten <aboten@lightstep.com>

* make goporto

Signed-off-by: Alex Boten <aboten@lightstep.com>

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-18 13:11:17 -07:00
Bogdan 087c047483
Remove deprecated code from pdata
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-10-26 14:21:47 -07:00
Bogdan Drutu 3a5e134722
[chore] Split the single file in p[trace|metric|log]otlp package into one per struct (#6349)
This allow to identify a new problem, NewClient -> NewGRPCClient

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

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-10-19 09:05:11 -07:00
Bogdan Drutu bb193a24d0
Deprecate New[JSON|Proto][Marshaler|Unmarshale], expose the structs (#6340)
The main motivation is because we want to be able to extend these Marshaler/Unmarshaler implementation with possible options.

Because of that we have 2 options: 1. add Option to each New func, OR 2. expose the structs so that later users can configure different options inside these structs, similar with `jsonpb.Marshaler`.

I implemented the version 2 since it is simpler, and less code, and also common in the industry.

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

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-10-18 15:29:37 -07:00
Bogdan Drutu c157b128e9
JSON marshaler emits enums as ints per spec reuqirements. (#6339)
Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/6338
2022-10-18 10:56:22 -07:00
Bogdan Drutu 8b267403d9
Move json jsoniter unmarshal to be reused for potlp packages (#6040)
Fix https://github.com/open-telemetry/opentelemetry-collector/issues/6027

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

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-09-12 08:24:46 -07:00
Bogdan Drutu cc670ef687
[chore] remove unnecessary private funcs (#6039)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-09-09 10:49:41 -07:00
Bogdan Drutu 48342e82c1
Correctly skip unkown value types (#6038)
* Correctly skip unkown value types

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

* Update pdata/internal/json/attribute_test.go

Co-authored-by: Alex Boten <alex@boten.ca>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
Co-authored-by: Alex Boten <alex@boten.ca>
2022-09-08 13:28:03 -07:00
Bogdan Drutu f4e6175996
Use private funcs instead of members funcs when possible (#6037)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-09-07 08:11:58 -07:00
look 8b18d1a32d
Implement unmarshal Logs with jsoniter (#6021)
* feat: Logs uses the new jsoniter

* feat: add unit test

* feat: update CHANGELOG

* feat:  golangci-lint

* remove duplicate code
2022-09-06 09:28:14 -07:00
Bogdan Drutu 58fa059da5
Change pdata generated types to use type definition instead of aliases (#5936)
Change the way how objects are generated in `pdata`. Previously the pdata objects were generated in the `internal` package and aliases were created in the public packageas.

This PR changes this, by creating only "wrappers" object inside the internal package, and the public type is a type def of the internal type:

```golang
package internal

type LogRecord struct {
	orig *otlplogs.LogRecord
}

func GetOrigLogRecord(ms LogRecord) *otlplogs.LogRecord {
	return ms.orig
}

func NewLogRecord(orig *otlplogs.LogRecord) LogRecord {
	return LogRecord{orig: orig}
}
```

```golang
package plog

type LogRecord internal.LogRecord
```

With this approach, we still do not allow users access to the internal origin, which allows us flexibility to change to other representation (something like lazy proto, etc), but improves documentation of the pdata packages, see [current documentation](https://pkg.go.dev/go.opentelemetry.io/collector/pdata@v0.58.0/plog).

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

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-24 16:32:05 -07:00
Bogdan Drutu d7b097cf07
Remove the InstrumentationLibrary to Scope translation, OTLP 0.19 no longer supports it. (#5819)
* Remove the InstrumentationLibrary to Scope translation, OTLP 0.19 no longer supports it.

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

* Update CHANGELOG.md

Co-authored-by: Alex Boten <aboten@lightstep.com>
2022-08-04 14:02:14 -07:00
Bogdan Drutu 70e040a2be
Fix translation from otlp.Request to pdata representation (#5197)
The problem that this PR tries to fix, is that changes in the traces object return by the otlp.Request are not reflected in the Request.

The solution is to wrap the request proto instead of the data proto, since for the marshalers we don't have an equivalent object that shares the same problem as Request.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-04-14 10:52:00 -07:00
Dmitrii Anoshin 734e25e8de
Split `model` by signal type and move it to the new `pdata` module (#5168)
Split all `pdata` related code by type and move it from `model` to the new module `pdata`.

- `model/pdata` and `model/otlp` are moved to `pdata/plog`, `pdata/pmetric` and `pdata/ptrace`.
- `model/otlpgrpc` is moved to `pdata/plogotlp`, `pdata/pmetricotlp` and `pdata/ptraceotlp`.

Now all the API in `model` except for `model/semconv` is deprecated.
2022-04-11 16:00:26 -07:00