Configure the Infinity data source
To configure the Infinity data source, you need to create an instance of the data source and optionally configure authentication, network settings, and other options.
This page explains how to:
- Add the data source
- Configure connection settings
- Configure authentication
- Configure network settings
- Configure additional settings
- Provision the data source
Before you begin
Before you configure the Infinity data source, you need:
- Grafana version 10.0 or later
- Organization admin permissions in Grafana, or equivalent RBAC permissions to manage data sources
- Network access from Grafana to your target API endpoints
- Appropriate credentials for authenticated endpoints (API keys, OAuth credentials, etc.)
Add the data source
To add the Infinity data source to Grafana:
- In Grafana, navigate to Connections > Data sources.
- Click Add new data source.
- Search for Infinity.
- Click the Infinity data source to configure it.
- Enter a Name for the data source.
- Configure the settings as described in the following sections.
- Click Save & test to verify the connection.
The Infinity data source can work out of the box without any additional configuration. If you need the URL to be authenticated or pass additional headers/query/tls/timeout settings, configure the corresponding section.
Note
Configuration applies to all queries using this data source instance. If you need different configuration for different queries, create separate instances of the data source.
Configuration options
The following sections describe the available configuration options for the Infinity data source.
Connection
For more information about URL configuration, refer to URL reference.
Authentication
The Infinity data source supports the following authentication methods:
- No authentication
- Basic authentication
- Bearer token
- API key
- Digest authentication
- OAuth passthrough
- OAuth 2.0 client credentials
- OAuth 2.0 JWT
- Azure authentication
- Azure Blob storage
- AWS authentication
No authentication
If your APIs don’t require any authentication, select the No Authentication method.
Basic authentication
Basic authentication sends a username and password with your request. In the request headers, the Authorization header uses the Basic <BASE64_ENCODED_USERNAME_AND_PASSWORD> format.
Bearer token
Bearer token authentication enables requests to authenticate using an access key, such as a JSON Web Token (JWT) or personal access token. In the request headers, the Authorization header uses the Bearer <API_KEY> format.
Tip
If you need a custom prefix instead of
Bearer, use API key authentication with the key set toAuthorization.
API key
With API key authentication, you can send a key-value pair to the API via request headers or query parameters.
Tip
It’s easy to confuse API key authentication with Bearer token authentication. Ensure you are using the correct authentication mechanism for your API.
Digest authentication
Digest authentication enables requests to authenticate using the RFC7616 HTTP Digest Access Authentication protocol.
OAuth passthrough
If your Grafana user is already authenticated via OAuth, this authentication method forwards the OAuth tokens to the API.
OAuth 2.0 client credentials
OAuth 2.0 client credentials authentication requires the following settings:
For advanced token customization, refer to OAuth2 Custom Tokens. Key customization options include:
- Custom header names (for example,
X-API-Keyinstead ofAuthorization) - Custom token value formats (for example,
Token ${__oauth2.access_token}instead ofBearer ${__oauth2.access_token}) - Access to multiple token properties (access token, refresh token, token type)
OAuth 2.0 JWT
OAuth 2.0 JWT authentication requires the following settings:
OAuth 2.0 JWT authentication also supports token customization. Refer to OAuth2 Custom Tokens for details.
Azure authentication
To authenticate your API endpoints via Microsoft Azure authentication, refer to Azure authentication.
Azure Blob storage
To retrieve content from Azure Blob storage, configure the following settings:
AWS authentication
To authenticate your API endpoints via Amazon AWS authentication, refer to AWS authentication.
TLS settings
Configure TLS settings if your API requires client certificates or custom CA certificates.
HTTP headers
You can add custom HTTP headers to all requests made by the data source.
Query parameters
You can add query parameters that are sent with every request made by the data source. This works similarly to custom HTTP headers, but the parameters are appended to the URL as query strings.
Additional settings
Configure additional options for request handling and HTTP methods.
Timeout
Dangerous HTTP methods
By default, the Infinity data source only allows GET and POST HTTP methods to reduce the risk of destructive payloads. You can enable other methods such as PATCH, PUT, and DELETE for unconventional use cases.
Warning
Infinity doesn’t validate any permissions against the underlying API. Enable this setting with caution as this can potentially perform destructive actions in the underlying API.
Network settings
Configure how the Infinity data source connects to external APIs.
Note
The Infinity data source sends all API requests from the Grafana server, not from the user’s browser. This means network configuration (proxies, firewalls, etc.) must allow outbound connections from your Grafana server to the target APIs.
Proxy settings
You can configure proxy settings for routing requests through a proxy server.
Warning
Setting up username and password for proxy authentication should only be used with legacy sites. RFC 2396 warns that passing authentication information in clear text is not recommended due to security risks.
Private data source connect (PDC)
Use private data source connect (PDC) to connect to and query data within a secure network without opening that network to inbound traffic from Grafana Cloud. Refer to Private data source connect for more information on how PDC works and Configure Grafana private data source connect (PDC) for steps on setting up a PDC connection.
If you use PDC with AWS Authentication, the PDC agent must allow internet egress to sts.<region>.amazonaws.com:443.
Health check
The settings for the Infinity data source on the configuration page don’t automatically validate the URL. To ensure that your settings, including authentication and API keys, are valid, you need to enable the custom health check in the Health check section of the configuration page.
Note
The custom health check supports only HTTP GET methods. It verifies the response status code, specifically looking for an HTTP 200 status, but doesn’t check the content of the response.
If you receive a Health check failed message after you click Save & Test, check the URL to ensure it’s valid and you entered it correctly.
Provision the data source
You can define and configure the data source in YAML files as part of Grafana’s provisioning system. For more information about provisioning, and for available configuration options, refer to Provisioning Grafana.
Basic provisioning
apiVersion: 1
datasources:
- name: Infinity
type: yesoreyeram-infinity-datasourceProvisioning with authentication
The following example shows provisioning with basic authentication:
apiVersion: 1
datasources:
- name: Infinity
type: yesoreyeram-infinity-datasource
basicAuth: true
basicAuthUser: your_username
jsonData:
auth_method: basicAuth
allowedHosts:
- https://api.example.com
secureJsonData:
basicAuthPassword: your_passwordProvisioning with custom headers
apiVersion: 1
datasources:
- name: Infinity
type: yesoreyeram-infinity-datasource
jsonData:
httpHeaderName1: X-Custom-Header
httpHeaderName2: X-API-Token
secureJsonData:
httpHeaderValue1: custom-value
httpHeaderValue2: your-api-tokenAdvanced provisioning
The following example shows advanced provisioning with TLS and additional options:
apiVersion: 1
datasources:
- name: Infinity
type: yesoreyeram-infinity-datasource
basicAuth: true
basicAuthUser: your_username
jsonData:
auth_method: basicAuth
allowedHosts:
- https://api.example.com
oauthPassThru: false
tlsSkipVerify: false
tlsAuth: true
tlsAuthWithCACert: true
serverName: api.example.com
timeoutInSeconds: 60
allowDangerousHTTPMethods: false
secureJsonData:
basicAuthPassword: your_password
tlsCACert: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
tlsClientCert: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
tlsClientKey: |
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----Tip
Once you have manually configured the data source and verified it is working, you can generate a provisioning YAML file from the data source configuration page. Look for the Provisioning Script button at the bottom of the config page in the More section.
Provision the data source with Terraform
You can provision the Infinity data source using the Grafana Terraform provider. Use the grafana_data_source resource to create and manage data source instances.
Basic Terraform provisioning
resource "grafana_data_source" "infinity" {
type = "yesoreyeram-infinity-datasource"
name = "Infinity"
}Terraform provisioning with authentication
The following example shows provisioning with basic authentication:
resource "grafana_data_source" "infinity" {
type = "yesoreyeram-infinity-datasource"
name = "Infinity"
basic_auth_enabled = true
basic_auth_username = "your_username"
json_data_encoded = jsonencode({
auth_method = "basicAuth"
allowedHosts = ["https://api.example.com"]
})
secure_json_data_encoded = jsonencode({
basicAuthPassword = "your_password"
})
}The following example shows provisioning with bearer token authentication:
resource "grafana_data_source" "infinity" {
type = "yesoreyeram-infinity-datasource"
name = "Infinity"
json_data_encoded = jsonencode({
auth_method = "bearerToken"
allowedHosts = ["https://api.example.com"]
})
secure_json_data_encoded = jsonencode({
bearerToken = "your_token"
})
}Terraform provisioning with custom headers
resource "grafana_data_source" "infinity" {
type = "yesoreyeram-infinity-datasource"
name = "Infinity"
json_data_encoded = jsonencode({
httpHeaderName1 = "X-Custom-Header"
httpHeaderName2 = "X-API-Token"
})
secure_json_data_encoded = jsonencode({
httpHeaderValue1 = "custom-value"
httpHeaderValue2 = "your-api-token"
})
}For more information about the Grafana Terraform provider, refer to the provider documentation.
Administrator configuration
Grafana administrators can configure plugin-wide settings using environment variables.
Pagination limits
By default, pagination queries are limited to 5 pages maximum. To increase this limit, set the GF_PLUGIN_PAGINATION_MAX_PAGES environment variable:
GF_PLUGIN_PAGINATION_MAX_PAGES=10For Docker deployments:
docker run -p 3000:3000 \
-e "GF_INSTALL_PLUGINS=yesoreyeram-infinity-datasource" \
-e "GF_PLUGIN_PAGINATION_MAX_PAGES=10" \
grafana/grafana:latestNote
Higher pagination limits increase the number of API requests made per query, which can affect performance and API rate limits.



