Skip to content

Telegram: support custom Bot API base URL - #654

Open
AyobamiH wants to merge 1 commit into
grafana:mainfrom
AyobamiH:ready/telegram-custom-api-url
Open

Telegram: support custom Bot API base URL#654
AyobamiH wants to merge 1 commit into
grafana:mainfrom
AyobamiH:ready/telegram-custom-api-url

Conversation

@AyobamiH

@AyobamiH AyobamiH commented Aug 23, 2026

Copy link
Copy Markdown

What

Add support for an optional custom Telegram Bot API base URL for Grafana-managed alerting.

When api_url is configured, Telegram requests are sent to:

<api_url>/bot<token>/<action>

When it is omitted, the notifier continues using the existing Telegram API endpoint.

Why

This enables Grafana alerting to work with local, proxied, or self-hosted Telegram Bot API servers without changing the existing behavior for users of the public Telegram API.

Fixes grafana/grafana#81534.

Implementation

  • Adds optional api_url support to the Telegram v1 configuration and schema.
  • Validates that configured values are absolute HTTP(S) URLs.
  • Normalizes trailing slashes before request construction.
  • Preserves the existing APIURL integration-test override when no custom URL is configured.
  • Routes both message and image actions through the configured base URL.
  • Updates the complete Telegram configuration fixture.

Verification

Regression coverage includes:

  • custom Bot API routing
  • existing default routing
  • trailing-slash normalization
  • rejection of relative URLs
  • rejection of non-HTTP(S) URLs
  • full Telegram configuration parsing

Fork CI on the submitted commit passes:

  • make mod-check
  • make lint
  • make test
  • TruffleHog secret scanning

@AyobamiH
AyobamiH requested a review from a team as a code owner August 23, 2026 20:16
@cla-assistant

cla-assistant Bot commented Aug 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cla-assistant

cla-assistant Bot commented Aug 23, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@AyobamiH AyobamiH changed the title Telegram: support custom Bot API URL Telegram: support custom Bot API base URL Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram Local Bot API support

1 participant