Skip to content
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

feat: add jaeger-all-in-one for trouble shooting #209

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

zyy17
Copy link
Collaborator

@zyy17 zyy17 commented Nov 28, 2024

Summary by CodeRabbit

  • New Features

    • Updated the greptimedb-cluster Helm chart to version 0.2.37.
    • Introduced a new dependency on jaeger-all-in-one for enhanced tracing capabilities.
    • Added configuration options for jaeger-all-in-one, including deployment enablement and image settings.
  • Documentation

    • Updated README to reflect new version and added details on the jaeger-all-in-one configuration options.
  • Chores

    • Modified release script to update URLs for the Jaeger chart in the Chart.yaml.
    • Enhanced CI workflow to include Jaeger Helm chart repository.
    • Updated deployment script to include Jaeger Helm repository for smoother deployment.

Copy link
Contributor

coderabbitai bot commented Nov 28, 2024

Walkthrough

The changes in this pull request involve updates to the greptimedb-cluster Helm chart, specifically incrementing its version from 0.2.36 to 0.2.37. A new dependency, jaeger-all-in-one, has been added with its configuration options in the Chart.yaml, README.md, and values.yaml files. Additionally, a script for releasing charts has been modified to update the Jaeger chart URL to an OCI registry. These modifications enhance the chart's functionality and deployment options.

Changes

File Path Change Summary
charts/greptimedb-cluster/Chart.yaml - Version updated to 0.2.37.
- New dependency jaeger-all-in-one added with version 0.1.12.
charts/greptimedb-cluster/README.md - Version badge updated to 0.2.37.
- Added configuration options for jaeger-all-in-one.
charts/greptimedb-cluster/values.yaml - New section for jaeger-all-in-one added with various configuration fields.
scripts/release/release-charts-to-acr.sh - Added sed command to replace Jaeger chart URL with OCI registry URL.
.github/workflows/ci.yaml - New step added to include Jaeger Helm chart repository in CI workflow.
scripts/e2e/greptimedb-cluster.sh - Added line to include Jaeger repository in the deployment script.

Possibly related PRs

Suggested reviewers

  • daviderli614

Poem

🐇 In the meadow where the charts grow,
A new version hops, ready to show.
Jaeger joins the fun, tracing the way,
With options galore for a brighter day.
Let's bundle our changes, release with a cheer,
For the greptimedb-cluster, the future is near! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@zyy17 zyy17 requested review from daviderli614 and WenyXu November 28, 2024 02:40
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Outside diff range and nitpick comments (3)
scripts/release/release-charts-to-acr.sh (1)

13-17: Consider refactoring URL replacements for better maintainability.

The script has multiple hardcoded URLs that could be made more maintainable.

Consider refactoring like this:

 if [ "$chart_name" == "greptimedb-cluster" ]; then
+  # Define URL mappings
+  declare -A url_mappings=(
+    ["https://grafana.github.io/helm-charts"]="oci://$OCI_REGISTRY_URL/$OCI_NAMESPACE"
+    ["https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts"]="oci://$OCI_REGISTRY_URL/$OCI_NAMESPACE"
+  )
+
+  # Replace URLs
+  for old_url in "${!url_mappings[@]}"; do
+    new_url="${url_mappings[$old_url]}"
+    sed -i "s|$old_url|$new_url|g" "$dir/Chart.yaml"
+  done
-      sed -i 's|https://grafana.github.io/helm-charts|oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts|g' "$dir/Chart.yaml"
-      sed -i 's|https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts|oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts|g' "$dir/Chart.yaml"

       # Update the dependencies.
       helm dependency update "$dir"
     fi
charts/greptimedb-cluster/README.md (1)

77-77: Format the URL using proper markdown syntax

Convert the bare URL to proper markdown link format for better documentation standards.

-| https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts | jaeger-all-in-one | 0.1.12 |
+| [jaeger-all-in-one](https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts) | jaeger-all-in-one | 0.1.12 |
🧰 Tools
🪛 Markdownlint (0.35.0)

77-77: null
Bare URL used

(MD034, no-bare-urls)

charts/greptimedb-cluster/values.yaml (1)

1043-1049: Consider adding useful annotations for the Jaeger service

Adding prometheus.io annotations would help in monitoring the Jaeger instance.

  service:
    type: ClusterIP
    port: 16686
-    annotations: {}
+    annotations:
+      prometheus.io/scrape: "true"
+      prometheus.io/port: "16686"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d74366e and 626f29f.

⛔ Files ignored due to path filters (1)
  • charts/greptimedb-cluster/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • charts/greptimedb-cluster/Chart.yaml (2 hunks)
  • charts/greptimedb-cluster/README.md (3 hunks)
  • charts/greptimedb-cluster/values.yaml (1 hunks)
  • scripts/release/release-charts-to-acr.sh (1 hunks)
🧰 Additional context used
🪛 Markdownlint (0.35.0)
charts/greptimedb-cluster/README.md

