Skip to content

Commit

Permalink
add telemetry agent and local backend collector for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewitt1 committed Sep 1, 2024
1 parent 56cd67b commit 99c89ca
Show file tree
Hide file tree
Showing 11 changed files with 699 additions and 1 deletion.
13 changes: 13 additions & 0 deletions docker/telemetry-collector/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM otel/opentelemetry-collector-contrib:latest

# Define an argument for the config file path
ARG CONFIG_FILE=otel-collector-config.yaml

# Copy the config file into the container
COPY ${CONFIG_FILE} /otel-collector-config.yaml

# Expose the necessary ports (health check, grpc, and http ports)
EXPOSE 13134 4319 4316

# Set the command to run the collector with the config file
CMD ["--config", "/otel-collector-config.yaml"]
34 changes: 34 additions & 0 deletions docker/telemetry-collector/otel-collector-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
extensions:
health_check:
endpoint: 0.0.0.0:13134

receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4316
http:
endpoint: 0.0.0.0:4319

exporters:
logging:
verbosity: detailed

processors:
batch:

service:
extensions: [health_check]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [logging]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [logging]
logs:
receivers: [otlp]
processors: [batch]
exporters: [logging]
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
python-dotenv
fastapi
pexpect
opentelemetry-api
opentelemetry-sdk
opentelemetry-exporter-otlp
pyopenssl>=23.3.0
ray[default] >= 2.9.0
rich
Expand Down
11 changes: 11 additions & 0 deletions runhouse/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,14 @@
DEFAULT_SURFACED_LOG_LENGTH = 20
# Constants for schedulers
INCREASED_INTERVAL = 1 * HOUR

# Telemetry constants
OTEL_VERSION = "0.108.0"

TELEMETRY_AGENT_HTTP_PORT = 4318
TELEMETRY_AGENT_GRPC_PORT = 4317
TELEMETRY_AGENT_HEALTH_CHECK_PORT = 13133

TELEMETRY_COLLECTOR_HOST = "telemetry.run.house"
TELEMETRY_COLLECTOR_ENDPOINT = f"{TELEMETRY_COLLECTOR_HOST}:443"
TELEMETRY_COLLECTOR_STATUS_URL = f"https://{TELEMETRY_COLLECTOR_HOST}/status"
5 changes: 5 additions & 0 deletions runhouse/servers/telemetry/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .telemetry_agent import (
TelemetryAgentConfig,
TelemetryAgentExporter,
TelemetryCollectorConfig,
)
Loading

0 comments on commit 99c89ca

Please sign in to comment.