diff --git a/CHANGELOG.md b/CHANGELOG.md index edbd7e9..784db7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Development +### Added + +- `X-Api-Client` header + ## 1.1.0 ### Added diff --git a/src/datasource.ts b/src/datasource.ts index 19bf35d..6cc15d3 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -253,7 +253,10 @@ export class DataSource extends DataSourceApi< } request(url: string, method: string, payload?: any): Observable> { - const headers: Record = { 'X-Api-Key': this.apiKey }; + const headers: Record = { + 'X-Api-Key': this.apiKey, + 'X-Api-Client': 'analytics-grafana-datasource', + }; if (this.tenantOrgId != null) { headers['X-Tenant-Org-Id'] = this.tenantOrgId; } diff --git a/src/utils/licenses.ts b/src/utils/licenses.ts index 0839d2f..923556c 100644 --- a/src/utils/licenses.ts +++ b/src/utils/licenses.ts @@ -38,9 +38,9 @@ async function fetchLicensesForEndpoint( mapperFunc: (license: AnalyticsLicense) => SelectableValue, tenantOrgId?: string ) { - const headers: Record = { 'X-Api-Key': apiKey} + const headers: Record = { 'X-Api-Key': apiKey, 'X-Api-Client': 'analytics-grafana-datasource' }; if (tenantOrgId != null) { - headers["X-Tenant-Org-Id"] = tenantOrgId + headers['X-Tenant-Org-Id'] = tenantOrgId; } const options = { url: url,