77-77: null
Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (4)
charts/greptimedb-cluster/Chart.yaml (1)

5-5: LGTM on version bump

The version increment from 0.2.36 to 0.2.37 follows semantic versioning and is appropriate for adding a new optional dependency.

charts/greptimedb-cluster/README.md (1)

5-5: LGTM: Version increment is appropriate

Version bump from 0.2.36 to 0.2.37 aligns with the feature addition of jaeger-all-in-one support.

charts/greptimedb-cluster/values.yaml (2)

1051-1058: LGTM! Volume configuration looks good

The persistence configuration is well-defined with a reasonable default size of 3Gi for development purposes.


1060-1064: LGTM! Collector configuration is appropriate

Enabling both Zipkin and OpenTelemetry collectors provides good flexibility for different tracing implementations.

charts/greptimedb-cluster/Chart.yaml Show resolved Hide resolved
scripts/release/release-charts-to-acr.sh Show resolved Hide resolved
charts/greptimedb-cluster/README.md Show resolved Hide resolved
charts/greptimedb-cluster/README.md Show resolved Hide resolved
charts/greptimedb-cluster/values.yaml Show resolved Hide resolved
charts/greptimedb-cluster/values.yaml Show resolved Hide resolved
@zyy17 zyy17 force-pushed the feat/add-jaeger-dev branch from 626f29f to ef4d7fe Compare November 28, 2024 02:53
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (4)
scripts/e2e/greptimedb-cluster.sh (1)

56-58: Consider adding Jaeger deployment verification.

Since Jaeger is being added for troubleshooting purposes, it would be valuable to:

  1. Verify that Jaeger pods are running correctly after deployment
  2. Add basic smoke tests to ensure Jaeger is collecting traces

Here's a suggested addition to the deploy_greptimedb_cluster function:

 helm dependency build charts/greptimedb-cluster
 
 # Deploy greptimedb cluster.
 helm upgrade --install mycluster charts/greptimedb-cluster -n default
+
+# Verify Jaeger deployment if enabled
+if [ "$(helm get values mycluster -n default -a -o json | jq -r '.jaeger-all-in-one.enabled')" = "true" ]; then
+  echo "Waiting for Jaeger to be ready..."
+  kubectl rollout status --timeout=60s deployment/mycluster-jaeger -n default
+fi
charts/greptimedb-cluster/README.md (1)

77-77: Format repository URL properly

The bare URL should be properly formatted in markdown style.

-| https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts | jaeger-all-in-one | 0.1.12 |
+| [jaeger-all-in-one](https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts) | jaeger-all-in-one | 0.1.12 |
🧰 Tools
🪛 Markdownlint (0.35.0)

77-77: null
Bare URL used

(MD034, no-bare-urls)

charts/greptimedb-cluster/values.yaml (2)

1051-1058: Add documentation about volume usage

Consider adding a comment explaining what data is being persisted and any retention policies.

  # -- The jaeger-all-in-one persistence configuration.
  volume:
-    # -- Whether to enable the persistence for jaeger-all-in-one.
+    # -- Whether to enable the persistence for jaeger-all-in-one.
+    # This volume stores trace data and should be sized based on your retention needs.
     enabled: true

1060-1064: Enhance collector configuration comments

Add port numbers to the comments for better clarity.

-  # -- Enable the zipkin collector for jaeger-all-in-one and listen on port 9411.
+  # -- Enable the Zipkin collector for jaeger-all-in-one (listens on port 9411 for HTTP).
   enableHttpZipkinCollector: true

-  # -- Enable the opentelemetry collector for jaeger-all-in-one and listen on port 4317.
+  # -- Enable the OpenTelemetry collector for jaeger-all-in-one (listens on port 4317 for gRPC).
   enableHttpOpenTelemetryCollector: true
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 626f29f and ef4d7fe.

⛔ Files ignored due to path filters (1)
  • charts/greptimedb-cluster/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/ci.yaml (1 hunks)
  • charts/greptimedb-cluster/Chart.yaml (2 hunks)
  • charts/greptimedb-cluster/README.md (3 hunks)
  • charts/greptimedb-cluster/values.yaml (1 hunks)
  • scripts/e2e/greptimedb-cluster.sh (1 hunks)
  • scripts/release/release-charts-to-acr.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • charts/greptimedb-cluster/Chart.yaml
  • scripts/release/release-charts-to-acr.sh
🧰 Additional context used
🪛 Markdownlint (0.35.0)
charts/greptimedb-cluster/README.md

77-77: null
Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (7)
.github/workflows/ci.yaml (1)

31-31: ⚠️ Potential issue

Security & Reliability Concerns with Helm Repository Source

The current implementation raises several concerns:

  1. The repository URL points to a personal GitHub account which poses security and reliability risks
  2. Using raw.githubusercontent.com for Helm repositories is not recommended for production use
  3. There's no integrity verification of the charts

