From 6d28284ae2c681f5b6e76ce729f2e4c1a98cb433 Mon Sep 17 00:00:00 2001 From: Anca Lita <27920906+ancalita@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:44:59 +0000 Subject: [PATCH 1/3] add setup for metrics export --- collector-config.yaml | 25 +++++++++++++++++ config.yml | 7 +++-- docker-compose.yml | 65 +++++++++++++++++++++++++++++++++++++++++++ endpoints.yml | 9 +++++- prometheus.yml | 7 +++++ 5 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 collector-config.yaml create mode 100644 docker-compose.yml create mode 100644 prometheus.yml diff --git a/collector-config.yaml b/collector-config.yaml new file mode 100644 index 0000000..a1593fe --- /dev/null +++ b/collector-config.yaml @@ -0,0 +1,25 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + +exporters: + debug: + + prometheus: + endpoint: 0.0.0.0:8889 + + otlp/jaeger: + endpoint: jaeger:4317 + tls: + insecure: true + +service: + pipelines: + traces: + receivers: [otlp] + exporters: [otlp/jaeger] + metrics: + receivers: [otlp] + exporters: [debug, prometheus] diff --git a/config.yml b/config.yml index 3155244..b34bdb2 100644 --- a/config.yml +++ b/config.yml @@ -9,8 +9,9 @@ pipeline: request_timeout: 7 policies: -- name: rasa.core.policies.flow_policy.FlowPolicy -- name: rasa_plus.ml.EnterpriseSearchPolicy -- name: rasa_plus.ml.IntentlessPolicy +- name: FlowPolicy +- name: EnterpriseSearchPolicy +- name: IntentlessPolicy # - name: RulePolicy +assistant_id: 20240219-110701-dichotomic-inference diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c5eb65a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,65 @@ +version: '3.8' + +services: + + prometheus: + image: prom/prometheus:latest + volumes: + - ./prometheus.yml:/etc/prometheus/prometheus.yml + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--enable-feature=otlp-write-receiver' + ports: + - "9090:9090" + + grafana: + image: grafana/grafana:latest + ports: + - "3000:3000" + volumes: + - grafana_data:/var/lib/grafana + + jaeger: + image: jaegertracing/all-in-one:latest + ports: + - "16686:16686" + - "6831:6831/udp" + - "14269:14269" + - "4317" + healthcheck: + test: ["CMD", "wget", "http://0.0.0.0:14269"] + interval: 10s + timeout: 10s + retries: 5 + start_period: 15s + environment: + - COLLECTOR_OTLP_ENABLED=true + + assistant: + image: rasa/rasa:localdev + volumes: + - .:/app + command: + - 'inspect' + ports: + - "5005:5005" + env_file: + - .env + depends_on: + otlp-collector: + condition: service_started + + otlp-collector: + image: otel/opentelemetry-collector:latest + volumes: + - ./collector-config.yaml:/etc/otelcol/config.yaml + ports: + - "4317:4317" # otlp grpc receiver + - "8888:8888" # Prometheus metrics exposed by the collector + - "8889:8889" # Prometheus exporter configured metrics + depends_on: + jaeger: + condition: service_healthy + +volumes: + grafana_data: diff --git a/endpoints.yml b/endpoints.yml index 4a6cf98..f81f9cb 100644 --- a/endpoints.yml +++ b/endpoints.yml @@ -56,4 +56,11 @@ action_endpoint: # queue: queue # nlg: - type: rasa_plus.ml.ContextualResponseRephraser + type: rephrase + +tracing: + type: otlp + endpoint: otlp-collector:4317 + insecure: true + service_name: rasa + metrics_enabled: true diff --git a/prometheus.yml b/prometheus.yml new file mode 100644 index 0000000..0f7bee3 --- /dev/null +++ b/prometheus.yml @@ -0,0 +1,7 @@ +scrape_configs: + - job_name: 'test-app' + scrape_interval: 5s + scrape_timeout: 3s + static_configs: + - targets: ['otlp-collector:8888'] + - targets: ['otlp-collector:8889'] From a008cece67468d21394ed66a66bfb454983e2665 Mon Sep 17 00:00:00 2001 From: Anca Lita <27920906+ancalita@users.noreply.github.com> Date: Fri, 8 Mar 2024 10:04:58 +0000 Subject: [PATCH 2/3] update endpoints.yml --- config.yml | 1 + docker-compose.yml | 2 +- endpoints.yml | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index b34bdb2..df6b088 100644 --- a/config.yml +++ b/config.yml @@ -4,6 +4,7 @@ pipeline: - name: KeywordIntentClassifier - name: NLUCommandAdapter - name: LLMCommandGenerator + trace_prompt_tokens: true llm: model_name: gpt-4 request_timeout: 7 diff --git a/docker-compose.yml b/docker-compose.yml index c5eb65a..b575518 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,7 +55,7 @@ services: - ./collector-config.yaml:/etc/otelcol/config.yaml ports: - "4317:4317" # otlp grpc receiver - - "8888:8888" # Prometheus metrics exposed by the collector + - "8888:8888" # Prometheus' metrics exposed by the collector - "8889:8889" # Prometheus exporter configured metrics depends_on: jaeger: diff --git a/endpoints.yml b/endpoints.yml index f81f9cb..87ae13a 100644 --- a/endpoints.yml +++ b/endpoints.yml @@ -63,4 +63,9 @@ tracing: endpoint: otlp-collector:4317 insecure: true service_name: rasa - metrics_enabled: true + +metrics: + type: otlp + endpoint: otlp-collector:4317 + insecure: true + service_name: rasa From 4928fb2930c1b35ee1ca52e8d9115e1a241bbc35 Mon Sep 17 00:00:00 2001 From: Anca Lita <27920906+ancalita@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:39:29 +0100 Subject: [PATCH 3/3] update docker compose file and gitignore --- .gitignore | 4 ++++ docker-compose.yml | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index cbe77ea..321ebf4 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,7 @@ dmypy.json .pyre/ .rasa/ models/ + +.config/ +.keras/ +augmentation_data/ diff --git a/docker-compose.yml b/docker-compose.yml index b575518..de97663 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,17 +26,17 @@ services: - "6831:6831/udp" - "14269:14269" - "4317" - healthcheck: - test: ["CMD", "wget", "http://0.0.0.0:14269"] - interval: 10s - timeout: 10s - retries: 5 - start_period: 15s +# healthcheck: +# test: ["CMD", "curl", "http://localhost:14269"] +# interval: 15s +# timeout: 10s +# retries: 5 +# start_period: 15s environment: - COLLECTOR_OTLP_ENABLED=true assistant: - image: rasa/rasa:localdev + image: rasa-private:rasa-private-dev volumes: - .:/app command: @@ -59,7 +59,7 @@ services: - "8889:8889" # Prometheus exporter configured metrics depends_on: jaeger: - condition: service_healthy + condition: service_started volumes: grafana_data: