Skip to content

Commit

Permalink
Fix spelling typo
Browse files Browse the repository at this point in the history
  • Loading branch information
krzko committed Mar 27, 2023
1 parent 8b6ffa6 commit 7af47b8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
8 changes: 7 additions & 1 deletion internal/cli/metrics_root.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,17 @@ func getExporterOptions(c *cli.Context, mc *metrics.Config) ([]otlpmetricgrpc.Op
}

if c.String("temporality") == "delta" {
logger.Info("using", zap.String("temporarility", c.String("temporality")))
grpcExpOpt = append(grpcExpOpt, otlpmetricgrpc.WithTemporalitySelector(preferDeltaTemporalitySelector))
httpExpOpt = append(httpExpOpt, otlpmetrichttp.WithTemporalitySelector(preferDeltaTemporalitySelector))
} else {
} else if c.String("temporality") == "cumulative" {
logger.Info("using", zap.String("temporarility", c.String("temporality")))
grpcExpOpt = append(grpcExpOpt, otlpmetricgrpc.WithTemporalitySelector(preferCumulativeTemporalitySelector))
httpExpOpt = append(httpExpOpt, otlpmetrichttp.WithTemporalitySelector(preferCumulativeTemporalitySelector))
} else {
logger.Error("falliing back to delta temporality", zap.String("use one of", "delta, cumulative"))
grpcExpOpt = append(grpcExpOpt, otlpmetricgrpc.WithTemporalitySelector(preferDeltaTemporalitySelector))
httpExpOpt = append(httpExpOpt, otlpmetrichttp.WithTemporalitySelector(preferDeltaTemporalitySelector))
}

return grpcExpOpt, httpExpOpt
Expand Down
17 changes: 0 additions & 17 deletions internal/metrics/runner.go

This file was deleted.

9 changes: 9 additions & 0 deletions internal/metrics/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ func NewWorker(c *Config, logger *zap.Logger) *Worker {
}
}

// run is a function that runs a worker
func run(c *Config, logger *zap.Logger, workerFunc WorkerFunc) error {
w := NewWorker(c, logger)
if err := w.Run(context.Background(), workerFunc); err != nil {
return fmt.Errorf("failed to run worker: %w", err)
}
return nil
}

// Run runs the worker
func (w *Worker) Run(ctx context.Context, workerFunc WorkerFunc) error {
if w.totalDuration == 0 {
Expand Down
Binary file added main
Binary file not shown.

0 comments on commit 7af47b8

Please sign in to comment.