self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

Enable new performance features in self-hosted

Open hubertdeng123 opened this issue 2 years ago • 6 comments
trafficstars

These features are rolling out to SaaS, let's get them in self-hosted.

  • [ ] Query Insights
  • [ ] Web Vitals
  • [ ] ...

hubertdeng123 avatar Nov 06 '23 20:11 hubertdeng123

Do we need additional snuba / sentry worker containers for query insights?

aldy505 avatar Nov 07 '23 00:11 aldy505

The same question

finoghentov avatar Dec 04 '23 16:12 finoghentov

Answered my own question, posted this on Discord on November 28, 2023. Forgot to put it here.

Anyway, as 23.11.2 is released, people can now try to use Performance Queries (https://docs.sentry.io/product/performance/queries/).

On sentry/sentry.conf.py, add these, then do ./install.sh again

SENTRY_FEATURES.update(
  {
    feature: True
    for feature in (
      # ... (other feature flags)
      # Enable database view powered by span metrics
      "organizations:performance-database-view",
      # Enable browser starfish webvitals module view
      "organizations:starfish-browser-webvitals",
      # Enable screens view powered by span metrics
      "organizations:performance-screens-view",
      # Enables the resource module ui
      "organizations:starfish-browser-resource-module-ui",
      # Starfish: extract metrics from the spans
      "projects:span-metrics-extraction",
      "projects:span-metrics-extraction-ga-modules",
      "projects:span-metrics-extraction-all-modules",
      "projects:span-metrics-extraction-resource",
      # ... (other feature flags)
    )
  }
)

No need to add new containers since the performance feature uses the Metrics API.

aldy505 avatar Dec 05 '23 05:12 aldy505

Thanks, having added this to my sentry.conf.py the upgrade does not succeed, the indentation of the config section seems to need to match the indentation of the rest of the config (4 space):

Traceback (most recent call last):
  File "/usr/local/bin/sentry", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/sentry/runner/__init__.py", line 195, in main
    func(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/sentry/runner/decorators.py", line 28, in inner
    configure()
  File "/usr/local/lib/python3.8/site-packages/sentry/runner/__init__.py", line 131, in configure
    _configure(ctx, py, yaml, skip_service_validation)
  File "/usr/local/lib/python3.8/site-packages/sentry/runner/settings.py", line 145, in configure
    hasattr(settings, "INSTALLED_APPS")
  File "/usr/local/lib/python3.8/site-packages/django/conf/__init__.py", line 82, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.8/site-packages/django/conf/__init__.py", line 69, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.8/site-packages/django/conf/__init__.py", line 170, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.8/site-packages/sentry/runner/default_settings.py", line 8, in <module>
    populate_module(sys.modules[__name__])
  File "/usr/local/lib/python3.8/site-packages/sentry/runner/importer.py", line 16, in populate_module
    _load_settings(SENTRY_CONF_PY, settings=settings_mod)
  File "/usr/local/lib/python3.8/site-packages/sentry/runner/importer.py", line 27, in _load_settings
    exec(source_file.read(), conf.__dict__)
  File "<string>", line 343
    for feature in (
    ^
SyntaxError: invalid syntax
Error in install/set-up-and-migrate-database.sh:12.
'$dcr web upgrade' exited with status 1
-> ./install.sh:main:34
--> install/set-up-and-migrate-database.sh:source:12

install/error-handling.sh: line 82: /usr/bin/docker: Argument list too long

Can i please confirm that the new config section needs to match the spacing of the rest of the config? Also i see other parts of the config that have a similar structure but there is no comma after Feature: true in those. Is the syntax correct?

Thanks!

braindigitalis avatar Dec 05 '23 10:12 braindigitalis

It looks like your sentry.conf.py file is malformed, you'll need to tweak it to make sure your spaces/commas are appropriately added. What does it look like?

hubertdeng123 avatar Dec 05 '23 22:12 hubertdeng123

It looks like your sentry.conf.py file is malformed, you'll need to tweak it to make sure your spaces/commas are appropriately added. What does it look like?

@hubertdeng123 I help them resolve this on Discord

aldy505 avatar Dec 06 '23 01:12 aldy505

Should be addressed in https://github.com/getsentry/self-hosted/pull/2861

hubertdeng123 avatar Mar 12 '24 18:03 hubertdeng123

Yeah I think we might be able to close this one since I think this is indeed all released now?

stayallive avatar Apr 03 '24 14:04 stayallive