-
Notifications
You must be signed in to change notification settings - Fork 2
[LFXv2-610] Add OpenTelemetry tracing support #40
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 all commits
99d8461
73e65f8
ddbe9f6
096cde1
b3e9cf9
1042f83
f9aba72
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 |
|---|---|---|
|
|
@@ -27,10 +27,18 @@ jobs: | |
| - uses: ko-build/[email protected] | ||
| with: | ||
| version: v0.17.1 | ||
| - run: | | ||
| - name: Build and publish indexer image | ||
| env: | ||
| VERSION: development | ||
| GIT_COMMIT: ${{ github.sha }} | ||
| run: | | ||
| BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S') | ||
| export BUILD_TIME | ||
| GIT_COMMIT=${GIT_COMMIT:0:7} | ||
| export GIT_COMMIT | ||
| ko build github.com/linuxfoundation/lfx-v2-indexer-service/cmd/lfx-indexer \ | ||
| -B \ | ||
| --platform linux/amd64,linux/arm64 \ | ||
| -t development \ | ||
| -t ${{ github.sha }} \ | ||
| -t development \ | ||
| --sbom spdx | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Copyright The Linux Foundation and each contributor to LFX. | ||
| # SPDX-License-Identifier: MIT | ||
| builds: | ||
| - id: lfx-indexer | ||
| dir: ./cmd/lfx-indexer | ||
| ldflags: | ||
| - -X=main.Version={{.Env.VERSION}} | ||
| - -X=main.BuildTime={{.Env.BUILD_TIME}} | ||
| - -X=main.GitCommit={{.Env.GIT_COMMIT}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,43 @@ app: | |
| readTimeout: "5s" | ||
| writeTimeout: "5s" | ||
| shutdownTimeout: "10s" | ||
| # extraEnv allows adding additional environment variables to the container. | ||
| # Supports both simple values and Kubernetes field references. | ||
| extraEnv: [] | ||
| # otel is the configuration for OpenTelemetry tracing | ||
| otel: | ||
| # serviceName is the service name for OpenTelemetry resource identification | ||
| # (default: "lfx-v2-indexer-service") | ||
| serviceName: "" | ||
| # serviceVersion is the service version for OpenTelemetry resource identification | ||
| # (default: build-time Version variable) | ||
| serviceVersion: "" | ||
|
Comment on lines
+77
to
+79
|
||
| # protocol specifies the OTLP protocol: "grpc" or "http" | ||
| # (default: "grpc") | ||
| protocol: "grpc" | ||
| # endpoint is the OTLP collector endpoint | ||
| # For gRPC: typically "host:4317", for HTTP: typically "host:4318" | ||
| endpoint: "" | ||
| # insecure disables TLS for the OTLP connection | ||
| # Set to "true" for in-cluster communication without TLS | ||
| insecure: "false" | ||
| # tracesExporter specifies the traces exporter: "otlp" or "none" | ||
| # (default: "none") | ||
| tracesExporter: "none" | ||
| # tracesSampleRatio specifies the sampling ratio for traces (0.0 to 1.0) | ||
| # A value of 1.0 means all traces are sampled, 0.5 means 50% are sampled | ||
| # (default: "1.0") | ||
| tracesSampleRatio: "1.0" | ||
| # metricsExporter specifies the metrics exporter: "otlp" or "none" | ||
| # (default: "none") | ||
| metricsExporter: "none" | ||
| # logsExporter specifies the logs exporter: "otlp" or "none" | ||
| # (default: "none") | ||
| logsExporter: "none" | ||
| # propagators specifies the propagators to use, comma-separated | ||
| # Supported values: "tracecontext", "baggage", "jaeger" | ||
| # (default: "tracecontext,baggage") | ||
| propagators: "tracecontext,baggage,jaeger" | ||
|
Comment on lines
+82
to
+105
|
||
|
|
||
| # image is the configuration for the container image | ||
| image: | ||
|
|
||
|
|
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.
🧩 Analysis chain
🏁 Script executed:
fd "values.yaml" charts/ --type fRepository: linuxfoundation/lfx-v2-indexer-service
Length of output: 123
🏁 Script executed:
Repository: linuxfoundation/lfx-v2-indexer-service
Length of output: 5850
🏁 Script executed:
Repository: linuxfoundation/lfx-v2-indexer-service
Length of output: 1548
🏁 Script executed:
Repository: linuxfoundation/lfx-v2-indexer-service
Length of output: 1019
Add a nil guard before accessing
.Values.app.otelto prevent"<nil>"string injection.While the default
values.yamldefines theotelblock, users who override values could potentially omit it. If.Values.app.otelbecomesnil, accessing.otel.serviceNamereturnsnil, which converts to the string literal"<nil>"viatoString, bypassing thene ""check and settingOTEL_SERVICE_NAME="<nil>".Wrap the entire OTEL section in a nil guard:
Alternatively, guard each access with
default ""beforetoString:The outer guard is cleaner and more efficient.
🤖 Prompt for AI Agents