-
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.
Add ignore check flags to skip checks
- Loading branch information
Showing
17 changed files
with
297 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" |
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 |
---|---|---|
|
@@ -16,3 +16,4 @@ | |
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
src/ |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Package spanlint defines a linter that checks for mistakes with OTEL trace spans. | ||
// | ||
// # Analyzer spanlint | ||
// | ||
// spanlint: check for mistakes with OpenTelemetry trace spans. | ||
// | ||
// Common mistakes with OTEL trace spans include forgetting to call End: | ||
// | ||
// func(ctx context.Context) { | ||
// ctx, span := otel.Tracer("app").Start(ctx, "span") | ||
// // defer span.End() should be here | ||
// | ||
// // do stuff | ||
// } | ||
// | ||
// Forgetting to set an Error status: | ||
// | ||
// ctx, span := otel.Tracer("app").Start(ctx, "span") | ||
// defer span.End() | ||
// | ||
// if err := task(); err != nil { | ||
// // span.SetStatus(codes.Error, err.Error()) should be here | ||
// span.RecordError(err) | ||
// return fmt.Errorf("failed to run task: %w", err) | ||
// } | ||
// | ||
// Forgetting to record the Error: | ||
// | ||
// ctx, span := otel.Tracer("app").Start(ctx, "span") | ||
// defer span.End() | ||
// | ||
// if err := task(); err != nil { | ||
// span.SetStatus(codes.Error, err.Error()) | ||
// // span.RecordError(err) should be here | ||
// return fmt.Errorf("failed to run task: %w", err) | ||
// } | ||
package spanlint |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ go 1.21.3 | |
|
||
use ( | ||
. | ||
./testdata | ||
./testdata/base | ||
./testdata/disableerrorchecks | ||
./testdata/enableall | ||
) |
Oops, something went wrong.