* trying to remove tracing
* trying to remove tracing
* use plugin sdk tracing
* tracing is not init
* add infra tracing back
* remove infra trace
* Update pkg/tsdb/azuremonitor/metrics/azuremonitor-datasource.go
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* pr feedback
* remove code from other pr
---------
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* Chore: Clean up the context handler
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
* Better comment
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
---------
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
* Use double quotes instead of backticks
* render time field as datetime
* add @react-awesome-query-builder/core
* Add time range filtering
* Update test
* Update macro test
* variables for filterforvalue
* use datalinkinput for basic matcher
* fix user select issue
* heatmap transformation variable interpolation
* clean code
* interpolate sort by
* add options interpolation in histogram transformation
* interpolation for limit
* Add suggestions UI to Filter by data value Transformation
Co-authored-by: oscarkilhed <oscar.kilhed@grafana.com>
* add validation for number/variable fields
* Add variables to add field from calculation
* Add validator to limit transformation
* Refactor validator
* Refactor suggestionInput styles
* Add variable support in heatmap calculate options to be in sync with tranform
* Refactor SuggestionsInput
* Fix histogram, limit and filter by value matchers
* clean up weird state ref
* Only interpolate when the feature toggle is set
* Add feature toggle to ui
* Fix number of variable test
* Fix issue with characters typed after opening suggestions still remains after selecting a suggestion
* Clean up from review
* Add more tests for numberOrVariableValidator
---------
Co-authored-by: Victor Marin <victor.marin@grafana.com>
* signing key wip
use db keyset storage
add signing_key table
add testing for key storage
add ES256 key tests
Remove caching and implement UpdateOrCreate
Stabilize interfaces
* Encrypt private keys
* Fixup signer
* Fixup ext_jwt
* Add GetOrCreatePrivate with automatic key rotation
* use GetOrCreate for ext_jwt
* use GetOrCreate in id
* catch invalid block type
* fix broken test
* remove key generator
* reduce public interface of signing service
* extend RuleStore interface to get namespace by UID
* add new export API endpoints
* implement request handlers
* update authorization and wire handlers to paths
* add folder error matchers to errorToResponse
* add tests for export methods
* Alerting: Expose metrics for Alertmanager Alerts
In Grafana, the alert evaluation and alert delivery are combined. We're always used a metric named `grafana_alerting_alerts` to get a sense of what are the alerts that are currently firing (these come from the evaluation side) and opted to not map the alertmanager alerts metric directly.
I think it's important that we make a disction between alerts that happen at evaluation vs alerts that are received for delivery by the internal Alertmanager as we have options to skip the delivery of these alerts to the internal alertmanager altogether.
* Migrate old alerting templates to use $labels
* Fix imports
* Add test coverage and separate rewriting to Go templates
* Fix lint
* Check for additional closing braces
* Add logging of invalid message templates
* Fix tests
* Small fixes
* Update comments
* Panic on empty token
* Use logtest.Fake
* Fix lint
* Allow for spaces in variable names by not tokenizing spaces
* Add template function to deduplicate Labels in a Value map
* Fix behavior of mapLookupString
* Reference deduplicated labels in migrated message template
* Fix behavior of deduplicateLabelsFunc
* Don't create variable for parent logger
* Add more tests for deduplicateLabelsFunc
* Remove unused function
* Apply suggestions from code review
Co-authored by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
* Give label val merge function better name
* Extract template migration and escape literal tokens
* Consolidate + simplify template migration
---------
Co-authored-by: William Wernert <william.wernert@grafana.com>
* Alerting: Manage remote Alertmanager silences
* fix typo
* check errors when encoding json in fake external AM
* take path from configured URL, check for nil responses
* Plugins: Add client middlware that forwards the signed grafana id token if present
* DsProxy: Set grafana id header if id token exists
* Add util function to apply id token to header
* Only add id forwarding middleware if feature toggle is enabled
* Add feature toggles to ds proxy and check if id forwarding is enabled
* Clean up test setup
* Change to use backend.ForwardHTTPHeaders interface
* PluginProxy: Forward signed identity when feature toggle is enabled
* PluginProxy: forrward signed id header
* Teams: Implement backend sorting
* Add docs
* Make name ordering case insensitive
* lint
* Fix no lowercasing on memberCount
* Add test to double check the filters or correctly OrderBy
* Initial POC for modified rule expor
* Add rule and group export options to modified export
* Add feature toggle for modifier export
* Rename GrafanaRuleDesigner to ModifyExportRuleForm to identify it easily as a rule form
* Refactor naming and folder for RuleDesigner => ModifyExport
* Don't render more action drop-down button when no more actions are allowed
* Redirect cancel button to alert list view
* Fix modify export page being reloaded correctly without errors
* Fix test
* Protect modify-export route when toggle-feature is not enabled
* Fix css betterer error
* Address pr review coments
---------
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
* User: Add sort option to user search
* Switch to an approach that uses the dashboard search options
* Cable user sort on the org endpoint
* Alias user table with u in org store
* Add test and cover orgs/:orgID/users/search endpoint
* Add test to userimpl store
* Simplify the store_test with sortopts.ParseSortQueryParam
* Account for PR feedback
* Positive check
* Update docs
* Update docs
* Switch to ErrOrFallback
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
---------
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* AuthN: Move identity struct to its own file
* IDForwarding: Add IDToken property to usr and identity structs and add GetIDToken to requester interface
* Inject IDService into background services
* IDForwarding: Register post auth hook when feature toggle is enabled
* spelling in error message
* imguploader: fix template for webdav url
Since a few years ago, when loading the config file, the template gets replaced in the expanding
env var phase (see ##25075) and introduced a bug in the webdav public_url config option. This commit
changes the template syntax to be {{file}}. This doesn't get expanded and removed when the config file
is loaded.
* devenv: add a block for a WebDAV server
* Adding alerting as codeowners for webdav
---------
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Fix unexpected error when creating a new cloudwatch datasource.
Involves a fair amount of refactoring, so if this causes unexpected issues related to region fetching we can turn this off with the cloudwatchNewRegionsHandler feature toggle, although we do not predict it will so we are enabling it to default to true and hope to remove it shortly.
* remove API tagging method and authed tagging
* add anonstore
move debug to after cache
change test order
fix issue where mysql trims to second
* add old device cleanup
lint
utc-ize everything
trim whitespace
* remove dangling setting
* Add delete devices
* Move anonymous authnclient to anonimpl
* Add simple post login hook
* move registration of Background Service
cleanup
* add updated_at index
* do not untag device if login err
* add delete device integration test
* Alerting: Don't use a separate collection system for metrics
The state package had a metric collection system that ran every 15s updating the values of the metrics - there is a common pattern for this in the Prometheus ecosystem called "collectors".
I have removed the behaviour of using a time-based interval to "set" the metrics in favour of a set of functions as the "value" that get called at scrape time.
* Add support for `keep_firing_for` in ruler proxy
* Don't delete `keep_firing_for` when editing a rule with the field set
Co-Authored-By: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
---------
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
* issue loki queries in parallel so total query time is only the slowest query rather than the sum of all query times.
* Fix lint
* Add running of queries in parallel behind feature toggle to test the functonality before release
* Add span end
* Move shared logic to separate function
* Add logging and tracing around running of all queries
---------
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
* Elasticsearch: Add tracing do data source
* Fix tests
* Address feedback
* Update pkg/tsdb/elasticsearch/response_parser.go
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* Update pkg/tsdb/elasticsearch/response_parser.go
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* Track error across both spans
* Add span for decoding of response
* Fix test
* Update setting of errors + fix test
---------
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
Changes SSE to not always fail all queries when one fails. Now only the query itself, and nodes that depend on it will error.
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* Allow creating correlations for provisioned data sources
* Update docs
* Fix linting
* Add missing props
* Add missing props
* Fix linting
* Fix linting
* Clarify error name
* Removed error handling for a non-existing use case
* Create a list of deleted data datasources based on all configs
* Add org_id to correlations
* Add tests
* Allow org_id to be null in case org_id=0 is used
* Create organization to ensure stable id is generated
* Fix linting
* Ensure backwards compatibility
* Add deprecation information
* Update comments
* Override existing datasSource variable so the UID is retrieved correctly
* Migrate correlations indices
* Default org_id when migrating
* Remove redundant default
* Make PK non-nullable
* Post merge fixes
* Separate data sources / correlations provisioning
* Adjust comments
* Store new data sources in spy store so it can be used to test correlations as well
* Fix linting
* Update tests
* Ensure response is closed
* Avoid creating duplicates during provisioning
* Fix updating provisioned column and update tests
* Rename error message
* Fix linting errors
* Fix linting errors and rename variable
* Update test
* Update pkg/services/sqlstore/migrations/correlations_mig.go
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Remove unused error
* Fix lining
---------
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* fix: revoked tokens within last hours
adds check for unlimited sessions out of index
adds a function for specifing the hours to look back when revoking users tokens, otherwise we "assume" the clean up takes care of them adds a index for the `user_auth_token` - `revoked_at` for faster queries when using `revoked_at`
* fix: sqllite datetime conversion with unixtimestamps
* fix: postgres dialect
* fix: mysql dialect
* fix: mysql dialect missing closing )
* refactor: delete revoked tokens directly
* fix: tests for sqlite
* AuthToken: Simplify DeleteUserRevokedTokens and add test
* fix: linting newline
* Reset get time after test
* fix: test order by revoked
* fix: order by different db
* ascending
* test with seen at
---------
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* Plugins: Dynamic angular patterns: Send If-None-Match to GCOM, store ETag
* Fix SetETag settings the wrong key in underlying kvstore
* Fix wrong type in GCOMResponse.Patterns and wrong content being saved
* Fix ctx passing to GetETag in background job
* Added more ETag tests
* More ETag tests
* Set last updated and log when not modified is returned
* Fix missing in-memory detectors update when etag matches, add comments
* Fix mutex usage
* delete PanelHeader
* PanelHeaderMenuItem is only used in PageHeader
* PanelHeaderCorner only used by PanelEditorTableView
* PanelHeaderMenuTrigger not used anywhere
* PanelHeaderMenuWrapperNew is PanelHeaderMenuWrapper, old one is deleted
* remove newPanelChromeUI from test
* delete feature flag newPanelChromeUI
* PanelHeaderMenuWrapperNew is PanelHeaderMenuWrapper, old one is deleted
* add token count
* wip
* user count method for tag reporting
* remove non functioning mysql clientFoundRows check
* Update pkg/services/auth/authtest/testing.go
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
* add user ID guard
---------
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>