Skip to content

Commit

Permalink
Add exit for when passed buildinfo or other arguments (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly authored Jun 1, 2024
1 parent bc35bb8 commit af37f80
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions otel_in_out_sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ func main() {
}
binfo, _ := debug.ReadBuildInfo()
log.Println(binfo.String())
// Adding this because of shared workflows call "buildinfo" which is handled in fortio/cli
// for other projects but not this one which has no dependencies beside otel.
if flag.NArg() > 0 {
log.Printf("Unknown arguments: %v", flag.Args())
flag.Usage()
os.Exit(1)
}
log.Printf("OTEL_SERVICE_NAME=%s", os.Getenv("OTEL_SERVICE_NAME"))
log.Printf("OTEL_EXPORTER_OTLP_ENDPOINT=%s", os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT"))
log.Printf("OTEL export pipeline setup successfully - Starting sample server on -listen %s to forward to -url %s", *listen, *url)
Expand Down

0 comments on commit af37f80

Please sign in to comment.