Skip to content

Conversation

@gulshank0
Copy link
Contributor

part of : #4672

Description of change:

  • This change adds support for the chat_id_file configuration parameter for Telegram notifications, allowing users to securely provide their chat ID via a file instead of embedding it directly in the config. This is similar to the existing bot_token_file parameter.
  • Previously, users had to pass chat_id in clear text inside the config file. This feature allows passing a file path that contains the chat_id value, enabling more secure deployments using Docker secrets or Kubernetes volumes.

Validation Rules:

  • Either chat_id or chat_id_file must be provided (at least one required)
  • chat_id and chat_id_file are mutually exclusive (cannot use both)
  • Error messages:
    • "missing chat_id or chat_id_file on telegram_config" - when neither is provided
    • "at most one of chat_id & chat_id_file must be configured" - when both are provided

Fully backward compatible. Existing configurations using chat_id continue to work unchanged.

Signed-off-by: gulshank0 <gulshanbahadur002@gmail.com>
@SuperQ SuperQ merged commit e9b9ecd into prometheus:main Jan 28, 2026
7 checks passed
SuperQ added a commit that referenced this pull request Feb 2, 2026
* [ENHANCEMENT] docs(opsgenie): Fix description of `api_url` field. #4908
* [ENHANCEMENT] docs(slack): Document missing app configs. #4871
* [ENHANCEMENT] docs: Fix `max-silence-size-bytes`. #4805
* [ENHANCEMENT] docs: Update expr for `AlertmanagerClusterFailedToSendAlerts` to exclude value 0. #4872
* [ENHANCEMENT] docs: Use matchers for inhibit rules examples. #4131
* [ENHANCEMENT] docs: add notification integrations. #4901
* [ENHANCEMENT] docs: update `slack_config` attachments documentation links. #4802
* [ENHANCEMENT] docs: update description of filter query params in openapi doc. #4810
* [ENHANCEMENT] provider: Reduce lock contention. #4809
* [FEATURE] slack: Add support for top-level text field in slack notification. #4867
* [FEATURE] smtp: Add support for authsecret from file. #3087
* [FEATURE] smtp: Customize the ssl/tls port support (#4757). #4818
* [FEATURE] smtp: Enhance email notifier configuration validation. #4826
* [FEATURE] telegram: Add `chat_id_file` configuration parameter. #4909
* [FEATURE] telegram: Support global bot token. #4823
* [FEATURE] webhook: Support templating in url fields. #4798
* [FEATURE] wechat: Add config directive to pass api secret via file. #4734
* [FEATURE] provider: Implement per alert limits. #4819
* [BUGFIX] Allow empty `group_by` to override parent route. #4825
* [BUGFIX] Set `spellcheck=false` attribute on silence filter input. #4811
* [BUGFIX] jira: Fix for handling api v3 with ADF. #4756
* [BUGFIX] jira: Prevent hostname corruption in cloud api url replacement. #4892
---------

Signed-off-by: Solomon Jacobs <solomonjacobs@protonmail.com>
Signed-off-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
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.

3 participants