Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,13 @@ services:
<<: *depends_on-healthy
profiles:
- feature-complete

chartcuterie:
<<: [*restart_policy, *pull_policy]
image: "$CHARTCUTERIE_IMAGE"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The chartcuterie service in docker-compose.yml uses the $CHARTCUTERIE_IMAGE variable, which is not defined in the .env file, causing the service to fail when enabled.
Severity: HIGH

Suggested Fix

Define the CHARTCUTERIE_IMAGE variable in the .env file, similar to how other service images like SENTRY_IMAGE and SNUBA_IMAGE are defined. This will provide a valid image for Docker Compose to use when the chartcuterie profile is active.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: docker-compose.yml#L857

Potential issue: The `chartcuterie` Docker Compose service references the
`$CHARTCUTERIE_IMAGE` environment variable for its image source. However, this variable
is not defined in the `.env` file, unlike other services such as `sentry` or `snuba`.
When a developer enables the `chartcuterie` profile, Docker Compose will substitute an
empty string for the image name. This will cause the `docker-compose up` command to fail
for the `chartcuterie` service, preventing it from starting.

Did we get this right? 👍 / 👎 to inform future reviews.

environment:
CHARTCUTERIE_CONFIG: "http://web:9000/_chartcuterie-config.js"
profiles:
- chartcuterie
volumes:
# These store application data that should persist across restarts.
sentry-data:
Expand Down
23 changes: 22 additions & 1 deletion sentry/sentry.conf.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_internal_network():
# `COMPOSE_PROFILES` to `errors-only`.
#
# See https://develop.sentry.dev/self-hosted/optional-features/errors-only/
SENTRY_SELF_HOSTED_ERRORS_ONLY = env("COMPOSE_PROFILES") != "feature-complete"
SENTRY_SELF_HOSTED_ERRORS_ONLY = "errors-only" in env("COMPOSE_PROFILES")

# When running in an air-gapped environment, set this to True to entirely disable
# external network calls and features that require Internet connectivity.
Expand Down Expand Up @@ -448,6 +448,27 @@ def get_internal_network():
}
)

################
# Chartcuterie #
################

# Chartcuterie is a service that generates charts outside browser environment.
# It is used pretty much to create charts for metric alerts for Slack integration.
# At the time of writing, there are no other use case that depends on Chartcuterie.
#
# To enable it, add `chartcuterie` to `COMPOSE_PROFILES` in your `.env` file.
# An example would be:
# ```env
# COMPOSE_PROFILES=feature-complete,chartcuterie
Comment on lines +459 to +462

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Install scripts use an exact string match for COMPOSE_PROFILES, which fails when multiple profiles are set as recommended in the documentation, breaking profiling features.
Severity: HIGH

Suggested Fix

Update the conditional checks in bootstrap-s3-profiles.sh, ensure-correct-permissions-profiles-dir.sh, and wrap-up.sh to use glob matching (e.g., [[ "$COMPOSE_PROFILES" == *"feature-complete"* ]]) instead of exact string equality. This will correctly handle comma-separated, multi-profile values.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: sentry/sentry.conf.example.py#L459-L462

Potential issue: Multiple install scripts, including `bootstrap-s3-profiles.sh` and
`ensure-correct-permissions-profiles-dir.sh`, check the `COMPOSE_PROFILES` variable
using an exact string match (`== "feature-complete"`). However, the documentation
encourages setting a multi-profile value like `feature-complete,chartcuterie`. When a
user follows this documentation, the exact match fails, causing the scripts to silently
skip critical setup steps. This results in a broken installation for profiling features,
as the SeaweedFS `profiles` bucket is not created and directory permissions are not set
correctly.

Also affects:

  • install/bootstrap-s3-profiles.sh:13
  • install/ensure-correct-permissions-profiles-dir.sh:6
  • install/wrap-up.sh:36

# ```

if "chartcuterie" in env("COMPOSE_PROFILES"):
SENTRY_FEATURES["organizations:metric-alert-chartcuterie"] = True
SENTRY_OPTIONS["chart-rendering.enabled"] = True
SENTRY_OPTIONS["chart-rendering.chartcuterie"] = {
"url": "http://chartcuterie:9090"
}

#######################
# MaxMind Integration #
#######################
Expand Down
Loading