Skip to content
Merged
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
64 changes: 0 additions & 64 deletions custom_health_checks/README.md

This file was deleted.

Empty file removed custom_health_checks/__init__.py
Empty file.
16 changes: 0 additions & 16 deletions custom_health_checks/apps.py

This file was deleted.

24 changes: 0 additions & 24 deletions custom_health_checks/backends.py

This file was deleted.

44 changes: 0 additions & 44 deletions custom_health_checks/tests/test_backends.py

This file was deleted.

29 changes: 0 additions & 29 deletions custom_health_checks/tests/test_healthz.py

This file was deleted.

33 changes: 0 additions & 33 deletions custom_health_checks/views.py

This file was deleted.

8 changes: 5 additions & 3 deletions palvelutarjotin/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@
COMMIT_HASH = env("OPENSHIFT_BUILD_COMMIT")
VERSION = __version__

# Django helsinki health endpoints
SENTRY_RELEASE = env("SENTRY_RELEASE")

SENTRY_TRACES_SAMPLE_RATE = env("SENTRY_TRACES_SAMPLE_RATE")
SENTRY_TRACES_IGNORE_PATHS = env.list("SENTRY_TRACES_IGNORE_PATHS")

Expand All @@ -199,7 +202,7 @@ def sentry_traces_sampler(sampling_context: SamplingContext) -> float:
sentry_sdk.init(
dsn=env("SENTRY_DSN"),
environment=env("SENTRY_ENVIRONMENT"),
release=env("SENTRY_RELEASE"),
release=SENTRY_RELEASE,
integrations=[DjangoIntegration()],
traces_sampler=sentry_traces_sampler,
profile_session_sample_rate=env("SENTRY_PROFILE_SESSION_SAMPLE_RATE"),
Expand Down Expand Up @@ -249,9 +252,8 @@ def sentry_traces_sampler(sampling_context: SamplingContext) -> float:
"auditlog",
"auditlog_extra",
"resilient_logger",
"health_check",
"helsinki_health_endpoints",
# local apps under this line
"custom_health_checks",
"utils",
"organisations",
"occurrences",
Expand Down
23 changes: 1 addition & 22 deletions palvelutarjotin/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@
from csp.decorators import csp_update
from django.conf import settings
from django.conf.urls.static import static
from django.http import JsonResponse
from django.urls import include, path, re_path
from django.utils.translation import gettext
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods
from drf_spectacular.views import (
SpectacularAPIView,
SpectacularRedocView,
)
from helusers.admin_site import admin

from common.utils import get_api_version
from custom_health_checks.views import HealthCheckJSONView
from palvelutarjotin import __version__
from palvelutarjotin.views import SentryGraphQLView

admin.site.index_title = " ".join([gettext("Kultus API"), get_api_version()])
Expand Down Expand Up @@ -57,25 +53,8 @@ def graphql_view(request, *args, **kwargs):
]


#
# Kubernetes liveness & readiness probes
#
@require_http_methods(["GET", "HEAD"])
def readiness(*args, **kwargs):
response_json = {
"status": "ok",
"release": settings.APP_RELEASE,
"packageVersion": __version__,
"commitHash": settings.COMMIT_HASH,
"buildTime": settings.APP_BUILD_TIME.strftime("%Y-%m-%dT%H:%M:%S.000Z"),
}
return JsonResponse(response_json, status=200)


urlpatterns += [
path(r"healthz", HealthCheckJSONView.as_view(), name="healthz"),
path("readiness", readiness),
]
urlpatterns += [path("", include("helsinki_health_endpoints.urls"))]


if settings.DEBUG:
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ django-csp
django-environ
django-filter
django-graphql-jwt
django-health-check
django-helusers
django-helsinki-health-endpoints
django-ilmoitin
django-ipware
django-logger-extra
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ django==5.2.12 \
# django-csp
# django-filter
# django-graphql-jwt
# django-health-check
# django-helsinki-health-endpoints
# django-helusers
# django-ilmoitin
# django-logger-extra
Expand Down Expand Up @@ -344,9 +344,9 @@ django-graphql-jwt==0.4.0 \
--hash=sha256:537972519f0deeec7a0e4a306ddfed1fe385266ef61c9f78c54cd04ac01a171e \
--hash=sha256:5823aa8ac9bf0b7a6e3b2febd029598b332c41fe9043d89900c116fcecd23f5e
# via -r requirements.in
django-health-check==3.20.0 \
--hash=sha256:bcb2b8f36f463cead0564a028345c5b17e2a2d18e9cc88ecd611b13a26521926 \
--hash=sha256:cd69ac5facf73fe7241d9492d939b57bd20e24f46c4edea91e6a900bf22c2d8e
django-helsinki-health-endpoints==1.0.0 \
--hash=sha256:75670113e99bfd1fc23e317a3a22cff563140f495655c2a5f6ab219389dafd52 \
--hash=sha256:eebf1baa6917d7b0e11123aec191df773883102ec1653025a86d7037dba389e2
# via -r requirements.in
django-helusers==1.0.0 \
--hash=sha256:0e33e238347a4088927675574a7dad179ee1f9d9e958daecfa4862ad6f63f79c \
Expand Down
Loading