Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/actions/env-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ runs:
label: ${{ toJSON(github.event.label) }}
shell: bash
run: |
echo version cal job start
echo start azdev env setup
- name: Checkout CLI extension repo
uses: actions/checkout@v4
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/AzdevLinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,9 @@ jobs:
for mod in ${changed_module_list[@]}
do
echo changed module: "${mod}"
azdev extension add "${mod}" && azdev linter "${mod}" --min-severity medium --repo ./ --src "$diff_branch" --tgt "$merge_base"
azdev extension add "${mod}"
# ado linter task
azdev linter "${mod}" --min-severity medium
# linter task that needs git commit info
azdev linter "${mod}" --repo ./ --src "$diff_branch" --tgt "$merge_base" --rules missing_command_example
done
2 changes: 1 addition & 1 deletion .github/workflows/AzdevStyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ jobs:
do
echo changed module: "${mod}"
azdev extension add "${mod}"
azdev style "${mod}"
azdev style "${mod}"
done
16 changes: 15 additions & 1 deletion src/application-insights/azext_applicationinsights/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

helps['monitor app-insights'] = """
type: group
short-summary: Commands for querying data in Application Insights applications.
short-summary: Commands for querying data in Application Insights applications. <test abd>
parameters:
- name: --offset
short-summary: >
Expand Down Expand Up @@ -140,6 +140,20 @@
az monitor app-insights query --app e292531c-eb03-4079-9bb0-fe6b56b99f8b --analytics-query 'requests | summarize count() by bin(timestamp, 1h)' --offset 1h30m
"""

helps['monitor app-insights query-add'] = """
type: command
short-summary: Execute a query over data in your application.
parameters:
- name: --offset
short-summary: >
Time offset of the query range, in ##d##h format.
long-summary: >
Can be used with either --start-time or --end-time. If used with --start-time, then
the end time will be calculated by adding the offset. If used with --end-time (default), then
the start time will be calculated by subtracting the offset. If --start-time and --end-time are
provided, then --offset will be ignored.
"""

helps['monitor app-insights metrics show'] = """
type: command
short-summary: View the value of a single metric.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def load_command_table(self, _):

with self.command_group('monitor app-insights', query_sdk) as g:
g.custom_command('query', 'execute_query')
g.custom_command('query-add', 'execute_query_add')

with self.command_group('monitor app-insights component linked-storage'):
from .custom import LinkedStorageAccountLink, LinkedStorageAccountUpdate, LinkedStorageAccountShow, LinkedStorageAccountUnlink
Expand Down
3 changes: 3 additions & 0 deletions src/application-insights/azext_applicationinsights/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ def execute_query(cmd, client, application, analytics_query, start_time=None, en
raise ValueError("The Application Insight is not found. Please check the app id again.")
raise ex

def execute_query_add(cmd, client, offset='1h'):
pass


def get_events(cmd, client, application, event_type, event=None, start_time=None, end_time=None, offset='1h', resource_group_name=None):
timespan = get_timespan(cmd.cli_ctx, start_time, end_time, offset)
Expand Down
Loading