forked from weaveworks/grafanalib
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #18 from strava/needful/sync_with_upstream
Sync with upstream
- Loading branch information
Showing
12 changed files
with
346 additions
and
79 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
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.4.7 | ||
sphinx_rtd_theme == 2.0.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 | ||
} |
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
Oops, something went wrong.