Skip to content

Commit

Permalink
Update to OTel-Go metrics API v0.38.1; install a "fast" bypass mechan…
Browse files Browse the repository at this point in the history
…ism (#447)
  • Loading branch information
jmacd authored May 23, 2023
1 parent 266a32f commit c74d407
Show file tree
Hide file tree
Showing 34 changed files with 1,248 additions and 942 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## Unreleased

## [1.17.0](https://github.com/lightstep/otel-launcher-go/releases/tag/v1.17.0) - 2023-05-22)

- Update to OTel-Go API v0.38.1. [#447](https://github.com/lightstep/otel-launcher-go/pull/447)
- Exporter now based on OTel collector batchprocessor and otlpexporter. [#445](https://github.com/lightstep/otel-launcher-go/pull/445)

## [1.16.0](https://github.com/lightstep/otel-launcher-go/releases/tag/v1.16.0) - 2023-04-27)
Expand Down
28 changes: 14 additions & 14 deletions examples/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (

"github.com/lightstep/otel-launcher-go/launcher"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
metricglobal "go.opentelemetry.io/otel/metric/global"
"go.opentelemetry.io/otel/metric/instrument"
)

func main() {
Expand All @@ -56,7 +56,7 @@ func main() {
c2, _ := meter.Int64UpDownCounter(prefix + "updowncounter")
hist, _ := meter.Float64Histogram(prefix + "histogram")
mmsc, _ := meter.Float64Histogram(prefix+"mmsc",
instrument.WithDescription(`{
metric.WithDescription(`{
"aggregation": "minmaxsumcount"
}`),
)
Expand All @@ -83,8 +83,8 @@ func main() {

_, err := meter.Int64ObservableCounter(
prefix+"counterobserver",
instrument.WithInt64Callback(
func(ctx context.Context, obs instrument.Int64Observer) error {
metric.WithInt64Callback(
func(ctx context.Context, obs metric.Int64Observer) error {
obs.Observe(int64(time.Since(startTime).Seconds()))
return nil
},
Expand All @@ -97,8 +97,8 @@ func main() {

_, err = meter.Int64ObservableUpDownCounter(
prefix+"updowncounterobserver",
instrument.WithInt64Callback(
func(ctx context.Context, obs instrument.Int64Observer) error {
metric.WithInt64Callback(
func(ctx context.Context, obs metric.Int64Observer) error {
obs.Observe(-int64(time.Since(startTime).Seconds()))
return nil
},
Expand All @@ -111,8 +111,8 @@ func main() {

_, err = meter.Int64ObservableGauge(
prefix+"gauge",
instrument.WithInt64Callback(
func(ctx context.Context, obs instrument.Int64Observer) error {
metric.WithInt64Callback(
func(ctx context.Context, obs metric.Int64Observer) error {
obs.Observe(int64(50 + rand.NormFloat64()*50))
return nil
},
Expand All @@ -125,14 +125,14 @@ func main() {

_, err = meter.Float64ObservableGauge(
prefix+"sine_wave",
instrument.WithFloat64Callback(
func(ctx context.Context, obs instrument.Float64Observer) error {
metric.WithFloat64Callback(
func(ctx context.Context, obs metric.Float64Observer) error {
secs := float64(time.Now().UnixNano()) / float64(time.Second)

obs.Observe(math.Sin(secs/(50*math.Pi)), attribute.String("period", "fastest"))
obs.Observe(math.Sin(secs/(200*math.Pi)), attribute.String("period", "fast"))
obs.Observe(math.Sin(secs/(1000*math.Pi)), attribute.String("period", "regular"))
obs.Observe(math.Sin(secs/(5000*math.Pi)), attribute.String("period", "slow"))
obs.Observe(math.Sin(secs/(50*math.Pi)), metric.WithAttributes(attribute.String("period", "fastest")))
obs.Observe(math.Sin(secs/(200*math.Pi)), metric.WithAttributes(attribute.String("period", "fast")))
obs.Observe(math.Sin(secs/(1000*math.Pi)), metric.WithAttributes(attribute.String("period", "regular")))
obs.Observe(math.Sin(secs/(5000*math.Pi)), metric.WithAttributes(attribute.String("period", "slow")))
return nil
},
),
Expand Down
71 changes: 37 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@ require (
github.com/lightstep/otel-launcher-go/lightstep/sdk/metric v1.17.0
github.com/lightstep/otel-launcher-go/pipelines v1.17.0
github.com/sethvargo/go-envconfig v0.8.3
github.com/stretchr/testify v1.8.2
go.opentelemetry.io/otel v1.14.0
go.opentelemetry.io/otel/metric v0.37.0
go.opentelemetry.io/otel/sdk v1.14.0
go.opentelemetry.io/otel/trace v1.14.0
github.com/stretchr/testify v1.8.3
go.opentelemetry.io/otel v1.15.1
go.opentelemetry.io/otel/metric v0.38.1
go.opentelemetry.io/otel/sdk v1.15.1
go.opentelemetry.io/otel/trace v1.15.1
)

require (
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/apache/arrow/go/v12 v12.0.0-20230404000714-f02d35119ae6 // indirect
github.com/apache/thrift v0.16.0 // indirect
github.com/axiomhq/hyperloglog v0.0.0-20230201085229-3ddf4bad03dc // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/f5/otel-arrow-adapter v0.0.0-20230407165153-7ac49c4f4aae // indirect
github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc // indirect
github.com/f5/otel-arrow-adapter v0.0.0-20230522233737-dc34685b4828 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
Expand All @@ -48,50 +50,51 @@ require (
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mostynb/go-grpc-compression v1.1.17 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/mostynb/go-grpc-compression v1.1.18 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/shirou/gopsutil/v3 v3.23.3 // indirect
github.com/shoenig/go-m1cpu v0.1.4 // indirect
github.com/shirou/gopsutil/v3 v3.23.4 // indirect
github.com/shoenig/go-m1cpu v0.1.5 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/collector v0.76.1 // indirect
go.opentelemetry.io/collector/component v0.76.1 // indirect
go.opentelemetry.io/collector/confmap v0.76.1 // indirect
go.opentelemetry.io/collector/consumer v0.76.1 // indirect
go.opentelemetry.io/collector/exporter v0.76.1 // indirect
go.opentelemetry.io/collector/featuregate v0.76.1 // indirect
go.opentelemetry.io/collector/pdata v1.0.0-rcv0011 // indirect
go.opentelemetry.io/collector/processor/batchprocessor v0.76.1 // indirect
go.opentelemetry.io/collector/receiver v0.76.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0 // indirect
go.opentelemetry.io/contrib/instrumentation/host v0.40.0 // indirect
go.opentelemetry.io/contrib/instrumentation/runtime v0.40.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.15.0 // indirect
go.opentelemetry.io/contrib/propagators/ot v1.15.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.37.0 // indirect
go.opentelemetry.io/collector v0.78.1 // indirect
go.opentelemetry.io/collector/component v0.78.1 // indirect
go.opentelemetry.io/collector/confmap v0.78.1 // indirect
go.opentelemetry.io/collector/consumer v0.78.1 // indirect
go.opentelemetry.io/collector/exporter v0.78.1 // indirect
go.opentelemetry.io/collector/featuregate v1.0.0-rcv0012 // indirect
go.opentelemetry.io/collector/pdata v1.0.0-rcv0012 // indirect
go.opentelemetry.io/collector/processor/batchprocessor v0.78.1 // indirect
go.opentelemetry.io/collector/receiver v0.78.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.41.1 // indirect
go.opentelemetry.io/contrib/instrumentation/host v0.41.1 // indirect
go.opentelemetry.io/contrib/instrumentation/runtime v0.41.1 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.16.1 // indirect
go.opentelemetry.io/contrib/propagators/ot v1.16.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.38.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.37.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.37.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.38.1 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/tools v0.7.0 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.55.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Expand Down
Loading

0 comments on commit c74d407

Please sign in to comment.