grafana/pkg
Andreas Christou 3eea71cc6b
Azure: Basic Logs support (#88025)
* Azure monitor: Basic Logs frontend (#85905)

* adds datasource level config for enabling basic logs

* add basiclogsquery type to query json

* add toggle between basic and analytics

* adds basic logs toggle from UI, blocks time picker to only dashboard if basic logs is selected

* add check to remove UI if alerting

* tests for logsmanagement component

* tests for logs query editor

* tests for time mangement control

* remove unused imports

* clears query whenever toggle changes from basic <-> analytics

* add test to account for clearning query

* Update public/app/plugins/datasource/azuremonitor/components/ConfigEditor/BasicLogsToggle.tsx

wording

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* Update public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsQueryEditor.tsx

spelling

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* Update public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsQueryEditor.tsx

spelling

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* update dependency list

* clear basic logs if resources change

* fix tests

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* Azure Monitor: Basic Logs modal acknowledgement (#86244)

* adds datasource level config for enabling basic logs

* add basiclogsquery type to query json

* add toggle between basic and analytics

* adds basic logs toggle from UI, blocks time picker to only dashboard if basic logs is selected

* add check to remove UI if alerting

* tests for logsmanagement component

* tests for logs query editor

* tests for time mangement control

* remove unused imports

* add confirm modal

* clears query whenever toggle changes from basic <-> analytics

* add test to account for clearning query

* adds modal acknowledgement for basic logs query

* tests for handling modal logic

* basic logs ack type

* Update public/app/plugins/datasource/azuremonitor/components/ConfigEditor/BasicLogsToggle.tsx

wording

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* Update public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsQueryEditor.tsx

spelling

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* Update public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsQueryEditor.tsx

spelling

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* update dependency list

* clear basic logs if resources change

* remove modal from config page

* remove basic logs query ack type

* add modal acknowledgement to toggle between basic and analytics

* clear query if resources change

* fix tests

* fix tests

* Update public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsManagement.tsx

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* fix tests

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* Azure Monitor: Basic Logs Backend (#87653)

* fix logic for showingBasicLogsToggle

* move to utils function and add basiclogsquery in apply template variable

* add backend safeguards for basiclogsqueries

* adds support for calling search or query apis based on whether it is basic logs or not

* add tests for utils

* initial test for basic logs query in the backend

* tests for basic logs

* remve comment

* simplify checks for basic logs

* adds fromAlert prop for azure monitor backend services

* adds fromAlert check fo basic logs

* fix working and empty tags

* add telemetry for basic logs

* remove import from grafana core package

* change fromAlert true in tests

* change the way tests catch errors

* Update pkg/tsdb/azuremonitor/loganalytics/utils.go

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* Update pkg/tsdb/azuremonitor/loganalytics/utils.go

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* Update pkg/tsdb/azuremonitor/loganalytics/utils.go

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* Update pkg/tsdb/azuremonitor/loganalytics/azure-log-analytics-datasource.go

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* restructure code to only run basic logs checks if basiclogsflag is true

* data retention warning

* tests for calculate time range

* Simplify determining if request is from alerting

* Fix lint and bool check

* Fix tests

* clarify data retention

---------

Co-authored-by: Jocelyn <jcolladokuri@microsoft.com>
Co-authored-by: jcolladokuri <jocelyncollado52@gmail.com>

* Azure Monitor: Basic Logs data volume notification (#88009)

* frontend changes for data ingested warning

* initial logic for getResource

* payload processing

* create basicLogs usage function

* add utils for converting time and getting the data volume query for basic logs

* frontend updates for showing the data ingested for the given query

* frontend tests

* add check for when no dataIngested is returned

* remove backend.logger prints

* comment on what function does

* fix merge

* make resource URI regex case insensitive

* add support for workspace variables in basic logs flow

* add undefined check

* structure and add tests for variable support

* Update pkg/tsdb/azuremonitor/loganalytics/azure-log-analytics-datasource.go

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* add tracing for basic logs usage request

* clean up data volume query struct

* use async/await instead of callback

* fix parameters for getApiURL

* restrict time on usage query to 8 days max

* add time to dependency array to refetch basic logs usage

* move time check implementation to backend

* fix utils tests

---------

Co-authored-by: Jocelyn <jcolladokuri@microsoft.com>
Co-authored-by: jcolladokuri <jocelyncollado52@gmail.com>

---------

Co-authored-by: jcolladokuri <jcolladokuri@microsoft.com>
Co-authored-by: jcolladokuri <jocelyncollado52@gmail.com>
2024-05-28 18:06:27 +01:00
..
api Refactor plugin context initialization (#88343) 2024-05-28 16:59:06 +03:00
apimachinery Prometheus: Update dependency to v0.52.0 (#87809) 2024-05-28 15:22:20 +02:00
apis Scopes: Change JS linkID to linkId (#87831) 2024-05-14 11:01:21 -04:00
apiserver Add latency metrics to mode2 (#88011) 2024-05-28 16:15:53 +02:00
build Prometheus: Update dependency to v0.52.0 (#87809) 2024-05-28 15:22:20 +02:00
bus Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
cmd RBAC: Expand action sets when fetching permissions (#87967) 2024-05-21 15:09:26 +01:00
codegen Chore: Upgrade/fix deps after thema removal (#86763) 2024-04-25 20:52:09 +02:00
components Chore: Bump google.golang.org/grpc to 1.64.0 (#88219) 2024-05-27 12:44:39 +02:00
events Alerting: Update rules version when folder title is updated (#53013) 2022-08-01 19:28:38 -04:00
expr Plugins: Support Admission validation hooks (#87718) 2024-05-24 18:45:16 +03:00
extensions Caching: Implement mtls-enabled memcached integration (#84171) 2024-05-09 15:12:08 -04:00
generated K8s: update hack codegen script (#81216) 2024-01-25 12:01:09 -08:00
ifaces/gcsifaces Chore: Upgrade Go to 1.19.1 (#54902) 2022-09-12 12:03:49 +02:00
infra Tracing: Various improvements (#88308) 2024-05-27 14:21:40 +02:00
kinds Schemas: Replace registry generation and github workflow (#83490) 2024-03-13 18:05:21 +02:00
login/social OIDC: Support Generic OAuth org to role mappings (#87394) 2024-05-23 09:55:45 +02:00
middleware Fix: Proper plugin logo loading depending on staging (#88247) 2024-05-27 10:26:30 +02:00
mocks/mock_gcsifaces Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
models Auth: Add empty role definition (#64694) 2023-07-06 15:40:06 +02:00
modules Storage Api: Add metrics (#85316) 2024-04-08 08:35:01 -06:00
plugins Plugins: Support Admission validation hooks (#87718) 2024-05-24 18:45:16 +03:00
promlib Prometheus: Update dependency to v0.52.0 (#87809) 2024-05-28 15:22:20 +02:00
registry Tracing: Various improvements (#88308) 2024-05-27 14:21:40 +02:00
server RBAC: Clean up action set code (#88147) 2024-05-23 12:14:01 +01:00
services Alerting: Scheduled recording rules execute their queries (#88309) 2024-05-28 10:59:21 -05:00
setting Actionsets: Add cfg option for only writing actionsets (#88367) 2024-05-28 16:32:23 +01:00
tests Actionsets: Add cfg option for only writing actionsets (#88367) 2024-05-28 16:32:23 +01:00
tsdb Azure: Basic Logs support (#88025) 2024-05-28 18:06:27 +01:00
util Errors: Update errutil to be compatible with k8s errors (#87605) 2024-05-20 18:11:37 +03:00
web Image Rendering: Add settings for default width, height and scale (#82040) 2024-02-26 13:27:34 +01:00
README.md Chore: Move all backend contribution documents to a single directory (#61140) 2023-01-11 11:16:52 +01:00
ruleguard.rules.go Chore: update all +build statements (#38782) 2021-09-01 17:38:56 +03:00

This directory contains the code for the Grafana backend.

The contributor documentation for Grafana's backend is in /contribute/backend/README.md.