Skip to content

Commit

Permalink
Add OpenTelemetry flags for deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
timetinytim committed Jul 19, 2024
1 parent c437b0a commit 04cc461
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time
# you make changes to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 5.2.0
version: 5.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
6 changes: 6 additions & 0 deletions templates/deployment-sidekiq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ spec:
name: {{ $context.Values.mastodon.cacheBuster.authToken.existingSecret }}
key: password
{{- end }}
{{- if or $context.Values.mastodon.sidekiq.otel.enabled (and $context.Values.mastodon.otel.enabled (ne $context.Values.mastodon.sidekiq.otel.enabled false)) }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ coalesce $context.Values.mastodon.sidekiq.otel.endpointUri $context.Values.mastodon.otel.endpointUri }}
- name: OTEL_SERVICE_NAME_PREFIX
value: {{ coalesce $context.Values.mastodon.sidekiq.otel.namePrefix $context.Values.mastodon.otel.namePrefix }}
{{- end }}
volumeMounts:
{{- if (not $context.Values.mastodon.s3.enabled) }}
- name: assets
Expand Down
6 changes: 6 additions & 0 deletions templates/deployment-streaming.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ spec:
{{- end }}
- name: "PORT"
value: {{ .Values.mastodon.streaming.port | quote }}
{{- if or .Values.mastodon.streaming.otel.enabled (and .Values.mastodon.otel.enabled (ne .Values.mastodon.streaming.otel.enabled false)) }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ coalesce .Values.mastodon.streaming.otel.endpointUri .Values.mastodon.otel.endpointUri }}
- name: OTEL_SERVICE_NAME_PREFIX
value: {{ coalesce .Values.mastodon.streaming.otel.namePrefix .Values.mastodon.otel.namePrefix }}
{{- end }}
{{- range $k, $v := .Values.mastodon.streaming.extraEnvVars }}
- name: {{ $k }}
value: {{ quote $v }}
Expand Down
6 changes: 6 additions & 0 deletions templates/deployment-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ spec:
name: {{ .Values.mastodon.cacheBuster.authToken.existingSecret }}
key: password
{{- end }}
{{- if or .Values.mastodon.web.otel.enabled (and .Values.mastodon.otel.enabled (ne .Values.mastodon.web.otel.enabled false)) }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ coalesce .Values.mastodon.web.otel.endpointUri .Values.mastodon.otel.endpointUri }}
- name: OTEL_SERVICE_NAME_PREFIX
value: {{ coalesce .Values.mastodon.web.otel.namePrefix .Values.mastodon.otel.namePrefix }}
{{- end }}
volumeMounts:
{{- if (not .Values.mastodon.s3.enabled) }}
- name: assets
Expand Down
26 changes: 26 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ mastodon:
# requests:
# cpu: 250m
# memory: 512Mi

# Open Telemetry configuration for sidekiq pods. Overrides global settings.
otel:
enabled:
exporterUri:
namePrefix:

workers:
- name: all-queues
# -- Number of threads / parallel sidekiq jobs that are executed per Pod
Expand Down Expand Up @@ -285,6 +292,12 @@ mastodon:
# Specify extra environment variables to be added to streaming pods.
extraEnvVars: {}

# Open Telemetry configuration for streaming pods. Overrides global settings.
otel:
enabled:
exporterUri:
namePrefix:

web:
port: 3000
# -- Number of Web Pods running
Expand Down Expand Up @@ -333,6 +346,12 @@ mastodon:
name:
key:

# Open Telemetry configuration for web pods. Overrides global settings.
otel:
enabled:
exporterUri:
namePrefix:

# HTTP cache buster configuration.
# See the documentation for more information about this feature:
# https://docs.joinmastodon.org/admin/config/#http-cache-buster
Expand All @@ -355,6 +374,13 @@ mastodon:
enabled: false
port: 9102

# Open Telemetry configuration for all deployments. Component-specific
# configuration will override these values.
otel:
enabled: false
exporterUri:
namePrefix: mastodon

# Sets the PREPARED_STATEMENTS environment variable: https://docs.joinmastodon.org/admin/config/#prepared_statements
preparedStatements: true

Expand Down

0 comments on commit 04cc461

Please sign in to comment.