Usage Stats: Calculate concurrent users as a histogram
Metric will help to understand if users are sharing their credentials or using one account for concurrent sessions. This will help to make more informed decisions when enforcing any license limitations on credentials usage.
* fall back to any architecture when getting plugin's checksum
* Update pkg/cmd/grafana-cli/commands/install_command.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* remove typo
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* use sha256 checksum instead of md5
* Chore: Rewrite ldap login test to standard library (#29998)
* Chore: Rewrite ldap login test to standard library
* Preserve original ldap enabled setting after test
* Chore: Rewrite models alert test to standard library (#30021)
* Chore: Rewrite models dashboard acl test to standard library (#30022)
* Chore: Rewrite models dashboards test to standard library (#30023)
* Chore: Rewrite login auth test to standard library (#29985)
* Chore: Rewrite login auth test to standard library
* Use assert.Empty when empty string expected
* Chore: Rewrite brute force login protection test to standard library (#29986)
* Update pkg/cmd/grafana-cli/services/api_client.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Update pkg/cmd/grafana-cli/services/api_client.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* use sha256 checksum instead of md5
* Update pkg/cmd/grafana-cli/services/api_client.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Update pkg/cmd/grafana-cli/services/api_client.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* grafana-cli: Remove MD5
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Emil Hessman <emil@hessman.se>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* SQLStore: customise the limit of retrieved datasources per organisation
* update all suggestions regarding nil or 0 as default
* Apply suggestions from code review
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* correct default.ini description + adding unittest
* Apply suggestions from code review
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
* modify unittest name
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
* Add fake TeamSyncService
* Change SyncTeams dispatch to direct method call
* Remove SyncTeamsCommand struct
* Move TeamSyncService to a separate package
* Remove context from SyncTeams args
* Add comments to teamsyncgroup package
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* Replace TeamSyncService with TeamSyncFunc
* Remove unnecessary error check
* Add a test
* Fix test input
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* PanelLibrary: Adds get to the API
* Refactor: adds tests for get and getAll and cleans up other tests
* Refactor: changed name on DTO
* Update pkg/services/librarypanels/api.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Update pkg/services/librarypanels/database.go
* Always use cache: stop passing skipCache among ngalert functions
* Add updated column
* Scheduler initial draft
* Add retry on failure
* Allow settting/updating alert definition interval
Set default interval if no interval is provided during alert definition creation.
Keep existing alert definition interval if no interval is provided during alert definition update.
* Parameterise alerting.Ticker to run on custom interval
* Allow updating alert definition interval without having to provide the queries and expressions
* Add schedule tests
* Use xorm tags for having initialisms with consistent case in Go
* Add ability to pause/unpause the scheduler
* Add alert definition versioning
* Optimise scheduler to fetch alert definition only when it's necessary
* Change MySQL data column to mediumtext
* Delete alert definition versions
* Increase default scheduler interval to 10 seconds
* Fix setting OrgID on updates
* Add validation for alert definition name length
* Recreate tables
Adding an interface type for usage stats service allows us to not depend on the implementation outside of the package, for example when testing we can easily mock the service
The change allows to add external, additional metrics which will be reported with the rest of hardcoded metrics, allowing to add metrics without a need to change the service itself.
* create page and sidebar entry
* add components for query editor and definition
* split pane things
* add reducer and action
* implement split pane and update ui actions
* making things pretty
* Unify toolbar
* minor tweak to title prefix and some padding
* can create definitions
* fix default state
* add notificaion channel
* add wrappers to get correct spacing between panes
* include or exclude description
* implement query editor
* start on query result component
* update from master
* some cleanup and remove expressions touch ups
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* middleware: Move context handler to own service
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Emil Tullsted <sakjur@users.noreply.github.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
* DataSourceSettings: Add servername field to DataSource TLS config
A DNS lookup URL can be provided in the DataSource URL field in order
to dynamically load balance between multiple instances of a DataSource.
When using mutual TLS, Golang's TLS config implementation checks that
the certificate's common name (< 1.15) or subject alternative name
(>= 1.15) has the same value as the domain being accessed. If the DNS
entry is dynamically generated for a specific environment, the
certificate cannot be generated with a name matching the dynamic
DNS URL. As such, Golang offers a servername field that can be set to
overwrite what value is used when checking against the certificate's
common name (or subject alternative name). Without this change, Skip
TLS Verify must be set to true in order for the DataSource to work,
removing some of the benefits gained by using mutual TLS.
This commit adds the ability to set Grafana's internal Golang TLS config
servername field from the UI or a provisioned DataSource.
The servername field is optional and the existing behavior is retained if
the field is not set.
Co-authored-by: Dana Pruitt <dpruitt@vmware.com>
Co-authored-by: Jeremy Alvis <jalvis@pivotal.io>
* Update docs with PR review changes
Co-authored-by: Jeremy Alvis <jalvis@pivotal.io>
Co-authored-by: Dana Pruitt <dpruitt@vmware.com>
* Update with additional PR requested changes
* Minor updates based on PR change requests
Co-authored-by: Dana Pruitt <dpruitt@vmware.com>