Repository navigation
Multi-provider observability added - #19
Merged
Merged
Conversation
Co-authored-by: sourcepirate <sourcepirate@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented multi-provider observability for the cookiecutter template.
Template configuration (
cookiecutter.json:14): Addedobservabilityvar (comma-separated:none,sentry,datadog,newrelic,opentelemetry,all; legacyinclude_sentryretained for backward compat with OR checks).Dependencies (
{{ cookiecutter.project_slug }}/pyproject.toml:28,62): Conditional includes forsentry-sdk[django],ddtrace,newrelic, andopentelemetry-*(api/sdk/exporter/instrumentations for django/psycopg/celery/redis) via{% if 'x' in cookiecutter.observability or 'all' ... %}plus legacyinclude_sentry.Observability package (
{{ cookiecutter.project_slug }}/{{ cookiecutter.project_slug }}/observability/): Created__init__.py(centralinit_observability),sentry.py(Django+Celery+Redis integrations),datadog.py(ddtrace.patch_all()),newrelic.py(newrelic.agent.initialize()),otel.py(OTLP exporter + Django/Psycopg/Celery/Redis instrumentors). All guarded by env checks andtry/except ImportError. Addednewrelic.iniandotel-collector-config.yaml(conditional).Settings (
.../settings/production.py:64,local.py:88): Sentry init with traces/profiles, Datadogpatch_all, New Relic agent init, OTelTracerProvider+ exporters – each intry/except ImportErrorblocks conditional on Jinja.App entry (
.../wsgi.py:10,asgi.py:10): Earlyddtrace.patch_all()andnewrelic.agent.initialize()before Django import.Env/Docker (
.env.example:35,docker-compose.yml:65,116,162): Provider-specific env vars (SENTRY_DSN,DD_API_KEY,NEW_RELIC_LICENSE_KEY,OTEL_EXPORTER_OTLP_ENDPOINT) andotel-collectorservice (only when opentelemetry).Hook (
hooks/post_gen_project.py:98): Addedparse_observability()(handles string/list/all, respects legacy flag) and removal logic for unselected provider files (sentry.py,datadog.py,newrelic.py+newrelic.ini,otel.py+otel-collector-config.yaml).Docs (
README.md:22,{{ cookiecutter.project_slug }}/README.md:187,AGENTS.md:15): Documented providers, usage examples (--no-input observability=sentry|datadog|newrelic|opentelemetry|all|comma-list), env vars, SDKs, and generated files.Validation:
pytest tests/test_cookiecutter.py(14 passed),validate_template.py(10 passed), and generation matrix fornone,sentry,datadog,newrelic,opentelemetry,all,sentry,datadogverified dependencies, file existence, docker-compose, env, andcompile()syntax.Closes #18
opencode session | github run