Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-47594: Add Sentry tracing to Butler server #3886

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion applications/butler/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version: 1.0.0
description: Server for Butler data abstraction service
sources:
- https://github.com/lsst/daf_butler
appVersion: server-2.3.0
appVersion: tickets-DM-47594
1 change: 1 addition & 0 deletions applications/butler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Server for Butler data abstraction service
| config.additionalS3EndpointUrls | object | No additional URLs | Endpoint URLs for additional S3 services used by the Butler, as a mapping from profile name to URL. |
| config.dp02ClientServerIsDefault | bool | `false` | True if the 'dp02' Butler repository alias should use client/server Butler. False if it should use DirectButler. |
| config.dp02PostgresUri | string | No configuration file for DP02 will be generated. | Postgres connection string pointing to the registry database hosting Data Preview 0.2 data. |
| config.enableSentry | bool | `false` | True to enable capture of trace and other diagnostics to Sentry.io. |
| config.pathPrefix | string | `"/api/butler"` | The prefix of the path portion of the URL where the Butler service will be exposed. For example, if the service should be exposed at `https://data.lsst.cloud/api/butler`, this should be set to `/api/butler` |
| config.pguser | string | Use values specified in per-repository Butler config files. | Postgres username used to connect to the Butler DB |
| config.repositories | object | `{}` | Mapping from Butler repository label to Butler configuration URI for repositories which will be hosted by this server. |
Expand Down
4 changes: 4 additions & 0 deletions applications/butler/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
copy:
application: nublado
key: "postgres-credentials.txt"
"sentry-dsn":
description: >-
DSN URL where Sentry trace and error logging will be sent.
if: config.enableSentry
15 changes: 15 additions & 0 deletions applications/butler/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ spec:
httpGet:
path: "/"
port: "http"
timeoutSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
Expand All @@ -65,10 +66,24 @@ spec:
# to live, so we just have Butler server host them.)
- name: DAF_BUTLER_SERVER_STATIC_FILES_PATH
value: "/opt/lsst/butler/config"
- name: DAF_BUTLER_SERVER_THREAD_POOL_SIZE
value: "3"
{{ if .Values.config.pguser }}
- name: PGUSER
value: {{ .Values.config.pguser | quote }}
{{ end }}
{{ if .Values.config.enableSentry }}
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: "butler"
key: "sentry-dsn"
- name: SENTRY_RELEASE
value: {{ .Chart.Name }}@{{ .Chart.AppVersion }}
- name: SENTRY_ENVIRONMENT
value: {{ .Values.global.host }}

{{ end }}
volumeMounts:
- name: "butler-secrets"
mountPath: "/opt/lsst/butler/secrets"
Expand Down
1 change: 1 addition & 0 deletions applications/butler/values-idfdev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ config:
s3EndpointUrl: "https://storage.googleapis.com"
repositories:
dp02: "file:///opt/lsst/butler/config/dp02.yaml"
enableSentry: true
3 changes: 3 additions & 0 deletions applications/butler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,6 @@ config:
# be exposed. For example, if the service should be exposed at
# `https://data.lsst.cloud/api/butler`, this should be set to `/api/butler`
pathPrefix: "/api/butler"

# -- True to enable capture of trace and other diagnostics to Sentry.io.
enableSentry: false
2 changes: 1 addition & 1 deletion applications/sia/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 0.1.3
appVersion: tickets-DM-47594
description: Simple Image Access (SIA) IVOA Service using Butler
name: sia
sources:
Expand Down
3 changes: 2 additions & 1 deletion applications/sia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Simple Image Access (SIA) IVOA Service using Butler
| affinity | object | `{}` | Affinity rules for the sia deployment pod |
| config.butlerDataCollections | list | `[]` | List of data (Butler) Collections Expected attributes: `config`, `label`, `name`, `butler_type`, `repository` & `datalink_url` |
| config.directButlerEnabled | bool | `false` | Whether direct butler access is enabled |
| config.enableSentry | bool | `false` | True to enable capture of trace and other diagnostics to Sentry.io. |
| config.logLevel | string | `"INFO"` | Logging level |
| config.logProfile | string | `"production"` | Logging profile (`production` for JSON, `development` for human-friendly) |
| config.pathPrefix | string | `"/api/sia"` | URL path prefix |
Expand All @@ -22,7 +23,7 @@ Simple Image Access (SIA) IVOA Service using Butler
| global.baseUrl | string | Set by Argo CD | Base URL for the environment |
| global.host | string | Set by Argo CD | Host name for ingress |
| global.vaultSecretsPath | string | Set by Argo CD | Base path for Vault secrets |
| image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the sia image |
| image.pullPolicy | string | `"Always"` | Pull policy for the sia image |
| image.repository | string | `"ghcr.io/lsst-sqre/sia"` | Image to use in the sia deployment |
| image.tag | string | The appVersion of the chart | Tag of image to use |
| ingress.annotations | object | `{}` | Additional annotations for the ingress rule |
Expand Down
7 changes: 7 additions & 0 deletions applications/sia/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ slack-webhook:
copy:
application: mobu
key: app-alert-webhook
"sentry-dsn":
description: >-
DSN URL where Sentry trace and error logging will be sent.
if: config.enableSentry
copy:
application: butler
key: "sentry-dsn"
11 changes: 11 additions & 0 deletions applications/sia/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ spec:
- name: "GOOGLE_APPLICATION_CREDENTIALS"
value: "/tmp/secrets/butler-gcs-idf-creds.json"
{{- end }}
{{ if .Values.config.enableSentry }}
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: "sia"
key: "sentry-dsn"
- name: SENTRY_RELEASE
value: {{ .Chart.Name }}@{{ .Chart.AppVersion }}
- name: SENTRY_ENVIRONMENT
value: {{ .Values.global.host }}
{{ end }}
{{- if .Values.config.directButlerEnabled }}
volumeMounts:
- name: "secrets"
Expand Down
2 changes: 2 additions & 0 deletions applications/sia/values-idfdev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ config:
butler_type: "REMOTE"
repository: "https://data-dev.lsst.cloud/api/butler/repo/dp02/butler.yaml"
datalink_url: "https://data-dev.lsst.cloud/api/datalink/links?ID=butler%3A//dp02/{id}"

enableSentry: true
5 changes: 4 additions & 1 deletion applications/sia/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ image:
repository: "ghcr.io/lsst-sqre/sia"

# -- Pull policy for the sia image
pullPolicy: "IfNotPresent"
pullPolicy: "Always"

# -- Tag of image to use
# @default -- The appVersion of the chart
Expand Down Expand Up @@ -47,6 +47,9 @@ config:
# connection
pgUser: "rubin"

# -- True to enable capture of trace and other diagnostics to Sentry.io.
enableSentry: false


ingress:
# -- Additional annotations for the ingress rule
Expand Down
Loading