Skip to content

Conversation

@twtaylor
Copy link
Contributor

@twtaylor twtaylor commented Nov 6, 2025

  • Added metrics configuration to values.yaml, enabling metrics collection and telemetry.
  • Introduced ClusterRole and ClusterRoleBinding for metrics scraping in service-account.yaml.
  • Created metrics-config ConfigMap for OpenTelemetry agent configuration.
  • Added metrics-agent deployment template to manage the OpenTelemetry collector.
  • Implemented helper function for generating installation UUID in _helpers.tpl.

This update enhances observability by integrating metrics collection capabilities into the Plane Enterprise Helm chart.

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • New Features

    • Introduced metrics and telemetry configuration options to enable OpenTelemetry-based system monitoring and observability.
  • Documentation

    • Added Metrics and Telemetry Configuration documentation with guidance on HTTP endpoints, collection intervals, and setup instructions.

✏️ Tip: You can customize this high-level summary in your review settings.

- Added metrics configuration to values.yaml, enabling metrics collection and telemetry.
- Introduced ClusterRole and ClusterRoleBinding for metrics scraping in service-account.yaml.
- Created metrics-config ConfigMap for OpenTelemetry agent configuration.
- Added metrics-agent deployment template to manage the OpenTelemetry collector.
- Implemented helper function for generating installation UUID in _helpers.tpl.

This update enhances observability by integrating metrics collection capabilities into the Plane Enterprise Helm chart.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

This pull request adds OpenTelemetry (OTEL) metrics and telemetry configuration to the Helm chart. A new metrics configuration block is introduced in values.yaml with telemetry endpoints and options. The configuration is conditionally passed to the application through environment variables in the app-env template. Additionally, the silo secret template is updated to decode base64-encoded HMAC keys before applying fallback defaults.

Changes

Cohort / File(s) Summary
Metrics Configuration & Documentation
charts/plane-enterprise/values.yaml, charts/plane-enterprise/README.md
Adds top-level metrics configuration block with enabled flag and telemetry subsection (containing http_endpoint, http_v2_endpoint, headers, push_interval_minutes). Corresponding documentation section added to README describing OTEL/OTLP behavior and configuration options.
Metrics Environment Variables
charts/plane-enterprise/templates/config-secrets/app-env.yaml
Conditionally injects metrics telemetry environment variables (OTLP_ENDPOINT, OTLP_V2_ENDPOINT, OTEL_EXPORTER_OTLP_PROTOCOL, METRICS_PUSH_INTERVAL_MINUTES) into App Vars ConfigMap when metrics.enabled is true.
Secret Decoding
charts/plane-enterprise/templates/config-secrets/silo.yaml
Updates HMAC secret key retrieval to apply base64 decoding (b64dec) before applying the default fallback value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Configuration addition is straightforward and follows established patterns
  • Template conditional logic is minimal and isolated to a single block
  • Base64 decoding change is a localized, low-risk adjustment
  • Minor areas for attention:
    • Verify that base64 decoding in silo.yaml handles missing/empty values gracefully
    • Confirm environment variable interpolation in app-env.yaml aligns with application expectations
    • Check that metrics.telemetry subsections match required OTEL endpoint formats

Poem

🐰 Metrics flow like carrots through the garden,
OTEL endpoints stand ready, no need for pardon,
Base64 secrets decoded with care,
Telemetry data drifting through the air! 📊✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: implementing metrics collection for Plane Enterprise. It accurately reflects the PR's core purpose of adding metrics and telemetry capabilities.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/metrics-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@twtaylor twtaylor marked this pull request as ready for review November 25, 2025 23:45
- Increased the batch timeout in values.yaml from 60s to 300s for improved metrics publishing frequency.
- Added license domain to metrics-config.yaml to enhance configuration clarity.

These changes optimize metrics collection and provide better configuration management for the Plane Enterprise Helm chart.
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: 2

🧹 Nitpick comments (2)
charts/plane-enterprise/values.yaml (1)

399-429: Telemetry defaults and installation UUID expectations

