* tidy up some styles
* remove NavBarMenuItemWrapper + consolidate components
* lots of renaming
* use object syntax in FeatureHighlight
* fix a couple of missing find+replace
* adjust li positioning
* fix text truncation
* bit more tidy up
* refactor indent into it's own component
* memoize styles in Indent
This is necessary to allow version inference in CI builds.
Shortcodes like `docs/reference` and `docs/shared` use version inference to avoid the writer having to hardcode specific versions or use relative paths within the documentation set.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Add functions to detect build edition and env
* Prevent showing insights for OSS
* Use common functions for Declare Incident button
* Address review comments
* 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>
* Error handling for the hook to expose `error` as part of the state
* Monitor errors at the hook level to catch common OpenAI issues
* Allow retry when the request fails
* Optimize onGenerate number of calls
* Re-enable component tests
* 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
* Replace use of `relref` shortcode with `docs/reference` so links work in Grafana Cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Link to Grafana Cloud content
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Details in https://github.com/grafana/website/pull/15518.
This canonical should never be used.
This page is the only consistent page that exists in Grafana Cloud documentation but not in "latest" Grafana open source documentation.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Publish documentation from the HEAD of the matching version branch on tag events
Tags aren't necessarily made to the HEAD of the version branch.
The documentation that should be published is always on the HEAD of the version branch.
This is another mismatch between the code and documentation but is desirable as the "What's new" documentation is typically added much later than commit the tag targets.
Technically it would be more correct for the "What's new" documentation to be in place before the commit that is tagged.
However, the significant lag between the start of a release and the actual publishing of the tag would be challenging to codify in this action's logic.
It would also require a side channel for non-code related documentation updates to be made to the docs released by the tag.
This would likely require a long lived branch to be created at the tag commit and I'm not sure that the additional work is justified.
In practice, I think we can get away with publishing more recent documentation than the code given the assumption that no significant feature is going to be absent from the initial major/minor release.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Switch to detached remote branch reference
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* 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