Consider these alternatives:

  1. Use the official Jaeger Helm repository or OCI registry
  2. If using a third-party source is necessary:
    • Mirror the charts to your organization's registry
    • Add integrity verification
    • Document the security implications

Example implementation using the official Jaeger repository:

-helm repo add jaeger-all-in-one https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts/
+helm repo add jaegertracing https://jaegertracing.github.io/helm-charts

Let's verify if the official Jaeger chart provides the required functionality:

charts/greptimedb-cluster/README.md (2)

233-236: Previous review comments are still applicable

The concerns about using 'latest' tag for container images raised in the previous review are still valid.


237-237: Previous review comments are still applicable

The concerns about missing resource limits for jaeger-all-in-one raised in the previous review are still valid.

charts/greptimedb-cluster/values.yaml (4)

1028-1031: LGTM!

The basic configuration follows Helm chart best practices with clear comments and structure.


1034-1040: Avoid using 'latest' tag for container images

Using the 'latest' tag for container images can lead to unpredictable behavior and make it difficult to track which version is actually deployed.


1043-1049: LGTM!

The service configuration uses appropriate defaults and the standard Jaeger UI port.


1066-1073: Define resource limits for the Jaeger container

Missing resource limits could lead to resource contention or container eviction in a Kubernetes cluster.

scripts/e2e/greptimedb-cluster.sh Show resolved Hide resolved
@zyy17 zyy17 force-pushed the feat/add-jaeger-dev branch from ef4d7fe to 7f5b269 Compare November 28, 2024 03:24
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (2)
charts/greptimedb-cluster/README.md (1)

77-77: Fix markdown lint issue: Use proper link format

The URL should be properly formatted as a markdown link.

-| https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts | jaeger-all-in-one | 0.1.12 |
+| [jaeger-all-in-one charts](https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts) | jaeger-all-in-one | 0.1.12 |
🧰 Tools
🪛 Markdownlint (0.35.0)

77-77: null
Bare URL used

(MD034, no-bare-urls)

charts/greptimedb-cluster/values.yaml (1)

1043-1049: Consider adding security context for the service

The service configuration should include security-related annotations, especially since Jaeger handles trace data which might contain sensitive information.

  service:
    type: ClusterIP
    port: 16686
-   annotations: {}
+   annotations:
+     security.alpha.kubernetes.io/pod-security-standards: restricted
+     security.alpha.kubernetes.io/network-policy: enabled
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ef4d7fe and 7f5b269.

⛔ Files ignored due to path filters (1)
  • charts/greptimedb-cluster/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/ci.yaml (1 hunks)
  • charts/greptimedb-cluster/Chart.yaml (2 hunks)
  • charts/greptimedb-cluster/README.md (3 hunks)
  • charts/greptimedb-cluster/values.yaml (1 hunks)
  • scripts/e2e/greptimedb-cluster.sh (1 hunks)
  • scripts/release/release-charts-to-acr.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/ci.yaml
  • charts/greptimedb-cluster/Chart.yaml
  • scripts/e2e/greptimedb-cluster.sh
  • scripts/release/release-charts-to-acr.sh
🧰 Additional context used
🪛 Markdownlint (0.35.0)
charts/greptimedb-cluster/README.md

77-77: null
Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (5)
charts/greptimedb-cluster/README.md (2)

5-5: LGTM: Version bump is correctly documented

The version badge has been updated to reflect the new version 0.2.37.


229-245: ⚠️ Potential issue

Security and operational concerns in jaeger-all-in-one configuration

Several issues need to be addressed:

  1. The image tag is set to 'latest' which is not recommended for production use
  2. No resource limits are defined which could lead to resource exhaustion
  3. The volume size of 3Gi might be insufficient for production workloads

Additional recommendations:

  1. Consider adding network policies to restrict access to the collectors
  2. Document the security implications of enabling both OpenTelemetry and Zipkin collectors

Would you like me to provide a complete example of network policies for securing the Jaeger deployment?

charts/greptimedb-cluster/values.yaml (3)

1028-1031: LGTM: Basic deployment configuration looks good

The configuration follows Helm chart best practices with proper comments and default values.


1034-1040: Avoid using 'latest' tag for container images

Using the 'latest' tag can lead to unpredictable behavior and make it difficult to track which version is actually deployed.


1066-1073: Define resource limits for the Jaeger container

Missing resource limits could lead to resource contention or container eviction in a Kubernetes cluster.

charts/greptimedb-cluster/values.yaml Show resolved Hide resolved
charts/greptimedb-cluster/values.yaml Show resolved Hide resolved
charts/greptimedb-cluster/values.yaml Show resolved Hide resolved
@zyy17 zyy17 merged commit 9031cac into GreptimeTeam:main Nov 28, 2024
3 checks passed
@zyy17 zyy17 deleted the feat/add-jaeger-dev branch November 28, 2024 03:36
@coderabbitai coderabbitai bot mentioned this pull request Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants