-
Notifications
You must be signed in to change notification settings - Fork 0
[LFXV2-612] Add OpenTelemetry tracing support #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
bec5ace
f0145ed
2203e5c
a1298f4
3241e96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ import ( | |
|
|
||
| "github.com/linuxfoundation/lfx-v2-access-check/internal/infrastructure/config" | ||
| "github.com/linuxfoundation/lfx-v2-access-check/pkg/log" | ||
| "github.com/linuxfoundation/lfx-v2-access-check/pkg/utils" | ||
| ) | ||
|
|
||
| func init() { | ||
|
|
@@ -24,11 +25,25 @@ func main() { | |
| // Load configuration with CLI flags and environment variables | ||
| cfg := config.LoadConfig() | ||
|
|
||
| // Set up OpenTelemetry SDK. | ||
| ctx := context.Background() | ||
| otelConfig := utils.OTelConfigFromEnv() | ||
| otelShutdown, err := utils.SetupOTelSDKWithConfig(ctx, otelConfig) | ||
| if err != nil { | ||
| slog.Error("error setting up OpenTelemetry SDK", "error", err) | ||
| os.Exit(1) | ||
| } | ||
| defer func() { | ||
| if shutdownErr := otelShutdown(context.Background()); shutdownErr != nil { | ||
| slog.Error("error shutting down OpenTelemetry SDK", "error", shutdownErr) | ||
| } | ||
| }() | ||
|
Comment on lines
52
to
58
|
||
|
|
||
| // Setup signal handling for graceful shutdown | ||
| sigChan := make(chan os.Signal, 1) | ||
| signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) | ||
|
|
||
| ctx, cancel := context.WithCancel(context.Background()) | ||
| ctx, cancel := context.WithCancel(ctx) | ||
| defer cancel() | ||
|
|
||
| go func() { | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAMLlint error from standalone template directives in
env:.Line 42 triggers a syntax error because raw
{{- ... }}lines aren’t valid YAML. If YAMLlint scans chart templates in CI, this will fail. Consider excludingcharts/**/templates/**from YAMLlint or switching that stage to a Helm-aware linting approach.If you want, I can propose a concrete YAMLlint configuration change to keep templates linted safely.
Also applies to: 44-93
🧰 Tools
🪛 YAMLlint (1.38.0)
[error] 42-42: syntax error: could not find expected ':'
(syntax)
🤖 Prompt for AI Agents