Skip to content

Commit 9cc68cd

Browse files
cypresclaude
andauthored
prometheus: redo fix by using dev mode (#673)
* Revert "new fix for prometheus ports (#670)" This reverts commit 122af26. * Revert "Assign unique Prometheus metrics ports per service in bazel mode (#649)" This reverts commit ef45396. * Fix OAuth2 metrics * Skip Prometheus metrics server in dev mode for all services Prevents port conflicts when running multiple services locally with --method=dev. Consistent with the pattern already applied to worker.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Skip metrics server startup when otel metrics are disabled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Revert "Skip Prometheus metrics server in dev mode for all services" This reverts commit 9211ccc. * Disable metrics by default --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5501daa commit 9cc68cd

File tree

8 files changed

+5
-26
lines changed

8 files changed

+5
-26
lines changed

deployments/charts/backend-operator/templates/backend-listener.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ spec:
7575
runAsUser: 1001
7676
ports:
7777
- name: metrics
78-
containerPort: 9467
78+
containerPort: 9464
7979
command:
8080
- backend_listener
8181
args:

deployments/charts/backend-operator/templates/backend-worker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ spec:
7575
runAsUser: 1001
7676
ports:
7777
- name: metrics
78-
containerPort: 9468
78+
containerPort: 9464
7979
command:
8080
- backend_worker
8181
args:

deployments/charts/service/templates/delayed-job-monitor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ spec:
6363
runAsUser: 1001
6464
ports:
6565
- name: metrics
66-
containerPort: 9466
66+
containerPort: 9464
6767
command:
6868
- delayed_job_monitor
6969
imagePullPolicy: {{ .Values.services.delayedJobMonitor.imagePullPolicy }}

deployments/charts/service/templates/worker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ spec:
7676
runAsUser: 1001
7777
ports:
7878
- name: metrics
79-
containerPort: 9465
79+
containerPort: 9464
8080
imagePullPolicy: {{ .Values.services.worker.imagePullPolicy }}
8181
args:
8282
- --metrics_otel_collector_component

src/operator/utils/objects.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ class BackendBaseConfig(logging.LoggingConfig, login.LoginConfig,
5050

5151
class BackendListenerConfig(BackendBaseConfig, metrics.MetricsCreatorConfig):
5252
"""Configuration for the backend listener service that monitors Kubernetes resources"""
53-
metrics_prometheus_port: int = pydantic.Field(
54-
command_line='metrics_prometheus_port',
55-
env='METRICS_PROMETHEUS_PORT',
56-
default=9467,
57-
description='The port on which the Prometheus scrape endpoint is exposed.')
5853
include_namespace_usage: List[str] = pydantic.Field(
5954
command_line='include_namespace_usage',
6055
default=[],
@@ -166,11 +161,6 @@ class BackendListenerConfig(BackendBaseConfig, metrics.MetricsCreatorConfig):
166161

167162
class BackendWorkerConfig(BackendBaseConfig, metrics.MetricsCreatorConfig):
168163
"""Configuration for the backend worker service that executes jobs"""
169-
metrics_prometheus_port: int = pydantic.Field(
170-
command_line='metrics_prometheus_port',
171-
env='METRICS_PROMETHEUS_PORT',
172-
default=9468,
173-
description='The port on which the Prometheus scrape endpoint is exposed.')
174164
test_runner_namespace: str = pydantic.Field(
175165
command_line='test_runner_namespace',
176166
default='osmo-test',

src/service/delayed_job_monitor/delayed_job_monitor.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ class DelayedJobMonitorConfig(connectors.RedisConfig, connectors.PostgresConfig,
4040
src.lib.utils.logging.LoggingConfig, static_config.StaticConfig,
4141
metrics.MetricsCreatorConfig):
4242
"""Configuration for DelayedJobMonitor."""
43-
metrics_prometheus_port: int = pydantic.Field(
44-
command_line='metrics_prometheus_port',
45-
env='METRICS_PROMETHEUS_PORT',
46-
default=9466,
47-
description='The port on which the Prometheus scrape endpoint is exposed.')
4843
# The amount of time the monitor waits before polling again (in seconds)
4944
poll_interval: int = pydantic.Field(
5045
command_line='poll_interval',

src/service/worker/worker.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@
4545
class WorkerConfig(connectors.RedisConfig, connectors.PostgresConfig,
4646
src.lib.utils.logging.LoggingConfig, static_config.StaticConfig,
4747
metrics.MetricsCreatorConfig):
48-
"""Configuration for the OSMO service worker."""
49-
metrics_prometheus_port: int = pydantic.Field(
50-
command_line='metrics_prometheus_port',
51-
env='METRICS_PROMETHEUS_PORT',
52-
default=9465,
53-
description='The port on which the Prometheus scrape endpoint is exposed.')
5448
progress_file: str = pydantic.Field(
5549
command_line='progress_file',
5650
env='OSMO_PROGRESS_FILE',

src/utils/metrics/metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class MetricsCreatorConfig(pydantic.BaseModel):
5959
metrics_otel_enable: bool = pydantic.Field(
6060
command_line='metrics_otel_enable',
6161
env='METRICS_OTEL_ENABLE',
62-
default=True,
62+
default=False,
6363
description='If set false, will disable metrics')
6464

6565
class MetricCreator:

0 commit comments

Comments
 (0)