Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ TASKBROKER_IMAGE=ghcr.io/getsentry/taskbroker:nightly
VROOM_IMAGE=ghcr.io/getsentry/vroom:nightly
UPTIME_CHECKER_IMAGE=ghcr.io/getsentry/uptime-checker:nightly
LAUNCHPAD_IMAGE=ghcr.io/getsentry/launchpad:nightly
CHARTCUTERIE_IMAGE=ghcr.io/getsentry/chartcuterie:nightly
HEALTHCHECK_INTERVAL=30s
HEALTHCHECK_TIMEOUT=1m30s
HEALTHCHECK_RETRIES=10
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ body:
- [ ] [`uptime-checker`](https://github.com/getsentry/uptime-checker/actions/workflows/release.yml)
- [ ] [`taskbroker`](https://github.com/getsentry/taskbroker/actions/workflows/release.yml)
- [ ] [`launchpad`](https://github.com/getsentry/launchpad/actions/workflows/release.yml)
- [ ] [`chartcuterie`](https://github.com/getsentry/chartcuterie/actions/workflows/release.yml)
- [ ] Release self-hosted.
- [ ] [Prepare the `self-hosted` release](https://github.com/getsentry/self-hosted/actions/workflows/release.yml) (_replace with publish issue repo link_).
- [ ] Check to make sure the new release branch in self-hosted includes the appropriate CalVer images.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
container_engine: ['docker'] # TODO: add 'podman' into the list
compose_profiles: ['feature-complete', 'errors-only']
name: ${{ format('integration test{0}{1}{2}', matrix.os == 'ubuntu-24.04-arm' && ' (arm64)' || '', matrix.container_engine == 'podman' && ' (podman)' || '', matrix.compose_profiles == 'errors-only' && ' (errors-only)' || '') }}
compose_profiles: ['feature-complete', 'errors-only', 'errors-only,chartcuterie']
Comment thread
cursor[bot] marked this conversation as resolved.
name: ${{ format('integration test{0}{1}{2}', matrix.os == 'ubuntu-24.04-arm' && ' (arm64)' || '', matrix.container_engine == 'podman' && ' (podman)' || '', matrix.compose_profiles != 'feature-complete' && format(' ({0})', matrix.compose_profiles) || '' ) }}
env:
REPORT_SELF_HOSTED_ISSUES: 0
SELF_HOSTED_TESTING_DSN: ${{ vars.SELF_HOSTED_TESTING_DSN }}
Expand Down
28 changes: 13 additions & 15 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ runs:
exit 1
fi

# `COMPOSE_PROFILES` may only be `feature-complete` or `errors-only`
if [[ "$COMPOSE_PROFILES" != "" && "$COMPOSE_PROFILES" != "feature-complete" && "$COMPOSE_PROFILES" != "errors-only" ]]; then
echo "COMPOSE_PROFILES must be either unset, or set to either 'feature-complete' or 'errors-only'."
exit 1
else
echo "COMPOSE_PROFILES=$COMPOSE_PROFILES" >> ${{ github.action_path }}/.env
fi
# Compose profiles can be anything at this point
echo "COMPOSE_PROFILES=$COMPOSE_PROFILES" >> ${{ github.action_path }}/.env

# Cleanup compose profile string, it must not contains commas. Therefore we replace it with dashes.
echo "COMPOSE_PROFILES_CLEAN=${COMPOSE_PROFILES//,/-}" >> "$GITHUB_ENV"

- name: Cleanup runner image
shell: bash
Expand Down Expand Up @@ -123,9 +121,9 @@ runs:
id: restore_cache_sentry
uses: BYK/docker-volume-cache-action/restore@0efa5cf5178c9906cb46ed8d1a357df8fd6b1a06
with:
key: db-volumes-sentry-v3-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}
key: db-volumes-sentry-v3-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}
restore-keys: |
key: db-volumes-sentry-v3-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}
key: db-volumes-sentry-v3-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}
volumes: |
sentry-postgres

Expand All @@ -134,9 +132,9 @@ runs:
id: restore_cache_snuba
uses: BYK/docker-volume-cache-action/restore@0efa5cf5178c9906cb46ed8d1a357df8fd6b1a06
with:
key: db-volumes-snuba-v3-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
key: db-volumes-snuba-v3-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
restore-keys: |
key: db-volumes-snuba-v3-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}
key: db-volumes-snuba-v3-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}
volumes: |
sentry-clickhouse