The new metrics block looks structurally fine, but two behavioral points are worth calling out:

  • metrics.enabled: true together with a non‑empty default telemetry.http_endpoint means that, out of the box, clusters will start exporting metrics (including installation + cluster metadata) to Plane’s SaaS endpoint. That’s a product/compliance decision rather than a bug, but it’s worth double‑checking this is intentional and clearly documented for operators who expect “no external telemetry by default.”
  • The comment uuid: "" # Auto-generated if empty relies on the helper in _helpers.tpl. As implemented, that helper generates a fresh UUID on each template invocation when unset, so the “installation UUID” is not truly stable unless users explicitly provide one. You may want to either (a) require users to set an explicit UUID in values, or (b) implement a stable generation mechanism (e.g., via lookup+Secret or a deterministic hash) so the behavior matches the comment.
charts/plane-enterprise/templates/service-account.yaml (1)

12-67: Cluster‑scoped RBAC: consider configurability / documentation

The new ClusterRole + ClusterRoleBinding look reasonable for a metrics agent, but they are cluster‑scoped and created automatically whenever metrics.enabled is true.

Many operators prefer to manage cluster‑scoped RBAC separately. Consider either:

  • adding a metrics.rbac.create (or similar) flag to allow disabling in‑chart RBAC, or
  • clearly documenting that enabling metrics will create these cluster‑level roles/bindings and that cluster‑admin privileges are required for installation.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a15445 and 5ce1e11.

📒 Files selected for processing (5)
  • charts/plane-enterprise/templates/_helpers.tpl (1 hunks)
  • charts/plane-enterprise/templates/config-secrets/metrics-config.yaml (1 hunks)
  • charts/plane-enterprise/templates/service-account.yaml (1 hunks)
  • charts/plane-enterprise/templates/workloads/metrics-agent.deployment.yaml (1 hunks)
  • charts/plane-enterprise/values.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
charts/plane-enterprise/templates/workloads/metrics-agent.deployment.yaml

[warning] 90-90: too many blank lines (1 > 0)

(empty-lines)


