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: .mkdocs/docs/index.md
+43-14Lines changed: 43 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,24 +6,30 @@ hide:
6
6
7
7
# Grafana Foundation SDK
8
8
9
-
A set of libraries for manipulating and generating Grafana resources
10
-
– dashboards, alerts, … – as-code.
9
+
The Grafana Foundation SDK is a set of **_types_**, and **_builder libraries_**
10
+
that let you define Grafana dashboards and other resources using strongly typed
11
+
code. By writing your resources as code, you can:
11
12
12
-
**_Types_**, **_builder libraries_** and **JSON to code converters** are
13
-
provided in the following languages:
13
+
***Leverage strong typing**: Catch errors at compile time, ensuring more reliable configurations.
14
+
***Enhance version control**: Track changes seamlessly using standard version control systems like Git.
15
+
***Automate deployments**: Integrate dashboard provisioning into your CI/CD pipelines for consistent and repeatable setups.
14
16
15
-
* Go
16
-
* Java
17
-
* PHP
18
-
* Python
19
-
* Typescript
17
+
The SDK supports multiple programming languages, including **Go**, **TypeScript**, **Python**, **PHP**, and **Java**, so you can choose the one that best fits your development environment.
20
18
21
19
!!! note
22
20
23
-
The various SDKs are generated by [`cog`][cog] from
24
-
schemas exposed by Grafana.
21
+
This SDK is best suited for Grafana >= 12, but will work with Grafana >= 10.
25
22
26
-
## Examples
23
+
## Overview
24
+
25
+
Here's a quick overview of how the SDK works:
26
+
27
+
***Builder pattern**: The SDK implements the builder pattern to let you define dashboards fluently. You start with a `DashboardBuilder`, then add panels, queries, and other components step by step.
28
+
***Strong typing**: Everything in the SDK is strongly typed. This gives you autocompletion in your IDE, catches mistakes early, and helps ensure you're always using valid configuration values.
29
+
***Structured options**: When a configuration get complex (like data reduction or display settings), the SDK uses typed option builders to keep things readable and predictable.
30
+
***Resources**: Multiple resources are supported by the SDK. Dashboards, alerts, …
31
+
32
+
For example, here is how dashboards can be built:
27
33
28
34
=== "Go"
29
35
@@ -231,6 +237,31 @@ provided in the following languages:
More examples can be found in the [`./examples/`](https://github.com/grafana/grafana-foundation-sdk/tree/main/examples)
243
+
folder of the Foundation SDK repository.
244
+
245
+
## Publishing resources
246
+
247
+
After you've defined your resource as code, call the `build()` function (its
248
+
actual name might be slightly different depending on language choice) and
249
+
output the result as a JSON.
250
+
251
+
With the JSON payload, you can:
252
+
253
+
* Call [Grafana's API](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/) to programmatically manage the resource.
254
+
* Use [Grafana CLI](https://grafana.com/docs/grafana/latest/as-code/observability-as-code/grafana-cli/) publish the resource from CLI.
255
+
256
+
## Next steps
257
+
258
+
With the basics of using the Grafana Foundation SDK in mind, here are some possible next steps:
259
+
260
+
***Explore more features**: Check out the full API reference to learn more about what the SDK can do.
261
+
***Version control your resources**: Store your resources code in a Git repository to track changes over time.
262
+
***Automate provisioning with CI/CD**: [Integrate the SDK into your CI/CD pipeline](https://grafana.com/docs/grafana/latest/as-code/observability-as-code/foundation-sdk/dashboard-automation/) to deploy dashboards and other resources automatically.
263
+
***Explore a more [real-world example of using the SDK](https://www.youtube.com/watch?v=ZjWdGVsrCiQ)**
264
+
234
265
## Maturity
235
266
236
267
The Grafana Foundation SDK should be considered as "public preview". While it is used by Grafana Labs in production, it still is under active development.
@@ -244,5 +275,3 @@ Additional information can be found in [Release life cycle for Grafana Labs](htt
Copy file name to clipboardExpand all lines: README.md
+89-34Lines changed: 89 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,98 @@
1
1
# Grafana Foundation SDK
2
2
3
-
A set of libraries for manipulating and generating Grafana resources
4
-
– dashboards, alerts, … – as-code.
3
+
The Grafana Foundation SDK is a set of **_types_**, and **_builder libraries_**
4
+
that let you define Grafana dashboards and other resources using strongly typed
5
+
code. By writing your resources as code, you can:
5
6
6
-
**_Types_**, **_builder libraries_** and **JSON to code converters** are
7
-
provided in the following languages:
7
+
***Leverage strong typing**: Catch errors at compile time, ensuring more reliable configurations.
8
+
***Enhance version control**: Track changes seamlessly using standard version control systems like Git.
9
+
***Automate deployments**: Integrate dashboard provisioning into your CI/CD pipelines for consistent and repeatable setups.
8
10
9
-
* Go
10
-
* Java
11
-
* PHP
12
-
* Python
13
-
* Typescript
11
+
The SDK supports multiple programming languages, including **Go**, **TypeScript**, **Python**, **PHP**, and **Java**, so you can choose the one that best fits your development environment.
14
12
15
13
> [!NOTE]
16
-
> The content of this repository is generated by [`cog`][cog] from
17
-
> schemas exposed by Grafana.
18
-
19
-
## Navigating the SDK
20
-
21
-
This SDK is best suited for Grafana >= 12.0
22
-
23
-
For older versions, the following table can be used to select a version of the
> This SDK is best suited for Grafana >= 12, but will work with Grafana >= 10.
15
+
16
+
## Overview
17
+
18
+
Here's a quick overview of how the SDK works:
19
+
20
+
***Builder pattern**: The SDK implements the builder pattern to let you define dashboards fluently. You start with a `DashboardBuilder`, then add panels, queries, and other components step by step.
21
+
***Strong typing**: Everything in the SDK is strongly typed. This gives you autocompletion in your IDE, catches mistakes early, and helps ensure you're always using valid configuration values.
22
+
***Structured options**: When a configuration get complex (like data reduction or display settings), the SDK uses typed option builders to keep things readable and predictable.
23
+
***Resources**: Multiple resources are supported by the SDK. Dashboards, alerts, …
24
+
25
+
For example, here is how a dashboard can be built in Go:
> More examples can be found in the [`./examples/`](https://github.com/grafana/grafana-foundation-sdk/tree/main/examples) folder.
76
+
77
+
## Publishing resources
78
+
79
+
After you've defined your resource as code, call the `build()` function (its
80
+
actual name might be slightly different depending on language choice) and
81
+
output the result as a JSON.
82
+
83
+
With the JSON payload, you can:
84
+
85
+
* Call [Grafana's API](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/) to programmatically manage the resource.
86
+
* Use [Grafana CLI](https://grafana.com/docs/grafana/latest/as-code/observability-as-code/grafana-cli/) publish the resource from CLI.
87
+
88
+
## Next steps
89
+
90
+
With the basics of using the Grafana Foundation SDK in mind, here are some possible next steps:
91
+
92
+
***Explore more features**: Check out the full [API reference](https://grafana.github.io/grafana-foundation-sdk/) to learn more about what the SDK can do.
93
+
***Version control your resources**: Store your resources code in Git to track changes over time.
94
+
***Automate provisioning with CI/CD**: [Integrate the SDK into your CI/CD pipeline](https://grafana.com/docs/grafana/latest/as-code/observability-as-code/foundation-sdk/dashboard-automation/) to deploy dashboards and other resources automatically.
95
+
***Explore a more [real-world example of using the SDK](https://www.youtube.com/watch?v=ZjWdGVsrCiQ)**
39
96
40
97
## Maturity
41
98
@@ -47,5 +104,3 @@ The code in this repository should be considered as "public preview". While it i
0 commit comments