Expand All @@ -145,10 +143,10 @@ runs:
id: restore_cache_kafka
uses: BYK/docker-volume-cache-action/restore@0efa5cf5178c9906cb46ed8d1a357df8fd6b1a06
with:
key: db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
key: db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}-${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
restore-keys: |
db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}
db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ inputs.compose_profiles }}
db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}
db-volumes-kafka-v2-${{ steps.cache_key.outputs.ARCH }}-${{ env.COMPOSE_PROFILES_CLEAN }}
volumes: |
sentry-kafka

Expand Down Expand Up @@ -226,7 +224,7 @@ runs:
npm ci

- name: Setup required Emerge Tools files
if: inputs.compose_profiles == 'feature-complete'
if: contains(inputs.compose_profiles, 'feature-complete')
shell: bash
run: |
set -euo pipefail
Expand Down
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
4 changes: 4 additions & 0 deletions install/update-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ $CONTAINER_ENGINE pull ${VROOM_IMAGE} || true
$CONTAINER_ENGINE pull ${UPTIME_CHECKER_IMAGE} || true
$CONTAINER_ENGINE pull ${LAUNCHPAD_IMAGE} || true

if [[ "$COMPOSE_PROFILES" == *"chartcuterie"* ]]; then
$CONTAINER_ENGINE pull ${CHARTCUTERIE_IMAGE} || true
fi

echo "${_endgroup}"
2 changes: 1 addition & 1 deletion scripts/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -eu
OLD_VERSION="${CRAFT_OLD_VERSION:-${1:-}}"
NEW_VERSION="${CRAFT_NEW_VERSION:-${2:-}}"

sed -i -e "s/^\(SENTRY\|SNUBA\|RELAY\|SYMBOLICATOR\|TASKBROKER\|VROOM\|UPTIME_CHECKER\|LAUNCHPAD\)_IMAGE=\([^:]\+\):.\+\$/\1_IMAGE=\2:$NEW_VERSION/" .env
sed -i -e "s/^\(SENTRY\|SNUBA\|RELAY\|SYMBOLICATOR\|TASKBROKER\|VROOM\|UPTIME_CHECKER\|LAUNCHPAD\|CHARTCUTERIE\)_IMAGE=\([^:]\+\):.\+\$/\1_IMAGE=\2:$NEW_VERSION/" .env
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 bump-version.sh script incorrectly includes CHARTCUTERIE in the version bump process, leading to a non-existent image tag being used for the service.
Severity: HIGH

Suggested Fix

Remove CHARTCUTERIE from the list of services that have their image tags updated in the bump-version.sh script. It should be treated independently from the core Sentry services' coordinated release process.

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: scripts/bump-version.sh#L9

Potential issue: The `bump-version.sh` script now includes `CHARTCUTERIE` in the group
of services that have their image tags updated during a self-hosted release. Since
Chartcuterie is not part of the coordinated release process, its image tags (e.g.,
`:nightly`) do not align with the core Sentry versioning scheme (e.g., `:25.X.Y`). This
change will cause the script to set an invalid, non-existent image tag for the
`chartcuterie` service. Consequently, the service will fail to start on new
installations or when enabled for the first time, as the required Docker image will not
be found.

sed -i -e "s/^# Self-Hosted Sentry.*/# Self-Hosted Sentry $NEW_VERSION/" README.md

[ -z "$OLD_VERSION" ] || echo "Previous version: $OLD_VERSION"
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