You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/datasource_configuration.md
+177-5Lines changed: 177 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,8 +86,6 @@ datasources:
86
86
editable: false
87
87
```
88
88
89
-
90
-
91
89
## Configure Grafana using datasource.yaml for User Principals in Single tenancy mode
92
90
93
91
Following parameters must be set:
@@ -125,7 +123,7 @@ Here is the representation of the required JSON data in a tabular format:
125
123
| secureJsonData | fingerprint0 | Fingerprint value for the first tenancy. |
126
124
| secureJsonData | privkey0 | Private key for the first tenancy. |
127
125
128
-
### Configuration example for User Principal in SIngle Tenancy mode
126
+
### Configuration example for User Principal in Single Tenancy mode
129
127
130
128
```
131
129
# Configuration file version
@@ -210,7 +208,7 @@ Following parameters must be set:
210
208
**jsonData*
211
209
+ **environment*: The environment in which the application will run, which can be either 'local' (for local development) or an OCI Instance.
212
210
+ **tenancymode*: The tenancy mode, which is set to 'multitenancy', indicating that the application supports multiple tenants.
213
-
+ *profile0* and *region0*: These are the profile name and region code for the first tenancy. PRofile name for first tenancy **must** be set to 'DEFAULT'
211
+
+ *profile0* and *region0*: These are the profile name and region code for the first tenancy. Profile name for first tenancy **must** be set to 'DEFAULT'
214
212
+ *profile1* and *region1*: These are the profile name and region code for the second tenancy.
215
213
+ *profile2*, *region2*, *profile3*, *region3*, *profile4*, and *region4*: These are the profile names and region codes for the third to fifth tenancies.
216
214
@@ -254,7 +252,7 @@ Here is the representation of the required JSON data in a tabular format:
254
252
| secureJsonData | fingerprint5 | Fingerprint value for the sixth tenancy. |
255
253
| secureJsonData | privkey5 | Private key for the sixth tenancy. |
256
254
257
-
### Configuration example for User Principal in SIngle Tenancy mode
255
+
### Configuration example for User Principal in Multi Tenancy mode
258
256
259
257
```
260
258
# Configuration file version
@@ -349,4 +347,178 @@ datasources:
349
347
# Grafana UI.
350
348
editable: false
351
349
350
+
```
351
+
352
+
# Configuring OCI Metrics Plugin Datasource using Grafana API
353
+
354
+
## Introduction
355
+
356
+
Configuring datasources in Grafana can be automated using the Grafana HTTP API. This approach allows for programmatic setup and management of datasources, which is particularly useful for large-scale deployments or when integrating Grafana into other systems.
357
+
358
+
To configure the OCI Metrics plugin datasource, you'll need to send a POST request to the Grafana API endpoint `/api/datasources`. The configuration details are sent in the request body as JSON. The specific parameters will vary depending on the authentication mode you're using: Single Tenancy, Multi-tenancy, or Instance Principal.
359
+
360
+
Before proceeding, ensure you have:
361
+
362
+
1. Grafana installed and running
363
+
2. Admin API key for authentication
364
+
3. OCI Metrics plugin installed in Grafana
365
+
366
+
Let's explore how to configure the OCI Metrics plugin datasource for each authentication mode.
367
+
368
+
## Configure Grafana using Grafana API for User Principals in Single tenancy mode
369
+
370
+
Following parameters must be set:
371
+
372
+
**jsonData**
373
+
374
+
***profile0**: The profile name, it must be set to 'DEFAULT'.
375
+
***environment**: The environment in which the application will run, use 'local' for User Principals in single tenancy mode.
376
+
***tenancymode**: The tenancy mode, which can be either 'single' (for single-tenant) or 'multi' (for multi-tenant). For User Principals in single tenancy mode use 'single'.
377
+
***region0**: The region code.
378
+
379
+
**secureJsonData**
380
+
381
+
This section contains sensitive data that should be encrypted before being stored in the JSON file. It includes:
382
+
383
+
***user0**: user OCID.
384
+
***tenancy0**: tenancy OCID.
385
+
***fingerprint0**: Fingerprint value, hash of the API PEM key.
386
+
***privkey0**: API PEM key. The key is formatted as a multi-line string.
387
+
388
+
### Payload example for User Principals in Single tenancy mode
## Configure Grafana using Grafana API for User Principals in Multi tenancy mode
413
+
414
+
Following parameters must be set:
415
+
416
+
**jsonData*
417
+
+ **environment*: The environment in which the application will run, which can be either 'local' (for local development) or an OCI Instance.
418
+
+ **tenancymode*: The tenancy mode, which is set to 'multitenancy', indicating that the application supports multiple tenants.
419
+
+ *profile0* and *region0*: These are the profile name and region code for the first tenancy. Profile name for first tenancy **must** be set to 'DEFAULT'
420
+
+ *profile1* and *region1*: These are the profile name and region code for the second tenancy.
421
+
+ *profile2*, *region2*, *profile3*, *region3*, *profile4*, and *region4*: These are the profile names and region codes for the third to fifth tenancies.
422
+
423
+
**secureJsonData*
424
+
This section contains sensitive data that should be encrypted before being stored in the JSON file. It includes:
425
+
426
+
+ *user0*, *tenancy0*, *fingerprint0*, and *privkey0*: These are the user ID, tenancy ID, fingerprint value, and private key for the first tenancy.
427
+
+ *user1*, *tenancy1*, *fingerprint1*, and *privkey1*: These are the user ID, tenancy ID, fingerprint value, and private key for the second tenancy.
428
+
+ *user2*, *tenancy2*, *fingerprint2*, and *privkey2*: These are the user ID, tenancy ID, fingerprint value, and private key for the third tenancy.
429
+
+ *user3*, *tenancy3*, *fingerprint3*, and *privkey3*: These are the user ID, tenancy ID, fingerprint value, and private key for the fourth tenancy.
430
+
+ *user4*, *tenancy4*, *fingerprint4*, and *privkey4*: These are the user ID, tenancy ID, fingerprint value, and private key for the fifth tenancy.
431
+
+ *user5*, *tenancy5*, *fingerprint5*, and *privkey5*: These are the user ID, tenancy ID, fingerprint value, and private key for the sixth tenancy.
432
+
433
+
### Payload example for User Principals in Multi tenancy mode
| jsonData | environment | The environment in which the application will run, either 'local' or an OCI Instance. use "local" for multitenancy configuration|
465
+
| jsonData | tenancymode | The tenancy mode, set to 'multitenancy', indicating that the application supports multiple tenants. |
466
+
| jsonData | profile0 | Profile name for the first tenancy, always set to 'DEFAULT'. |
467
+
| jsonData | region0 | Region code for the first tenancy |
468
+
| jsonData | profile1 | Profile name for the second tenancy. |
469
+
| jsonData | region1 | Region code for the second tenancy. |
470
+
| ... | ... | ... |
471
+
| jsonData | profile5 | Profile name for the sixth tenancy. |
472
+
| jsonData | region5 | Region code for the sixth tenancy. |
473
+
474
+
|**Section**|**Element**|**Description**|
475
+
| --- | --- | --- |
476
+
| secureJsonData | user0 | User ID for the first tenancy. |
477
+
| secureJsonData | tenancy0 | Tenancy ID for the first tenancy. |
478
+
| secureJsonData | fingerprint0 | Fingerprint value for the first tenancy. |
479
+
| secureJsonData | privkey0 | Private key for the first tenancy. |
480
+
| secureJsonData | user1 | User ID for the second tenancy. |
481
+
| secureJsonData | tenancy1 | Tenancy ID for the second tenancy. |
482
+
| secureJsonData | fingerprint1 | Fingerprint value for the second tenancy. |
483
+
| secureJsonData | privkey1 | Private key for the second tenancy. |
484
+
| ... | ... | ... |
485
+
| secureJsonData | user5 | User ID for the sixth tenancy. |
486
+
| secureJsonData | tenancy5 | Tenancy ID for the sixth tenancy. |
487
+
| secureJsonData | fingerprint5 | Fingerprint value for the sixth tenancy. |
488
+
| secureJsonData | privkey5 | Private key for the sixth tenancy. |
489
+
490
+
Here is the representation of the required JSON data in a tabular format:
491
+
492
+
## Configure Grafana using Grafana API for Instance Principals
493
+
494
+
Following parameters must be set:
495
+
496
+
**jsonData*
497
+
+ **profile0**: A string that specifies the profile name. This field has a default value of 'DEFAULT', which is also the only allowed value.
498
+
+ **environment**: A string that specifies the environment type, either 'local' or 'OCI Instance'. Use 'OCI Instance' for instance principals.
499
+
500
+
Note: The DEFAULT value for profile0 is mandatory, as it is the only allowed value.
501
+
502
+
Here is the representation of the required JSON data in a tabular format:
503
+
504
+
**jsonData**
505
+
506
+
|**Section**|**Element**|**Description**|
507
+
| --- | --- | --- |
508
+
| jsonData | profile0 | Profile name, **must** be set to 'DEFAULT' for single instance and user principal. |
509
+
| jsonData | environment | Environment in which the application will run, set to 'OCI Instance'. |
0 commit comments