Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Azure monitoring fields for grafanadatasources #293

Merged
merged 3 commits into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions deploy/examples/datasources/Azure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: integreatly.org/v1alpha1
kind: GrafanaDataSource
metadata:
name: stackdriver-data-source
spec:
datasources:
type: grafana-azure-monitor-datasource
access: proxy
jsonData:
appInsightsAppId: <app-insights-app-id>
clientId: <client-id>
cloudName: azuremonitor
subscriptionId: <subscription-id>
tenantId: <tenant-id>
logAnalyticsClientId: <log-analytics-client-id>
logAnalyticsDefaultWorkspace: <log-analytics-default-workspace>
logAnalyticsSubscriptionId: <log-analytics-subscription-id>
logAnalyticsTenantId: <log-analytics-tenant-id>
secureJsonData:
clientSecret: <client-secret>
appInsightsApiKey: <app-insights-api-key>
logAnalyticsClientSecret: <log-analytics-client-secret>
version: 1
name: azure-data-source.yaml
17 changes: 16 additions & 1 deletion pkg/apis/integreatly/v1alpha1/grafanadatasource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ type GrafanaDataSourceJsonData struct {
MaxOpenConns int `json:"maxOpenConns,omitempty"`
MaxIdleConns int `json:"maxIdleConns,omitempty"`
ConnMaxLifetime int `json:"connMaxLifetime,omitempty"`
// Usefull fields for clickhouse datasource
// Useful fields for clickhouse datasource
// See https://github.com/Vertamedia/clickhouse-grafana/tree/master/dist/README.md#configure-the-datasource-with-provisioning
// See https://github.com/Vertamedia/clickhouse-grafana/tree/master/src/datasource.ts#L44
AddCorsHeader bool `json:"addCorsHeader,omitempty"`
Expand All @@ -120,6 +120,17 @@ type GrafanaDataSourceJsonData struct {
ClientEmail string `json:"clientEmail,omitempty"`
AuthenticationType string `json:"authenticationType,omitempty"`
DefaultProject string `json:"defaultProject,omitempty"`
// Fields for Azure data sources
AppInsightsAppId string `json:"appInsightsAppId,omitempty"`
AzureLogAnalyticsSameAs string `json:"azureLogAnalyticsSameAs,omitempty"`
ClientId string `json:"clientId,omitempty"`
CloudName string `json:"cloudName,omitempty"`
LogAnalyticsDefaultWorkspace string `json:"logAnalyticsDefaultWorkspace,omitempty"`
LogAnalyticsClientId string `json:"logAnalyticsClientId,omitempty"`
logAnalyticsSubscriptionId string `json:"logAnalyticsSubscriptionId,omitempty"`
logAnalyticsTenantId string `json:"logAnalyticsTenantId,omitempty"`
SubscriptionId string `json:"subscriptionI,omitempty"`
TenantId string `json:"tenantId,omitempty"`
}

// The most common secure json options
Expand All @@ -145,6 +156,10 @@ type GrafanaDataSourceSecureJsonData struct {
HTTPHeaderValue9 string `json:"httpHeaderValue9,omitempty"`
// Fields for Stackdriver data sources
PrivateKey string `json:"privateKey,omitempty"`
// Fields for Azure data sources
ClientSecret string `json:"clientSecret,omitempty"`
appInsightsApiKey string `json:"appInsightsApiKey,omitempty"`
logAnalyticsClientSecret string `json:"logAnalyticsClientSecret,omitempty"`
}

func init() {
Expand Down