[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

charts/plane-enterprise/templates/config-secrets/metrics-config.yaml

[warning] 163-163: too many blank lines (1 > 0)

(empty-lines)


[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🔇 Additional comments (2)
charts/plane-enterprise/templates/workloads/metrics-agent.deployment.yaml (1)

57-63: I'll verify the regexReplaceAll function signature and behavior in Helm/Sprig to confirm whether the original review comment's analysis is correct.
<function_calls>

Helm Sprig regexReplaceAll function signature arguments order

</function_calls>

I'll also search the repository for examples of regexReplaceAll usage to understand the actual patterns:
<function_calls>

shell
#!/bin/bash

Search for existing regexReplaceAll usages in the repository

rg "regexReplaceAll" -n -B2 -A2 --type yaml --type yaml


</function_calls>

charts/plane-enterprise/templates/config-secrets/metrics-config.yaml (1)

86-94: The review comment's claim about regexReplaceAll argument order is incorrect.

After verifying the Sprig template function documentation, the correct signature for regexReplaceAll is:

regexReplaceAll "<pattern>" "<input>" "<replacement>"

The actual code at lines 92-93 follows this signature correctly:

  • Line 92: regexReplaceAll "Mi|Gi" (.Values.metrics.agent.memoryLimit | default "256Mi") ""
    • Pattern: "Mi|Gi"
    • Input: (.Values.metrics.agent.memoryLimit | default "256Mi")
    • Replacement: ""

This correctly removes the "Mi" or "Gi" suffix from the memory limit value (e.g., "256Mi""256"), which is the intended behavior.

The review comment incorrectly claims the signature is (regex, replacement, src) and proposes a "fix" that would actually swap the input and replacement arguments, breaking the template. The original code is correct as written.

Likely an incorrect or invalid review comment.

@twtaylor twtaylor changed the title feat: Implement metrics collection for Plane Enterprise [PULSE-223] feat: Implement metrics collection for Plane Enterprise Nov 25, 2025
@makeplane
Copy link

makeplane bot commented Nov 25, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

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: 2

♻️ Duplicate comments (1)
charts/plane-enterprise/templates/config-secrets/metrics-config.yaml (1)

112-123: ** Fix OTLP/HTTP endpoint format and TLS certificate verification.**

This was flagged in previous review. The endpoint transformation (lines 113–117) strips the scheme and path, then appends :443, producing an invalid format for OTLP/HTTP exporter.

OTLP/HTTP requires a full URL with scheme and path (e.g., https://v2.metrics.plane.so:443/v1/traces), not a host:port string.

Additionally, tls.insecure: true (line 123) disables TLS certificate verification by default—a security downgrade for external telemetry export. The TODO comment (line 122) acknowledges this is incomplete.

Proposed fix:

  1. Preserve the scheme in the input URL or reconstruct it (default to https:// if missing).
  2. Preserve the path (/v1/traces or /v1/metrics) in the endpoint URL.
  3. Add a config option metrics.telemetry.tlsInsecure (default false) to allow opt-in certificate verification bypass.

Example reconstruction:

{{- $urlWithScheme := .Values.metrics.telemetry.http_endpoint }}
{{- if not (hasPrefix "https://" $urlWithScheme) }}
  {{- if not (hasPrefix "http://" $urlWithScheme) }}
    {{- $urlWithScheme = printf "https://%s" $urlWithScheme }}
  {{- end }}
{{- end }}
endpoint: {{ $urlWithScheme }}
tls:
  insecure: {{ .Values.metrics.telemetry.tlsInsecure | default false }}

Then add to values.yaml:

telemetry:
  http_endpoint: "https://v2.metrics.plane.so/v1/traces"
  tlsInsecure: false  # Set to true only for development/testing
  headers: {}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ce1e11 and 849aa2d.

📒 Files selected for processing (2)
  • charts/plane-enterprise/templates/config-secrets/metrics-config.yaml (1 hunks)
  • charts/plane-enterprise/values.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
charts/plane-enterprise/templates/config-secrets/metrics-config.yaml

[warning] 165-165: too many blank lines (1 > 0)

(empty-lines)


[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🔇 Additional comments (1)
charts/plane-enterprise/values.yaml (1)

400-429: No inconsistency exists between values.yaml and metrics-config.yaml for batch timeout.

The review comment misunderstands Helm template default behavior. In metrics-config.yaml line 89, the syntax {{ .Values.metrics.agent.batch.timeout | default "60s" }} means the "60s" is a fallback DEFAULT, used only if .Values.metrics.agent.batch.timeout is not provided. Since values.yaml line 426 explicitly sets batch.timeout: "300s", this value overrides the template default. The 300s will be applied—not 60s. This is correct Helm behavior and represents intentional configuration override, not an inconsistency.

The first concern about metrics.enabled: true being a default is a valid operational consideration for product review (potential impact on cluster load and telemetry data retention), though it's a design choice rather than a technical issue.

Likely an incorrect or invalid review comment.

- Introduced a new field `push_interval_minutes` in values.yaml for configuring the telemetry push interval.
- Updated app-env.yaml to conditionally set the `METRICS_PUSH_INTERVAL_MINUTES` environment variable based on the new configuration.

These changes enhance the flexibility of metrics collection in the Plane Enterprise Helm chart.
- Deleted the metrics agent configuration from values.yaml, including the agent settings and deployment template.
- Removed the associated metrics-config.yaml file, which contained the OpenTelemetry agent configuration.

These changes streamline the Helm chart by eliminating the metrics agent, simplifying the configuration for users.
- Introduced the `OTEL_EXPORTER_OTLP_PROTOCOL` environment variable with a default value of "http/protobuf" to enhance OpenTelemetry configuration for metrics telemetry.

This change improves the flexibility and compatibility of metrics collection in the Plane Enterprise Helm chart.
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

🧹 Nitpick comments (1)
charts/plane-enterprise/templates/config-secrets/app-env.yaml (1)

85-85: Consider making OTEL_EXPORTER_OTLP_PROTOCOL configurable.

The protocol is hardcoded to "http/protobuf". While this is a sensible default, consider exposing it as a configurable value in values.yaml (e.g., metrics.telemetry.protocol) to support environments that may require alternative OTLP protocols (gRPC, JSON, etc.) in the future.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 849aa2d and 3f9f03e.

📒 Files selected for processing (2)
  • charts/plane-enterprise/templates/config-secrets/app-env.yaml (1 hunks)
  • charts/plane-enterprise/values.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • charts/plane-enterprise/values.yaml
🔇 Additional comments (2)
charts/plane-enterprise/templates/config-secrets/app-env.yaml (2)

84-84: Assess impact of empty default for OTLP_ENDPOINT.

When metrics.enabled=true but metrics.telemetry.http_endpoint is not provided in values.yaml, OTLP_ENDPOINT will be set to an empty string. Verify whether:

  • The application gracefully handles a missing/empty OTLP endpoint, or
  • This represents a misconfiguration that should fail fast with a validation error in values.yaml

83-89: Conditional metrics configuration structure is sound.

The metrics block correctly:

  • Gates all metrics variables behind the metrics.enabled flag
  • Follows established Helm templating patterns used elsewhere in the file (compare lines 13-17, 27-33, 71-73)
  • Uses defensive conditional for optional METRICS_PUSH_INTERVAL_MINUTES

- Updated values.yaml to provide detailed comments on the installation UUID configuration for better clarity on its usage and persistence.
- Improved the installation UUID generation logic in _helpers.tpl to ensure consistent UUIDs across Helm renders and provide fallback mechanisms.
- Introduced a new Secret template (installation-uuid.yaml) to store the installation UUID, ensuring it persists across upgrades and can be referenced securely in workloads.

These changes enhance the telemetry correlation capabilities and improve the overall user experience when configuring metrics in the Plane Enterprise Helm chart.
…erprise Helm chart

- Modified values.yaml to update the primary telemetry endpoint and add a new v2 telemetry endpoint for improved metrics collection.
- Updated app-env.yaml to include the new OTLP v2 endpoint for better OpenTelemetry configuration.
- Adjusted silo.yaml to decode the HMAC secret key from base64, ensuring proper handling of sensitive data.

These changes enhance the telemetry capabilities and improve the security of secret management in the Plane Enterprise Helm chart.
- Removed the installation UUID configuration from values.yaml and associated comments for clarity.
- Deleted the installation-uuid Secret template to streamline the Helm chart and eliminate unnecessary complexity.
- Updated the _helpers.tpl file to remove the installation UUID generation logic, simplifying the template structure.

These changes enhance the overall maintainability of the Plane Enterprise Helm chart by reducing redundancy in UUID management.
…ated ClusterRole and ClusterRoleBinding from service-account.yaml

- Modified values.yaml to include the full path for telemetry endpoints, ensuring proper configuration for OTLP exporters.
- Removed the ClusterRole and ClusterRoleBinding definitions related to metrics scraping from service-account.yaml to streamline the Helm chart.

These changes enhance the clarity of telemetry configurations and simplify the service account setup in the Plane Enterprise Helm chart.
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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c6a995 and f7d0e34.

📒 Files selected for processing (2)
  • charts/plane-enterprise/README.md (1 hunks)
  • charts/plane-enterprise/values.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • charts/plane-enterprise/values.yaml
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
charts/plane-enterprise/README.md

497-497: Bare URL used

(MD034, no-bare-urls)


498-498: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (1)
charts/plane-enterprise/README.md (1)

492-508: Documentation section is well‑structured and appropriately detailed.

The new "Metrics and Telemetry Configuration" section follows the existing documentation style and provides clear guidance on metrics configuration. The table format is consistent with other configuration sections, and the notes section helpfully explains path requirements, data scope, and behavior when disabled.

SILO_HMAC_SECRET_KEY: {{ .Values.env.silo_envs.hmac_secret_key | quote }}
{{- else if (lookup "v1" "Secret" .Release.Namespace (printf "%s-silo-secrets" .Release.Name)) }}
SILO_HMAC_SECRET_KEY: {{ (lookup "v1" "Secret" .Release.Namespace (printf "%s-silo-secrets" .Release.Name)).data.SILO_HMAC_SECRET_KEY | default (randAlphaNum 32) | quote }}
SILO_HMAC_SECRET_KEY: {{ (lookup "v1" "Secret" .Release.Namespace (printf "%s-silo-secrets" .Release.Name)).data.SILO_HMAC_SECRET_KEY | b64dec | default (randAlphaNum 32) | quote }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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