Skip to content

ADD datasouce to enviroment variable #680

@AntonBushmelev

Description

@AntonBushmelev

Is your feature request related to a problem? Please describe.
I'm always frustrated when the datasource configuration is hardcoded into the exporter, as it limits flexibility and makes it difficult to adapt to different environments without modifying the configuration file or source code.

Describe the solution you'd like
I need the ability to specify the datasource (e.g., connection string for Microsoft SQL Server) via environment variables. This would allow for more dynamic and flexible deployments, especially in containerized environments like Docker or Kubernetes.

Describe alternatives you've considered

Using configuration files, but this adds complexity in managing separate files for different environments.
Passing the datasource as a command-line argument, but this can expose sensitive information in logs.
Additional context
Adding support for environment variables would improve usability in modern CI/CD pipelines and containerized setups. Examples of expected environment variables:

MSSQL_EXPORTER_DATASOURCE: The full connection string to the SQL Server.
MSSQL_EXPORTER_USERNAME and MSSQL_EXPORTER_PASSWORD: Individual credentials for constructing the datasource dynamically.
This feature is essential for secure and scalable deployments in diverse environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions