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
* [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>
This allow to identify a new problem, NewClient -> NewGRPCClient
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
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>
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>
* 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>
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>
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.