Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions collector/connector/validationconnector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ is resolved this component cannot be reliably used.
## Configuration

This connector can be used to test any exporter and receiver pair that
are able to propagate metadata using the Colector's
are able to propagate metadata using the Collector's
`client.Metadata.Info` mechanism. For example, to test an OTel Arrow
collector configuration, configure a loopback receiver:

Expand Down Expand Up @@ -131,7 +131,8 @@ cases using two kinds of context variable.
matching data.

For each expected and actual data item, the support method
`AssertEquiv` library in `../../../pkg/otel/assert/` is used to ensure
that the data is equivalent. This package uses a definition of
equivalence that tolerates reordering of unordered fields, which is
necesary to validate the OTel Arrow components in this repository.
`AssertEquiv` library in [pkg/otel/asasert](https://github.com/open-telemetry/otel-arrow/tree/main/pkg/otel/assert/README.md) is used to ensure
that the data are equivalent. This package supports the comparison of
two distinct structures that are semantically equivalent but
structurally different in several ways that can happen as a result of
the Arrow encoding.
2 changes: 1 addition & 1 deletion collector/processor/obfuscationprocessor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type Config struct {
Rounds int `mapstructure:"rounds"`

// KeyLength is a Fiestel parameter which determines the
// length of the keyt used to obfuscate. Default 128.
// length of the key used to obfuscate. Default 128.
KeyLength int `mapstructure:"key_length"`

// EncryptAll indicates that all byte-array and string values
Expand Down
2 changes: 1 addition & 1 deletion collector/processor/obfuscationprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func createTracesProcessor(
processorhelper.WithShutdown(processor.Shutdown))
}

// createTracesProcessor creates an instance of obfuscation for processing traces
// createLogsProcessor creates an instance of obfuscation for processing logs.
func createLogsProcessor(
ctx context.Context,
set processor.CreateSettings,
Expand Down
16 changes: 16 additions & 0 deletions pkg/otel/assert/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This package supports validation of data that has passed through Arrow
encoding and decoding, recognizing that there may be structural
differences for semantically equivalent data.

Examples of transformations that are allowed by `assert.Equiv()`:

- Appearance of duplicate Resource, Scope, and Metric entities
- Order of Resource instances in a Resource list
- Order of Scope items in a Resource
- Order of Span, Metric, and LogRecord items in a Scope
- Order of Links/Events in a Span
- and so on.

The `assert.Equiv()` method in this package should be used for
unittesting and validation of data in an OTel Arrow pipeline. See the
[code](equiv.go) for details.
16 changes: 10 additions & 6 deletions tools/trace_verify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"bufio"
"encoding/json"
"flag"
"io"
"log"
"os"

Expand Down Expand Up @@ -48,11 +49,17 @@ func main() {
log.Fatalf("open: %s: %v", file, err)
return
}
scanner := bufio.NewScanner(f)
for scanner.Scan() {
scanner := bufio.NewReader(f)
for {
line, err := scanner.ReadString('\n')
if err == io.EOF {
break
} else if err != nil {
log.Fatalf("read: %v", err)
}
var un ptrace.JSONUnmarshaler

expected, err := un.UnmarshalTraces([]byte(scanner.Text()))
expected, err := un.UnmarshalTraces([]byte(line))
if err != nil {
log.Fatalf("parse: %v", err)
}
Expand All @@ -78,8 +85,5 @@ func main() {

log.Printf("Verified %d traces\n", expected.SpanCount())
}
if err := scanner.Err(); err != nil {
log.Fatalf("read: %v", err)
}
}
}