Commit Graph

428 Commits

Author SHA1 Message Date
Yuri Tseretyan
f990be58cb
Alerting: Use all notifiers from alerting repository (#60655) 2022-12-22 09:27:18 -05:00
sam boyer
b8253ac3b9
deps: Update thema, use CUE fork (#60496)
* deps: Update thema, use CUE fork

* Remove superfluous openapi-codegen output

* Update thema again to catch cuetsy changes

* Rerun codegen with latest

* Latest thema, removes cuetsy update

* Latest of cuetsy

* Update type usage

* One last cuetsy rollback

* Update playlist summary tests

* More lint fixes

* Remove TS veneer changes for VariableHide

Co-authored-by: Clarity-89 <homes89@ukr.net>
2022-12-22 07:20:02 -05:00
Andres Martinez Gotor
10cfc27397
AzureMonitor: Update SDK version (#60372) 2022-12-20 16:20:31 +01:00
Yuri Tseretyan
35090c376c
Alerting: Replace VictorOps receiver with the one from alerting repository (#60543)
* replace victorops with one from alerting

* update other usages
2022-12-20 10:55:41 +01:00
Yuri Tseretyan
f0cabe14d5
Alerting: import Grafana alerting package and update usages (#60490)
* update remaining notifiers to use alerting package
2022-12-19 10:53:58 -05:00
Marcus Efraimsson
6478d0a5ef
Plugins: Forward user header (X-Grafana-User) in backend plugin requests (#58646)
Grafana would forward the X-Grafana-User header to backend plugin request when 
dataproxy.send_user_header is enabled. In addition, X-Grafana-User will be automatically
forwarded in outgoing HTTP requests for core/builtin HTTP datasources. 
Use grafana-plugin-sdk-go v0.147.0.

Fixes #47734

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2022-12-15 15:28:25 +01:00
Ryan McKinley
cf055ab4ec
k8s: Add a dev only feature flag and simple service to get a client (#60204) 2022-12-13 07:41:16 -08:00
Kyle Brandt
4e0f95dc31
Chore: Update SDK to v0.145.0 with TimeSeriesMulti Constant (#59729) 2022-12-05 12:48:10 -05:00
Ryan McKinley
b0b74337f1
Chore: fix go.mod and slugify after merge (#59611) 2022-11-30 16:16:57 -05:00
Ryan McKinley
5b71a16acf
Slugify: Replace gosimple/slug with a simple function (#59517) 2022-11-30 11:12:56 -05:00
Emil Tullstedt
f485f8a8f8
Chore: Upgrade Go dependencies (#59501) 2022-11-29 16:37:45 +01:00
Erik Sundell
254577ba56
CloudWatch: Cross-account querying support (#59362)
* Lattice: Point to private prerelease of aws-sdk-go (#515)

* point to private prerelease of aws-sdk-go

* fix build issue

* Lattice: Adding a feature toggle (#549)

* Adding a feature toggle for lattice

* Change name of feature toggle

* Lattice: List accounts (#543)

* Separate layers

* Introduce testify/mock library

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>

* point to version that includes metric api changes (#574)

* add accounts component (#575)

* Test refactor: remove unneeded clientFactoryMock (#581)

* Lattice: Add monitoring badge (#576)

* add monitoring badge

* fix tests

* solve conflict

* Lattice: Add dynamic label for account display name (#579)

* Build: Automatically sync lattice-main with OSS

* Lattice: Point to private prerelease of aws-sdk-go (#515)

* point to private prerelease of aws-sdk-go

* fix build issue

* Lattice: Adding a feature toggle (#549)

* Adding a feature toggle for lattice

* Change name of feature toggle

* Lattice: List accounts (#543)

* Separate layers

* Introduce testify/mock library

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>

* point to version that includes metric api changes (#574)

* add accounts component (#575)

* Test refactor: remove unneeded clientFactoryMock (#581)

* Lattice: Add monitoring badge (#576)

* add monitoring badge

* fix tests

* solve conflict

* add account label

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* fix import

* solve merge related problem

* add account info (#608)

* add back namespaces handler

* Lattice: Parse account id and return it to frontend (#609)

* parse account id and return to frontend

* fix route test

* only show badge when feature toggle is enabled (#615)

* Lattice: Refactor resource response type and return account (#613)

* refactor resource response type

* remove not used file.

* go lint

* fix tests

* remove commented code

* Lattice: Use account as input when listing metric names and dimensions (#611)

* use account in resource requests

* add account to response

* revert accountInfo to accountId

* PR feedback

* unit test account in list metrics response

* remove not used asserts

* don't assert on response that is not relevant to the test

* removed dupe test

* pr feedback

* rename request package (#626)

* Lattice: Move account component and add tooltip (#630)

* move accounts component to the top of metric stat editor

* add tooltip

* CloudWatch: add account to GetMetricData queries (#627)

* Add AccountId to metric stat query

* Lattice: Account variable support  (#625)

* add variable support in accounts component

* add account variable query type

* update variables

* interpolate variable before its sent to backend

* handle variable change in hooks

* remove not used import

* Update public/app/plugins/datasource/cloudwatch/components/Account.tsx

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* Update public/app/plugins/datasource/cloudwatch/hooks.ts

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* add one more unit test

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* cleanup (#629)

* Set account Id according to crossAccountQuerying feature flag in backend (#632)

* CloudWatch: Change spelling of feature-toggle (#634)

* Lattice Logs (#631)

* Lattice Logs

* Fixes after CR

* Lattice: Bug: fix dimension keys request (#644)

* fix dimension keys

* fix lint

* more lint

* CloudWatch: Add tests for QueryData with AccountId (#637)

* Update from breaking change (#645)

* Update from breaking change

* Remove extra interface and methods

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>

* CloudWatch: Add business logic layer for getting log groups (#642)



Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* Lattice: Fix - unset account id in region change handler (#646)

* move reset of account to region change handler

* fix broken test

* Lattice: Add account id to metric stat query deep link (#656)

add account id to metric stat link

* CloudWatch: Add new log groups handler for cross-account querying (#643)

* Lattice: Add feature tracking (#660)

* add tracking for account id prescense in metrics query

* also check feature toggle

* fix broken test

* CloudWatch: Add route for DescribeLogGroups for cross-account querying (#647)

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>

* Lattice: Handle account id default value (#662)

* make sure right type is returned

* set right default values

* Suggestions to lattice changes (#663)

* Change ListMetricsWithPageLimit response to slice of non-pointers

* Change GetAccountsForCurrentUserOrRole response to be not pointer

* Clean test Cleanup calls in test

* Remove CloudWatchAPI as part of mock

* Resolve conflicts

* Add Latest SDK (#672)

* add tooltip (#674)

* Docs: Add documentation for CloudWatch cross account querying (#676)

* wip docs

* change wordings

* add sections about metrics and logs

* change from monitoring to observability

* Update docs/sources/datasources/aws-cloudwatch/_index.md

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* Update docs/sources/datasources/aws-cloudwatch/query-editor/index.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/datasources/aws-cloudwatch/query-editor/index.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/datasources/aws-cloudwatch/query-editor/index.md

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* Update docs/sources/datasources/aws-cloudwatch/query-editor/index.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* apply pr feedback

* fix file name

* more pr feedback

* pr feedback

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* use latest version of the aws-sdk-go

* Fix tests' mock response type

* Remove change in Azure Monitor

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>
Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
2022-11-28 12:39:12 +01:00
Kevin Minehart
45c759eb59
CI: Make the downstream enterprise test a check instead of comments (#59071) 2022-11-24 08:17:12 -06:00
Guilherme Caulada
414df842b8
Build: Add command to publish to AWS Marketplace through the pipeline (#59068)
* Remove generic variables from publish github action

* Create publish aws cmd to automate aws releases

* Add tests to publish aws cmd

* Replace fmt with log for prints

* Remove unnecessary type assertions

* Readd mistakenly removed go package

* Replace log with fmt for prints due to conflicts

* Update github tests to conform with casing
2022-11-22 13:04:14 -03:00
Gilles De Mey
ea27eca147
Email: Use MJML email templates (#57751)
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2022-11-17 21:41:46 +01:00
sam boyer
c4528f9bd8
codejen: Update to latest codejen (#58866) 2022-11-16 15:08:01 -05:00
sam boyer
78f0340031
plugindef: Move pluginmeta out of coremodels as standalone thema lineage (#56765)
* Get pluginmeta mostly moved over to pkg/plugins/plugindef

* Remove dead func

* Fix up pfs, use sync.Once in plugindef

* Update to latest thema

* Chase Endec->Codec conversion in Thema

* Comments on slash header gen; use ToSlash

* Also generate JSON schema for plugindef

* Generate JSON Schema as well

* Fix slot loading from kindsys cue decls

* Remove unused vars

* skip generating plugin.schema.json for now

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-11-15 14:48:31 +01:00
sam boyer
07e5f8117f
Reconcile coremodels, entities, objects under new kind framework (#56492)
* Update thema to latest

* Deal with s/Library/*Runtime/

* Commit new, working results of codegen

* We like pointers now

* Always take runtime arg for NewBase()

* Sketchy handwavy pass at entity meta framework

* Little nibbles

* Update pkg/framework/coremodel/entityframework.cue

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>

* Move file into new framework location

* Introduce loaders, Go code

* Complete rename to kind

* Flesh out framework, add svg/dashboard examples

* Cruft removal

* Remove generated kind go files from gitignore

* Refine maturity concept, add SlotKind

* Update embed and go deps

* Export PrefixWithGrafanaCUE

* Make the loader actually work, holy crap

* Many small tweaks to type.cue

* Add Apache 2 licensing exceptions for kinds

* Add new kinds dir, start of generator

* Roll back to earlier oapi-codegen

* Introduce new grafana-specific CUE loaders

* Introduce new tidy code generators framework

* Catch up kind framework with tinkering

* Add slices for the generators

* Add write/verify step to main generator

* Many renames

* Split up kind framework cue files

* Use kind.Decl within generated kinds

* Create kind.SomeDecl wrapper type to cache lineages

* Better names again

* Get one generated implemented, hopefully

* Copy dashboard schema into new kind.cue

* Small fixes to make the initial gen work

* Put svg kind in its new home

* Add generated Go dashboard type

* More renames and cleanups

* Add base kind registry and generator

* Stop blacklisting *_gen.go files

This is not the Go best practice, anyway. All we actually want to ignore
for enterprise is generated wire files.

* Change codegen output directories

pkg/kind -> pkg/kinds
pkg/registry/kindreg -> pkg/registry/corekind

* Rename pkg/framework/kind to pkg/kindsys

* Add core structured kind generator

* Add plural and machine names to kind spec

* Copy playlist over to kind system

* Consolidate kindsys files

* Add raw kind generator

* Update CODEOWNERS for kind framework

* Touch up comments a bit

* More docs tweaks

* Remove generated types to reduce noise for review

* Split each generator into its own file

* Rename Slot kind to Composable kind

* Add handwavy types for customkind loading

* Guard against init calls to framework loader

* First pass at doc on extending the kind system

* Improve attribute example in docs

* Fix wire imports

* Add basic TS types generator

* Fix composable kind category def

* No need for a separate file with generate directive

* Catch dashboard schema up

* Rename generator types to something saner and generic

* Make version configurable in ts/go generators

* Add CommonMeta to ease property access

* Add kindsys prop indicating whether lineage is group

* Put all kind categories back in a single file

* Finish with kindsys group props

* Refactor maturity progression per discussion

- Replace "committed" with "merged"
- All kindcats can use all maturity levels, at least for now

* Convert ts veneer index generator to modular system

* Move over to new jennywrites framework

* Strip down old coremodel generator

* Use public version of jennywrites

* Pull latest thema

* Commit generated Go types

* Add header injection postprocessor

* Move sdboyer/jennywrites to grafana/codejen

* Tweak header output

* Remove dashboard and playlist coremodels

* Fix up backend dashboards devenv test

* Fix TS import patterns to new gen filename

* Update internal imports, remove coremodel registry

* Fix compilation errors, wire generation

* Export and replace the prefix dropper

* More Go struct and field name changes

* Last name fixes, hopefully

* Fix lint errors

* Last lint error

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
2022-11-10 12:36:40 -08:00
Emil Tullstedt
990d8cd22e
Chore: Upgrade go-sqlite3 to v1.14.16 (#58581) 2022-11-10 15:49:28 +01:00
Marcus Efraimsson
faa0fda6eb
Prometheus: Upgrades http client to v1.13.1 (#58363) 2022-11-08 08:35:05 +01:00
Dimitris Sotirakis
bdb8fe3b02
Update drone-cli go mod to v1.6.1 (#58245) 2022-11-05 09:52:21 +02:00
Giuseppe Guerra
7996a1c8ad
Chore: Update grafana-plugin-sdk-go to v0.142.0 (#58115)
* Chore: Update grafana-plugin-sdk-go to v0.142.0

* Update tests and golden files for 207 status code

* Chore: Move update flag definition at the top in response_parser_test.go

* retrigger

Co-authored-by: Will Browne <will.browne@grafana.com>
2022-11-03 18:34:27 +01:00
Emil Tullstedt
d0dfb28ee4
Security: Upgrade x/text to version unaffected by CVE-2022-32149 (#57797) (#57803)
Co-authored-by: emerson_gong <yong-jie.gong@microfocus.com>
2022-11-02 14:28:43 +01:00
Petr Stupka
e99f75f0ca
Alerting: Linking external images securely - Azure Blob (#1) (#56598) 2022-11-01 13:02:17 +01:00
Andrej Ocenas
0845ac2f53
Profiling: Add Phlare and Parca datasources (#57809)
* Add phlare datasource

* Rename

* Add parca

* Add self field to parca

* Make sure phlare works with add to dashboard flow

* Add profiling category and hide behind feature flag

* Update description and logos

* Update phlare icon

* Cleanup logging

* Clean up logging

* Fix for shift+enter

* onRunQuery to set label

* Update type naming

* Fix lint

* Fix test and quality issues

Co-authored-by: Joey Tawadrous <joey.tawadrous@grafana.com>
2022-10-28 13:33:37 +02:00
Jo
77437f2c89
Add multi-auth devenv (#57609)
* add authentik devenv

* remove direct dependency on spew

* use cn

* add authentik instructions

* add backup instructions
2022-10-26 13:46:50 +02:00
Guilherme Caulada
96a97f9827
Build: Add github release command to build/cmd (#56349)
* Add github release command to build/cmd

* Use go-github library and implement dry-run

* Make tag optional and default to metadata

* Fix minor bug with tag default

* Make some refactors to ease testing

* Add tests for publish github command

* Refactor publish github tests

* Refactor test helper function name

* Isolate local test
2022-10-20 11:11:53 -03:00
Santiago
9996dbd577
use Prometheus' format for notification attempts durations (#56822) 2022-10-13 10:08:09 -03:00
Sofia Papagiannaki
97730aec10
Chore: Bump golang.org/x/text (#56841) 2022-10-13 11:26:25 +03:00
sam boyer
e5a6547a94
coremodels: Update to latest Thema with generics (#56602)
* Update thema to latest

* Deal with s/Library/*Runtime/

* Commit new, working results of codegen
2022-10-11 09:45:07 +01:00
Joe Blubaugh
13067b39da
Alerting: Update replacement of prometheus-alertmanager (#56519)
grafana.com/grafana/prometheus-alertmanager has been updated to a
version that fixes some bugs upstream. This change just updates that
dependency and a few shared ones.
2022-10-07 17:10:20 +08:00
Sofia Papagiannaki
91b4ce08a9
Update github.com/labstack/echo/v4 (#56226) 2022-10-04 14:31:05 +03:00
Joe Blubaugh
ce89624ca2
Alerting: Update imported prometheus alertmanager version. (#56228)
Version 0.24.0 has a few bugs that cause panics. We update here to the
latest commit on github.com/prometheus/alertmanager's main branch.

Panic Bugs:
https://github.com/prometheus/alertmanager/issues/2936
https://github.com/prometheus/alertmanager/issues/3064
2022-10-04 17:41:34 +08:00
Santiago
09f8e026a1
Alerting: Expose info about notification delivery errors in a new /receivers endpoint (#55429)
* (WIP) switch to fork AM, first implementation of the API, generate spec

* get receivers avoiding race conditions

* use latest version of our forked AM, tests

* make linter happy, delete TODO comment

* update number of expected paths to += 2

* delete unused endpoint code, code review comments, tests

* Update pkg/services/ngalert/notifier/alertmanager.go

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>

* remove call to fmt.Println

* clear naming for fields

* shorter variable names in GetReceivers

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2022-10-03 10:58:41 -03:00
ms-hujia
ec024ae960
Azure Monitor: Add support to customized routes (#54829) 2022-10-03 12:33:37 +02:00
Shirley
09079bfb65
Upgrade to grafana-aws-sdk v0.11.0 (#56042) 2022-09-30 13:51:28 +02:00
emerson_gong
4ffa0532f0
Security: Fix CVE-2022-27664 (#55361)
* Fix CVE-2022-27664

* update golang.org/x/sys in go.sum
2022-09-28 17:35:06 +03:00
sam boyer
e2ff875976
codegen: Introduce TS codegen veneer (#54816)
* Split all named types out into defs, etc.

* Use latest cuetsy, refactor generators accordingly

* Return AST type from plugin TS generator

* Near-complete checkin of TS veneer code generator

* First full completed pass

* Improve the attribute name

* Defer use of the dashboard veneer type to follow-up

* Remove dummy index, prettier on veneer

* Fix merge errors in gen.go

* Add match field to SpecialValueMap

* Fix backend lint errors
2022-09-26 11:26:18 -04:00
Alexander Emelin
0e6a8cc6ac
Live: Migrate to centrifuge-js v3 (new API and client protocol) (#51977) 2022-09-20 11:39:46 -04:00
Kevin Minehart
ed5d617cb9
CI: move grabpl verify-drone (#55057)
* move grabpl verify-drone
2022-09-14 08:59:18 +03:00
Dave Henderson
713075c494
Metrics: Fixed grafana_database_conn_* metrics, and added new go_sql_stats_* metrics as eventual replacement (#54405)
* metrics: Fix broken DBStats metrics

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* Register the sqlstats metrics by default

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2022-08-31 08:54:32 -04:00
Marcus Efraimsson
cd5f27a25d
Plugins: Propagate distributed tracing headers to backend plugins (#54107) 2022-08-24 11:55:49 +02:00
sam boyer
4d433084a5
plugins: New static scanner and validator, with Thema slot support (#53754)
* coremodels: Convert plugin-metadata schema to a coremodel

* Newer cuetsy; try quoting field name

* Add slot definitions

* Start sketching out pfs package

* Rerun codegen with fixes, new cuetsy

* Catch up dashboard with new cuetsy

* Update to go1.18

* Use new vmuxers in thema

* Add slot system in Go

* Draft finished implementation of pfs

* Collapse slot pkg into coremodel dir; add PluginInfo

* Add the mux type on top of kernel

* Refactor plugin generator for extensibility

* Change models.cue package, numerous debugs

* Bring new output to parity with old

* Remove old plugin generation logic

* Misc tweaking

* Reintroduce generation of shared schemas

* Drop back to go1.17

* Add globbing to tsconfig exclude

* Introduce pfs test on existing testdata

* Make most existing testdata tests pass with pfs

* coremodels: Convert plugin-metadata schema to a coremodel

* Newer cuetsy; try quoting field name

* Add APIType control concept, regen pluginmeta

* Use proper numeric types for schema fields

* Make pluginmeta schema follow Go type breakdown

* More decomposition into distinct types

* Add test case for no plugin.json file

* Fix missing ref to #Dependencies

* Remove generated TS for pluginmeta

* Update dependencies, rearrange go.mod

* Regenerate without Model prefix

* Use updated thema loader; this is now runnable

* Skip app plugin with weird include

* Make plugin tree extractor reusable

* Split out slot lineage load/validate logic

* Add myriad tests for new plugin validation failures

* Add test for zip fixtures

* One last run of codegen

* Proper delinting

* Ensure validation order is deterministic

* Let there actually be sorting

* Undo reliance on builtIn field (#54009)

* undo builtIn reliance

* fix tests

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2022-08-22 12:11:45 -04:00
Carl Bergquist
a74681036e
prometheus: upgrades http client to 1.30 (#53901)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2022-08-18 18:44:31 +01:00
sam boyer
c23a9d78ab
Actually enforce dashboard schema on devenv (#53797)
* Relocate dashboards test so it runs

* Cover newer schema versions in stripnulls

* Strip nulls and remove iteration fields

* Fix fiscalYearStartMonth bounds

* Fix up and format dashboard schema

* Update thema, tidy Go dependencies
2022-08-16 22:07:57 -04:00
ying-jeanne
25de383540
Chore: Replace xorm with sqlx (#52575)
* Change of sqlstore to use sqlx

* Use sqlx in the playlist store

* Refectory of the interface

* update playlist service

* go mod tidy

* some refectory on interface

* fix kyle
2022-08-16 13:17:14 -05:00
Yuriy Tseretyan
e3da9da51d
update alertmanager to 0.24 (#53555) 2022-08-11 17:54:32 -04:00
Kevin Minehart
d117689aea
CI: move grabpl build-frontend from grabpl to grafana (#53073)
* move grabpl build-frontend
2022-08-10 10:29:51 -04:00
sam boyer
e6903582d0
coremodels: Include nested optional fields in output (#53355) 2022-08-08 21:48:21 +00:00
Ryan McKinley
197acd73c0
Storage: support git + github backed roots (#52192) 2022-07-28 23:26:44 -07:00