forked from weaveworks/grafanalib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from smartrecruiters/chore-sync-with-weaveworks…
…-main Chore sync with weaveworks main
- Loading branch information
Showing
12 changed files
with
229 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,22 +7,18 @@ jobs: | |
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: "Install prerequisites" | ||
run: | | ||
pip3 install -r docs/requirements.txt | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ammaraskar/sphinx-action@master | ||
# - uses: ammaraskar/sphinx-action@master | ||
# Using fork of sphinx-action to support python version > 3.9 | ||
# As sphinx-action not updated the sphinx docker image it uses | ||
- uses: erpcya/sphinx-action@feature/#update-sphinx-base-image | ||
with: | ||
docs-folder: "docs/" | ||
pre-build-command: | | ||
pip3 install --upgrade pip | ||
sphinx-apidoc -f grafanalib -o docs/api | ||
python setup.py install --user | ||
python3 setup.py install --user | ||
build-command: "make html" | ||
|
||
- name: Link Checker | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sphinx == 6.1.3 | ||
sphinx_rtd_theme == 1.2.2 | ||
sphinx == 7.2.6 | ||
sphinx_rtd_theme == 1.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"""Helpers to create Azure Data Explorer specific Grafana queries.""" | ||
|
||
import attr | ||
|
||
TIME_SERIES_RESULT_FORMAT = 'time_series' | ||
TABLE_RESULT_FORMAT = 'table' | ||
ADX_TIME_SERIES_RESULT_FORMAT = 'time_series_adx_series' | ||
|
||
|
||
@attr.s | ||
class AzureDataExplorerTarget(object): | ||
""" | ||
Generates Azure Data Explorer target JSON structure. | ||
Link to Azure Data Explorer datasource Grafana plugin: | ||
https://grafana.com/grafana/plugins/grafana-azure-data-explorer-datasource/ | ||
Azure Data Explorer docs on query language (KQL): | ||
https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/ | ||
:param database: Database to execute query on | ||
:param query: Query in Kusto Query Language (KQL) | ||
:param resultFormat: Output format of the query result | ||
:param alias: legend alias | ||
:param refId: target reference id | ||
""" | ||
|
||
database = attr.ib(default="") | ||
query = attr.ib(default="") | ||
resultFormat = attr.ib(default=TIME_SERIES_RESULT_FORMAT) | ||
alias = attr.ib(default="") | ||
refId = attr.ib(default="") | ||
|
||
def to_json_data(self): | ||
return { | ||
'database': self.database, | ||
'query': self.query, | ||
'resultFormat': self.resultFormat, | ||
'alias': self.alias, | ||
'refId': self.refId | ||
} |
Oops, something went wrong.