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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.18
- name: Build otelinit
run: go build -v ./...
- name: Build test stub
Expand Down
14 changes: 10 additions & 4 deletions cmd/test-otel-init-go/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package main
// [ ] use random ports for listener address?

import (
"bytes"
"encoding/json"
"fmt"
"io/fs"
Expand Down Expand Up @@ -44,7 +45,7 @@ type CliEvent struct {
Events []CliEvent // reader code will stuff kind=event in here
}

// tid sid
// --------------- tid sid
type CliEvents map[string]map[string]CliEvent

// StubData is the structure of the data that the stub program
Expand Down Expand Up @@ -196,13 +197,18 @@ func runPrograms(t *testing.T, scenario Scenario) (StubData, CliEvents) {

// MAYBE: server json --stdout is maybe better? and could add a graceful exit on closed fds
otelcli := exec.Command(otelCliPath, cliArgs...)
otelcli.Env = []string{"PATH=/bin"} // apparently this is required for 'getent', no idea why
otelcli.Env = []string{"PATH=/bin"} // apparently PATH=/bin is required for 'getent', no idea why
var b bytes.Buffer
otelcli.Stdout = &b
otelcli.Stderr = &b

if !scenario.SkipOtelCli {
// run otel-cli server in the background
go func() {
err, output := otelcli.CombinedOutput()
err := otelcli.Start()
otelcli.Wait() // don't check error, it's fast and errors a lot for no reason
if err != nil {
log.Println(output)
log.Println(b.String())
log.Fatalf("Executing command %q failed: %s", otelcli.String(), err)
}
}()
Expand Down
30 changes: 23 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
module github.com/equinix-labs/otel-init-go

go 1.15
go 1.18

require (
github.com/google/go-cmp v0.5.6
go.opentelemetry.io/otel v1.3.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0
go.opentelemetry.io/otel/sdk v1.3.0
go.opentelemetry.io/otel/trace v1.3.0
google.golang.org/grpc v1.44.0
github.com/google/go-cmp v0.5.9
go.opentelemetry.io/otel v1.11.2
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.2
go.opentelemetry.io/otel/sdk v1.11.2
go.opentelemetry.io/otel/trace v1.11.2
google.golang.org/grpc v1.51.0
)

require (
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.2 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
golang.org/x/text v0.4.0 // indirect
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
Loading