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

Grafana OnCall Telegram bot integration #5470

Open
nijatvhost007 opened this issue Mar 1, 2025 · 0 comments
Open

Grafana OnCall Telegram bot integration #5470

nijatvhost007 opened this issue Mar 1, 2025 · 0 comments

Comments

@nijatvhost007
Copy link

What went wrong?

SO basically I am trying to connect my grafana oncall to telegram to test. I am using hobby version with docker-compose ( I will attach it too) but I exposing my engine with ngrok to telegram be able to send messages. So After completing all these steps:

In OnCall, click on the ChatOps tab and select Telegram in the side menu.
Click Connect Telegram channel and follow the instructions, mirrored here for reference. A unique verification code will be generated that you must use to activate the channel.
In your team Telegram account, create a new channel, and set it to Private.
In Manage Channel, make sure Sign messages is enabled.
Create a new discussion group. This group handles alert actions and comments.
Add the discussion group to the channel. In Manage Channel, click Discussion to find and add the new group.
In OnCall, click the link to the OnCall bot to add it to your contacts.
In Telegram, add the bot to your channel as an Admin. Allow it to Post Messages.
Add the bot to the discussion group.
In OnCall, send the provided verification code to the channel.
Make sure users connect to Telegram in their OnCall user profile.
In step 10 when I'm sending this confirmation code to the channel - it does not responds... I am doing exactly just in the video, and I need help(

My compose is:

x-environment: &oncall-environment
  DATABASE_TYPE: sqlite3
  BROKER_TYPE: redis
  BASE_URL: $DOMAIN
  SECRET_KEY: $SECRET_KEY
  FEATURE_PROMETHEUS_EXPORTER_ENABLED: ${FEATURE_PROMETHEUS_EXPORTER_ENABLED:-false}
  PROMETHEUS_EXPORTER_SECRET: ${PROMETHEUS_EXPORTER_SECRET:-}
  REDIS_URI: redis://redis:6379/0
  DJANGO_SETTINGS_MODULE: settings.hobby
  CELERY_WORKER_QUEUE: "default,critical,long,slack,telegram,webhook,retry,celery,grafana"
  CELERY_WORKER_CONCURRENCY: "1"
  CELERY_WORKER_MAX_TASKS_PER_CHILD: "100"
  CELERY_WORKER_SHUTDOWN_INTERVAL: "65m"
  CELERY_WORKER_BEAT_ENABLED: "True"
  GRAFANA_API_URL: http://grafana:3000

services:
  engine:
    image: grafana/oncall
    restart: always
    ports:
      - "8080:8080"
    command: sh -c "uwsgi --ini uwsgi.ini"
    environment: *oncall-environment
    volumes:
      - oncall_data:/var/lib/oncall
    depends_on:
      oncall_db_migration:
        condition: service_completed_successfully
      redis:
        condition: service_healthy

  celery:
    image: grafana/oncall
    restart: always
    command: sh -c "./celery_with_exporter.sh"
    environment: *oncall-environment
    volumes:
      - oncall_data:/var/lib/oncall
    depends_on:
      oncall_db_migration:
        condition: service_completed_successfully
      redis:
        condition: service_healthy

  oncall_db_migration:
    image: grafana/oncall
    command: python manage.py migrate --noinput
    environment: *oncall-environment
    volumes:
      - oncall_data:/var/lib/oncall
    depends_on:
      redis:
        condition: service_healthy

  redis:
    image: redis:7.0.15
    restart: always
    expose:
      - 6379
    volumes:
      - redis_data:/data
    deploy:
      resources:
        limits:
          memory: 500m
          cpus: "0.5"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      timeout: 5s
      interval: 5s
      retries: 10

  prometheus:
    image: prom/prometheus:latest
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    container_name: prometheus
    hostname: prometheus
    command:
      - --config.file=/etc/prometheus/prometheus.yml
    ports:
      - 9090:9090
    restart: unless-stopped 
    networks:
      - default


  grafana:
    image: "grafana/${GRAFANA_IMAGE:-grafana:latest}"
    restart: always
    ports:
      - "3000:3000"
    environment:
      GF_FEATURE_TOGGLES_ENABLE: externalServiceAccounts
      GF_SECURITY_ADMIN_USER: ${GRAFANA_USER:-admin}
      GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:-admin}
      GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: grafana-oncall-app
      # GF_INSTALL_PLUGINS: grafana-oncall-app
      GF_INSTALL_PLUGINS: "grafana-oncall-app vv1.9.0"
      GF_AUTH_MANAGED_SERVICE_ACCOUNTS_ENABLED: true
      GRAFANA_CLI_INSECURE_SKIP_VERIFY: true
    volumes:
      - grafana_data:/var/lib/grafana
      - ./grafana.ini:/etc/grafana/grafana.ini  # Mount the file here
    deploy:
      resources:
        limits:
          memory: 500m
          cpus: "0.5"
    profiles:
      - with_grafana
  web:
    image: nginx:1.23.1
    ports:
    - "8000:80"
    volumes:
    - ./default.conf:/etc/nginx/conf.d/default.conf

  exporter:
      image: nginx/nginx-prometheus-exporter:0.11
      ports:
        - 9113:9113
      command:
        - -nginx.scrape-uri=http://web:80/metrics

volumes:
  grafana_data:
  prometheus_data:
  oncall_data:
  redis_data:

How do we reproduce it?

  1. Open Grafana OnCall and do X
  2. Now click button Y
  3. Wait for the browser to crash. Error message says: "Error..."

Grafana OnCall Version

v1.9.2

Product Area

Helm/Kubernetes/Docker

Grafana OnCall Platform?

Docker

User's Browser?

No response

Anything else to add?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant