-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
488 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,8 @@ func newTraceProvider(ctx context.Context, res *resource.Resource) (*trace.Trace | |
return traceProvider, nil | ||
} | ||
|
||
var ErrOtelTraceExporterInvalid = errors.New("OTEL_TRACE_EXPORTER invalid") | ||
|
||
// newTraceExporter returns a new trace.SpanExporter based on the OTEL_TRACE_EXPORTER env variable | ||
// A SpanExporter pushes traces to a tracing database. For more configuration see the corresponding documentation. | ||
func newTraceExporter(ctx context.Context) (trace.SpanExporter, error) { | ||
|
@@ -145,6 +147,6 @@ func newTraceExporter(ctx context.Context) (trace.SpanExporter, error) { | |
// more info: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/[email protected] | ||
return otlptracehttp.New(ctx) | ||
default: | ||
return nil, errors.New("OTEL_TRACE_EXPORTER invalid") | ||
return nil, ErrOtelTraceExporterInvalid | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package errs | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
"github.com/google/uuid" | ||
) | ||
|
||
var ( | ||
ErrAlreadyExists = errors.New("cannot create an already existing aggregate") | ||
ErrOrganizationMissing = errors.New("organization is missing from event") | ||
ErrCommitterMissing = errors.New("committer is missing from event") | ||
ErrPayloadMissing = errors.New("payload is empty") | ||
) | ||
|
||
type NotFoundError uuid.UUID | ||
|
||
func (e NotFoundError) Error() string { | ||
return fmt.Sprintf("record with id %s not found", uuid.UUID(e).String()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.