Skip to content

Allow passing scraping interval to datasources #464

@mweinelt

Description

@mweinelt

Hi,

I'm looking to set jsonData.timeInterval to match the global scrape interval of Prometheus, but it seems that this role does not propagate jsonData, so this remains impossible for now.

What I imagined it would look like is:

grafana_datasources
  - name: prometheus.example.com
    type: prometheus
    access: proxy
    url: http://localhost:9090
    basicAuth: false
    editable: false
    jsonData:
      timeInterval: 60s

And that works, except for the scrape interval. It would likely need to be passed in

community.grafana.grafana_datasource:
grafana_url: "{{ grafana_api_url }}"
grafana_user: "{{ grafana_ini.security.admin_user }}"
grafana_password: "{{ grafana_ini.security.admin_password }}"
name: "{{ item.name }}"
ds_url: "{{ item.url }}"
ds_type: "{{ item.type }}"
access: "{{ item.access | default(omit) }}"
is_default: "{{ item.isDefault | default(omit) }}"
basic_auth_user: "{{ item.basicAuthUser | default(omit) }}"
basic_auth_password: "{{ item.basicAuthPassword | default(omit) }}"
database: "{{ item.database | default(omit) }}"
user: "{{ item.user | default(omit) }}"
password: "{{ item.password | default(omit) }}"
aws_auth_type: "{{ item.aws_auth_type | default(omit) }}"
aws_default_region: "{{ item.aws_default_region | default(omit) }}"
aws_access_key: "{{ item.aws_access_key | default(omit) }}"
aws_secret_key: "{{ item.aws_secret_key | default(omit) }}"
aws_credentials_profile: "{{ item.aws_credentials_profile | default(omit) }}"
aws_custom_metrics_namespaces: "{{ item.aws_custom_metrics_namespaces | default(omit) }}"
and even appears in various examples in this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions