Commit Graph

4 Commits

Author SHA1 Message Date
Damien Mathieu 1159fda4f5
Add stringSlice and int64Slice to pcommon, and let tests handle non-number slices (#10148)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This adds a string slice to pcommon, that will be used by the profiles
pdata.

#### Link to tracking issue

Part of #10109.

#### Testing

This is unit-tested.

cc @mx-psi

---------

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2024-05-21 17:33:43 +02:00
Dmitrii Anoshin 7ee0b28302
[pdata] Introduce runtime safeguards to catch incorrect pdata mutations (#8494)
This change introduces an option to enable runtime assertions to catch
unintentional pdata mutations in components that are claimed as
non-mutating pdata. Without these assertions, runtime errors may still
occur, but thrown by unrelated components, making it very difficult to
troubleshoot.

For now, this doesn't change the default behavior. It just introduces a
new method on `[Metrics/Traces|Logs].Shared()` that returns pdata marked
as shared. The method will be applied to fan-out consumers in the next
PR.

Later, if we want to remove the need of `MutatesData` capability, we can
introduce another method `[Metrics/Traces|Logs].Exclusive()` which
returns a copy of the pdata if it's shared.

This change unblocks the 1.0 release by implementing the original
solution proposed by @bogdandrutu in
https://github.com/open-telemetry/opentelemetry-collector/issues/6794.
Going forward, we may introduce a copy-on-write solution that doesn't
require the runtime assertions. That will likely be part of the 2.0
release.
2023-10-06 08:56:20 -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
Dmitrii Anoshin fcd68becc8
[chore] [pdata] Split generated code into more files (#7084) 2023-01-31 08:19:12 -08:00