Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzureMonitor: Add switch to control time-range for Logs queries #71278

Merged
merged 6 commits into from
Jul 17, 2023

Conversation

aangelisc
Copy link
Contributor

Based on community feedback the move to implicitly using the Grafana time-range has caused some unexpected behaviour. This change adds a switch to allow users to control the behaviour. Setting the switch to Query will ensure that only time-ranges specified within the query are used. Setting the switch to Intersection will make use of the Grafana time-range intersected with any time-ranges specified within the query. The default behaviour is to use the Query time-ranges only.

image

Fixes #71180

Related:

- Default intersectTime property to false
- Add intersectTime field
- Update tests
- Update mocks
- Add onChange function
- Appropriately set intersectTime for logs queries
- intersectTime is always true for Traces queries
- Update tests
@grafana-delivery-bot

This comment was marked as outdated.

Copy link
Contributor

@asimpson asimpson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dig it 🏆 nice work

Copy link
Contributor

@mckn mckn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aangelisc aangelisc merged commit 480ccf6 into main Jul 17, 2023
18 of 19 checks passed
@aangelisc aangelisc deleted the andreas/logs-time-range branch July 17, 2023 11:02
@grafana-delivery-bot grafana-delivery-bot bot modified the milestones: 10.0.x, 10.1.x Jul 17, 2023
@grafana-delivery-bot

This comment was marked as outdated.

@grafana-delivery-bot grafana-delivery-bot bot added the backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. label Jul 17, 2023
@aangelisc aangelisc removed type/bug backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. backport v10.0.x labels Jul 17, 2023
@aangelisc
Copy link
Contributor Author

Due to additional complexities around schema changes this will not be backported.

linoman pushed a commit that referenced this pull request Jul 24, 2023
* Update types

* Update migration

- Default intersectTime property to false

* Update frontend components

- Add intersectTime field
- Update tests
- Update mocks
- Add onChange function

* Update backend

- Appropriately set intersectTime for logs queries
- intersectTime is always true for Traces queries
- Update tests

* Update docs

* Fix test and lint
@ricky-undeadcoders ricky-undeadcoders modified the milestones: 10.1.x, 10.1.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure Monitor: Explicit injection of the optional timespan field in Log Analytics queries
5 participants