mirror of https://github.com/grafana/grafana
commit
2e0baa318b
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,177 @@ |
||||
name: New Bug Report |
||||
description: File a bug report |
||||
title: "Product-Area-Here: short description of bug here" |
||||
body: |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
Thanks for taking the time to fill out this bug report! |
||||
|
||||
Please try to give your issue a good title. Try using the product-area where you are having an issue and a brief description of the problem. Like this: |
||||
- `Dashboards: Template Variables break when I do X` or |
||||
- `Alerting: message templating plus Slack channel breaks when I do X` |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
**HINT:** Have you tried [searching](https://github.com/grafana/grafana/issues) for similar issues? Duplicate issues are common. |
||||
|
||||
**Are you reporting a security vulnerability?** [Submit it here instead](https://github.com/grafana/grafana/security/policy). |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
# |
||||
- type: textarea |
||||
id: bug-describe |
||||
attributes: |
||||
label: | |
||||
|
||||
# What went wrong? |
||||
|
||||
description: | |
||||
# |
||||
Describe your bug. What happened? What did you expect to happen? |
||||
|
||||
**Hot Tip:** Record your screen and add it here as a gif. |
||||
placeholder: Tell us what you see! |
||||
value: | |
||||
**What happened**: |
||||
|
||||
- |
||||
|
||||
**What did you expect to happen**: |
||||
|
||||
- |
||||
|
||||
validations: |
||||
required: true |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
# |
||||
- type: textarea |
||||
id: bug-repro |
||||
attributes: |
||||
label: | |
||||
|
||||
# How do we reproduce it? |
||||
|
||||
description: | |
||||
# |
||||
|
||||
Whenever possible, please provide **detailed** steps for reproducing your bug. |
||||
|
||||
**This is very helpful info** |
||||
placeholder: "Step 1:..." |
||||
value: | |
||||
**Step 1**: |
||||
|
||||
- Open Grafana and do X |
||||
|
||||
**Step 2**: |
||||
|
||||
- Now click button Y |
||||
|
||||
**Step 3**: |
||||
|
||||
- Wait for the browser to crash. Error message says: "Error..." |
||||
validations: |
||||
required: true |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
# |
||||
- type: input |
||||
id: gf-version |
||||
attributes: |
||||
label: | |
||||
|
||||
# What Grafana version are you using? |
||||
|
||||
description: | |
||||
# |
||||
- [How do I find my Grafana version info?](https://community.grafana.com/t/how-to-find-your-grafana-version-info-3-different-ways/86857) |
||||
placeholder: "ex: v9.5.0, or v9.5.0-cloud.5.a016665c (b2a5d45589)" |
||||
validations: |
||||
required: true |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
# |
||||
# |
||||
# Optional Questions: |
||||
# |
||||
- type: textarea |
||||
id: get-help |
||||
attributes: |
||||
label: | |
||||
|
||||
## Optional Questions: |
||||
|
||||
### Is the bug inside a Dashboard Panel? |
||||
|
||||
description: | |
||||
If the bug appears inside a [dashboard panel](https://grafana.com/docs/grafana/latest/panels-visualizations/#panels-and-visualizations), please use the ["Get-Help" feature](https://grafana.com/docs/grafana/latest/troubleshooting/send-panel-to-grafana-support/). Select **copy to clipboard** and paste the data below. |
||||
No need for backticks--this text will get formatted as a code-block. |
||||
|
||||
What's a [dashboard panel](https://grafana.com/docs/grafana/latest/panels-visualizations/#panels-and-visualizations)? |
||||
placeholder: Copy "get-help" data here |
||||
value: Copy the panel's ["get-help" data](https://grafana.com/docs/grafana/latest/troubleshooting/send-panel-to-grafana-support/) here |
||||
- type: dropdown |
||||
id: gf-deployment |
||||
attributes: |
||||
label: Grafana Platform? |
||||
description: | |
||||
**How** are you running/deploying Grafana? |
||||
options: |
||||
- I use Grafana Cloud |
||||
- Docker |
||||
- Kubernetes |
||||
- A package manager (APT, YUM, BREW, etc.) |
||||
- A downloaded binary |
||||
- Other |
||||
- I don't know |
||||
validations: |
||||
required: false |
||||
- type: input |
||||
id: user-os |
||||
attributes: |
||||
label: User's OS? |
||||
description: What operating system are you running locally? |
||||
placeholder: "ex. MacOS Big Sur 11.7, or Ubuntu 20.04..." |
||||
- type: input |
||||
id: user-browser |
||||
attributes: |
||||
label: User's Browser? |
||||
description: Is the bug occuring in Grafana's user-interface? If so, what browsers are you seeing the problem on? You may choose more than one. |
||||
placeholder: "ex. Google Chrome Version 112.0.5615.137 (Official Build) (arm64)..." |
||||
- type: dropdown |
||||
id: regression |
||||
attributes: |
||||
label: Is this a Regression? |
||||
description: | |
||||
A regression means that the feature was working, then you upgraded, and now it's broken. |
||||
options: |
||||
- 'No' |
||||
- 'Yes' |
||||
validations: |
||||
required: false |
||||
- type: input |
||||
id: gf-datasource |
||||
attributes: |
||||
label: Are Datasources involved? |
||||
description: | |
||||
Is this issue specific to a datasource plugin / plugins? Please list all that apply: |
||||
placeholder: "ex. Elasticsearch 5.0.0 or Infinity 1.4.1 ..." |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
# |
||||
# |
||||
## Anything else to add? |
||||
# |
||||
- type: textarea |
||||
id: extra |
||||
attributes: |
||||
label: | |
||||
Anything else to add? |
||||
description: Add any extra information here |
@ -1,31 +0,0 @@ |
||||
--- |
||||
name: Bug report |
||||
about: Report a bug you found when using Grafana |
||||
labels: 'type: bug' |
||||
--- |
||||
|
||||
<!-- |
||||
Please use this template to create your bug report. By providing as much info as possible you help us understand the issue, reproduce it and resolve it for you quicker. Therefore take a couple of extra minutes to make sure you have provided all info needed. |
||||
|
||||
PROTIP: record your screen and attach it as a gif to showcase the issue. |
||||
|
||||
- Questions should be posted to: https://community.grafana.com |
||||
- Use query inspector to troubleshoot issues: https://bit.ly/2XNF6YS |
||||
- How to record and attach gif: https://bit.ly/2Mi8T6K |
||||
--> |
||||
|
||||
**What happened**: |
||||
|
||||
**What you expected to happen**: |
||||
|
||||
**How to reproduce it (as minimally and precisely as possible)**: |
||||
|
||||
**Anything else we need to know?**: |
||||
|
||||
**Environment**: |
||||
- Grafana version: |
||||
- Data source type & version: |
||||
- OS Grafana is installed on: |
||||
- User OS & Browser: |
||||
- Grafana plugins: |
||||
- Others: |
@ -0,0 +1,5 @@ |
||||
--- |
||||
name: Staff Issues |
||||
about: Blank issue for Grafana staff members |
||||
labels: 'internal' |
||||
--- |
@ -0,0 +1,65 @@ |
||||
--- |
||||
name: Saga contribution template |
||||
description: Contribute to the design system. |
||||
title: "Saga: " |
||||
labels: |
||||
- area/grafana/ui, design-system |
||||
body: |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
By using this template, you help expand our component and pattern solutions within the design system and let others reuse your work! You can contribute bug or design defect fixes, component, and pattern enhancements, or even net-new components! This template brings visibility to the great work everyone already does and in turn helps reduce duplicate efforts. |
||||
Thank you! |
||||
- type: checkboxes |
||||
attributes: |
||||
label: What type of contribution is this? |
||||
description: null |
||||
options: |
||||
- label: Fix - bug, design defect, typo, documentation conciseness |
||||
- label: Unification - combining similar components/patterns into a single |
||||
solution |
||||
- label: Proposal - net-new component, additions, variants |
||||
validations: |
||||
required: true |
||||
- type: textarea |
||||
id: background |
||||
attributes: |
||||
label: Why is this needed? |
||||
description: Explain the use case and where it can be used. |
||||
placeholder: null |
||||
validations: |
||||
required: true |
||||
- type: textarea |
||||
id: use_case |
||||
attributes: |
||||
label: Where is this or where can it be used? |
||||
description: Explain the current/future use case, be sure to include areas of impact |
||||
placeholder: null |
||||
validations: |
||||
required: true |
||||
- type: textarea |
||||
attributes: |
||||
label: Deliverables |
||||
description: Add a checklist of deliverables here. You can later add links to |
||||
each deliverable. |
||||
value: | |
||||
- Figma mockup |
||||
- Storybook story |
||||
- … |
||||
- type: checkboxes |
||||
attributes: |
||||
label: Contribution guiding principles |
||||
description: Use this checklist of guiding principles to ensure your |
||||
contribution makes Grafana a better product |
||||
options: |
||||
- label: Universal - not specific to a single product feature; able to be used |
||||
product-wide |
||||
- label: Accessible - inclusive to all types of users and assistive tools |
||||
- label: Flexible - thoughtfully built and designed to solve various |
||||
configurations and situations |
||||
- label: Coherent - follows existing visual styling and patterns |
||||
- label: Defined - documented clearly and concisely for ease of understanding |
||||
- label: Distinct - solves a unique gap or problem that cannot be solved with |
||||
current solutions |
||||
validations: |
||||
required: false |
@ -1,3 +1,5 @@ |
||||
module.exports = { |
||||
...require('@grafana/toolkit/src/config/prettier.plugin.config.json'), |
||||
trailingComma: 'es5', |
||||
singleQuote: true, |
||||
printWidth: 120, |
||||
}; |
||||
|
@ -0,0 +1,14 @@ |
||||
diff --git a/dist/ts3.9/blocks/DocsContainer.d.ts b/dist/ts3.9/blocks/DocsContainer.d.ts
|
||||
index be330e44bebb02eaf2c92d365d4e7dc1da452465..6c8b1d42bea2e184456e2757eb2ee20076ba43b3 100644
|
||||
--- a/dist/ts3.9/blocks/DocsContainer.d.ts
|
||||
+++ b/dist/ts3.9/blocks/DocsContainer.d.ts
|
||||
@@ -1,7 +1,8 @@
|
||||
-import { FunctionComponent } from 'react';
|
||||
+import { FunctionComponent, ReactNode } from 'react';
|
||||
import { AnyFramework } from '@storybook/csf';
|
||||
import { DocsContextProps } from './DocsContext';
|
||||
export interface DocsContainerProps<TFramework extends AnyFramework = AnyFramework> {
|
||||
context: DocsContextProps<TFramework>;
|
||||
+ children?: ReactNode;
|
||||
}
|
||||
export declare const DocsContainer: FunctionComponent<DocsContainerProps>;
|
@ -0,0 +1,12 @@ |
||||
diff --git a/index.d.ts b/index.d.ts
|
||||
index d116f54d6da12d24b48e24ff3636c9066059aa58..93290945d8b1818cab893d6466179b33869a47b9 100644
|
||||
--- a/index.d.ts
|
||||
+++ b/index.d.ts
|
||||
@@ -25,6 +25,7 @@ export type SplitPaneProps = {
|
||||
pane2Style?: React.CSSProperties;
|
||||
resizerClassName?: string;
|
||||
step?: number;
|
||||
+ children?: React.ReactNode;
|
||||
};
|
||||
|
||||
export type SplitPaneState = {
|
@ -0,0 +1,433 @@ |
||||
{ |
||||
"annotations": { |
||||
"list": [ |
||||
{ |
||||
"builtIn": 1, |
||||
"datasource": { |
||||
"type": "grafana", |
||||
"uid": "-- Grafana --" |
||||
}, |
||||
"enable": true, |
||||
"hide": true, |
||||
"iconColor": "rgba(0, 211, 255, 1)", |
||||
"name": "Annotations & Alerts", |
||||
"type": "dashboard" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "grafana", |
||||
"uid": "-- Grafana --" |
||||
}, |
||||
"enable": true, |
||||
"hide": true, |
||||
"iconColor": "rgba(0, 211, 255, 1)", |
||||
"name": "Annotations & Alerts", |
||||
"target": { |
||||
"limit": 100, |
||||
"matchAny": false, |
||||
"tags": [], |
||||
"type": "dashboard" |
||||
}, |
||||
"type": "dashboard" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"enable": true, |
||||
"filter": { |
||||
"exclude": false, |
||||
"ids": [ |
||||
1 |
||||
] |
||||
}, |
||||
"iconColor": "red", |
||||
"name": "Red, only panel 1", |
||||
"target": { |
||||
"lines": 4, |
||||
"refId": "Anno", |
||||
"scenarioId": "annotations" |
||||
} |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"enable": true, |
||||
"filter": { |
||||
"exclude": true, |
||||
"ids": [ |
||||
1 |
||||
] |
||||
}, |
||||
"iconColor": "yellow", |
||||
"name": "Yellow - all except 1", |
||||
"target": { |
||||
"lines": 5, |
||||
"refId": "Anno", |
||||
"scenarioId": "annotations" |
||||
} |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"enable": true, |
||||
"filter": { |
||||
"exclude": false, |
||||
"ids": [ |
||||
3, |
||||
4 |
||||
] |
||||
}, |
||||
"iconColor": "dark-purple", |
||||
"name": "Purple only panel 3+4", |
||||
"target": { |
||||
"lines": 6, |
||||
"refId": "Anno", |
||||
"scenarioId": "annotations" |
||||
} |
||||
} |
||||
] |
||||
}, |
||||
"editable": true, |
||||
"fiscalYearStartMonth": 0, |
||||
"graphTooltip": 0, |
||||
"id": 119, |
||||
"links": [], |
||||
"liveNow": false, |
||||
"panels": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "palette-classic" |
||||
}, |
||||
"custom": { |
||||
"axisCenteredZero": false, |
||||
"axisColorMode": "text", |
||||
"axisLabel": "", |
||||
"axisPlacement": "auto", |
||||
"barAlignment": 0, |
||||
"drawStyle": "line", |
||||
"fillOpacity": 0, |
||||
"gradientMode": "none", |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"lineInterpolation": "linear", |
||||
"lineWidth": 1, |
||||
"pointSize": 5, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
}, |
||||
"showPoints": "auto", |
||||
"spanNulls": false, |
||||
"stacking": { |
||||
"group": "A", |
||||
"mode": "none" |
||||
}, |
||||
"thresholdsStyle": { |
||||
"mode": "off" |
||||
} |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green" |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 12, |
||||
"x": 0, |
||||
"y": 0 |
||||
}, |
||||
"id": 1, |
||||
"options": { |
||||
"legend": { |
||||
"calcs": [], |
||||
"displayMode": "list", |
||||
"placement": "bottom", |
||||
"showLegend": true |
||||
}, |
||||
"tooltip": { |
||||
"mode": "single", |
||||
"sort": "none" |
||||
} |
||||
}, |
||||
"title": "Panel one", |
||||
"type": "timeseries" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "palette-classic" |
||||
}, |
||||
"custom": { |
||||
"axisCenteredZero": false, |
||||
"axisColorMode": "text", |
||||
"axisLabel": "", |
||||
"axisPlacement": "auto", |
||||
"barAlignment": 0, |
||||
"drawStyle": "line", |
||||
"fillOpacity": 0, |
||||
"gradientMode": "none", |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"lineInterpolation": "linear", |
||||
"lineWidth": 1, |
||||
"pointSize": 5, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
}, |
||||
"showPoints": "auto", |
||||
"spanNulls": false, |
||||
"stacking": { |
||||
"group": "A", |
||||
"mode": "none" |
||||
}, |
||||
"thresholdsStyle": { |
||||
"mode": "off" |
||||
} |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green" |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 12, |
||||
"x": 12, |
||||
"y": 0 |
||||
}, |
||||
"id": 2, |
||||
"options": { |
||||
"legend": { |
||||
"calcs": [], |
||||
"displayMode": "list", |
||||
"placement": "bottom", |
||||
"showLegend": true |
||||
}, |
||||
"tooltip": { |
||||
"mode": "single", |
||||
"sort": "none" |
||||
} |
||||
}, |
||||
"title": "Panel two", |
||||
"type": "timeseries" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "palette-classic" |
||||
}, |
||||
"custom": { |
||||
"axisCenteredZero": false, |
||||
"axisColorMode": "text", |
||||
"axisLabel": "", |
||||
"axisPlacement": "auto", |
||||
"barAlignment": 0, |
||||
"drawStyle": "line", |
||||
"fillOpacity": 0, |
||||
"gradientMode": "none", |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"lineInterpolation": "linear", |
||||
"lineWidth": 1, |
||||
"pointSize": 5, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
}, |
||||
"showPoints": "auto", |
||||
"spanNulls": false, |
||||
"stacking": { |
||||
"group": "A", |
||||
"mode": "none" |
||||
}, |
||||
"thresholdsStyle": { |
||||
"mode": "off" |
||||
} |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green" |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 12, |
||||
"x": 0, |
||||
"y": 8 |
||||
}, |
||||
"id": 3, |
||||
"options": { |
||||
"legend": { |
||||
"calcs": [], |
||||
"displayMode": "list", |
||||
"placement": "bottom", |
||||
"showLegend": true |
||||
}, |
||||
"tooltip": { |
||||
"mode": "single", |
||||
"sort": "none" |
||||
} |
||||
}, |
||||
"title": "Panel three", |
||||
"type": "timeseries" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "palette-classic" |
||||
}, |
||||
"custom": { |
||||
"axisCenteredZero": false, |
||||
"axisColorMode": "text", |
||||
"axisLabel": "", |
||||
"axisPlacement": "auto", |
||||
"barAlignment": 0, |
||||
"drawStyle": "line", |
||||
"fillOpacity": 0, |
||||
"gradientMode": "none", |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"lineInterpolation": "linear", |
||||
"lineWidth": 1, |
||||
"pointSize": 5, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
}, |
||||
"showPoints": "auto", |
||||
"spanNulls": false, |
||||
"stacking": { |
||||
"group": "A", |
||||
"mode": "none" |
||||
}, |
||||
"thresholdsStyle": { |
||||
"mode": "off" |
||||
} |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green" |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 12, |
||||
"x": 12, |
||||
"y": 8 |
||||
}, |
||||
"id": 4, |
||||
"options": { |
||||
"legend": { |
||||
"calcs": [], |
||||
"displayMode": "list", |
||||
"placement": "bottom", |
||||
"showLegend": true |
||||
}, |
||||
"tooltip": { |
||||
"mode": "single", |
||||
"sort": "none" |
||||
} |
||||
}, |
||||
"title": "Panel four", |
||||
"type": "timeseries" |
||||
} |
||||
], |
||||
"refresh": "", |
||||
"schemaVersion": 38, |
||||
"style": "dark", |
||||
"tags": ["gdev", "annotations"], |
||||
"templating": { |
||||
"list": [] |
||||
}, |
||||
"time": { |
||||
"from": "now-30m", |
||||
"to": "now" |
||||
}, |
||||
"timepicker": {}, |
||||
"timezone": "", |
||||
"title": "Annotation filtering", |
||||
"uid": "ed155665", |
||||
"version": 17, |
||||
"weekStart": "" |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,80 @@ |
||||
{ |
||||
"annotations": { |
||||
"list": [ |
||||
{ |
||||
"builtIn": 1, |
||||
"datasource": { |
||||
"type": "grafana", |
||||
"uid": "-- Grafana --" |
||||
}, |
||||
"enable": true, |
||||
"hide": true, |
||||
"iconColor": "rgba(0, 211, 255, 1)", |
||||
"name": "Annotations & Alerts", |
||||
"type": "dashboard" |
||||
} |
||||
] |
||||
}, |
||||
"editable": true, |
||||
"fiscalYearStartMonth": 0, |
||||
"graphTooltip": 0, |
||||
"links": [], |
||||
"liveNow": false, |
||||
"panels": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 12, |
||||
"x": 0, |
||||
"y": 0 |
||||
}, |
||||
"id": 1, |
||||
"options": { |
||||
"selectedSeries": 0 |
||||
}, |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"refId": "A", |
||||
"scenarioId": "csv_metric_values", |
||||
"stringInput": "1,20,90,30,5,0" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"refId": "B", |
||||
"scenarioId": "csv_metric_values", |
||||
"stringInput": "5,10,20,30,40,50" |
||||
} |
||||
], |
||||
"title": "Datagrid with CSV metric values", |
||||
"type": "datagrid" |
||||
} |
||||
], |
||||
"refresh": "", |
||||
"schemaVersion": 38, |
||||
"style": "dark", |
||||
"tags": [], |
||||
"templating": { |
||||
"list": [] |
||||
}, |
||||
"time": { |
||||
"from": "now-6h", |
||||
"to": "now" |
||||
}, |
||||
"timepicker": {}, |
||||
"timezone": "", |
||||
"title": "Datagrid example", |
||||
"version": 0, |
||||
"uid": "c01bf42b-b783-4447-a304-8554cee1843b", |
||||
"weekStart": "" |
||||
} |
@ -0,0 +1,938 @@ |
||||
{ |
||||
"annotations": { |
||||
"list": [ |
||||
{ |
||||
"builtIn": 1, |
||||
"datasource": { |
||||
"type": "grafana", |
||||
"uid": "-- Grafana --" |
||||
}, |
||||
"enable": true, |
||||
"hide": true, |
||||
"iconColor": "rgba(0, 211, 255, 1)", |
||||
"name": "Annotations & Alerts", |
||||
"type": "dashboard" |
||||
} |
||||
] |
||||
}, |
||||
"editable": true, |
||||
"fiscalYearStartMonth": 0, |
||||
"graphTooltip": 0, |
||||
"links": [], |
||||
"liveNow": false, |
||||
"panels": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "grafana", |
||||
"uid": "grafana" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "thresholds" |
||||
}, |
||||
"custom": { |
||||
"align": "auto", |
||||
"cellOptions": { |
||||
"type": "auto" |
||||
}, |
||||
"inspect": false |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green" |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [ |
||||
{ |
||||
"matcher": { |
||||
"id": "byName", |
||||
"options": "dim1" |
||||
}, |
||||
"properties": [ |
||||
{ |
||||
"id": "custom.width", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
] |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 8, |
||||
"x": 0, |
||||
"y": 0 |
||||
}, |
||||
"id": 8, |
||||
"options": { |
||||
"cellHeight": "sm", |
||||
"footer": { |
||||
"countRows": false, |
||||
"fields": "", |
||||
"reducer": [ |
||||
"sum" |
||||
], |
||||
"show": false |
||||
}, |
||||
"frameIndex": 0, |
||||
"showHeader": true, |
||||
"showRowNums": false, |
||||
"sortBy": [] |
||||
}, |
||||
"pluginVersion": "10.0.0-pre", |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "grafana", |
||||
"uid": "grafana" |
||||
}, |
||||
"queryType": "snapshot", |
||||
"refId": "A", |
||||
"snapshot": [ |
||||
{ |
||||
"data": { |
||||
"values": [ |
||||
[ |
||||
1677256641358, |
||||
1677257007358, |
||||
1677257373358, |
||||
1677257739358, |
||||
1677258105358, |
||||
1677258471358, |
||||
1677258837358, |
||||
1677259203358, |
||||
1677259569358, |
||||
1677259935358, |
||||
1677260301358, |
||||
1677260667358, |
||||
1677261033358, |
||||
1677261399358, |
||||
1677261765358, |
||||
1677262131358, |
||||
1677262497358, |
||||
1677262863358, |
||||
1677263229358, |
||||
1677263595358, |
||||
1677263961358, |
||||
1677264327358, |
||||
1677264693358, |
||||
1677265059358, |
||||
1677265425358, |
||||
1677265791358, |
||||
1677266157358, |
||||
1677266523358, |
||||
1677266889358, |
||||
1677267255358, |
||||
1677267621358, |
||||
1677267987358, |
||||
1677268353358, |
||||
1677268719358, |
||||
1677269085358, |
||||
1677269451358, |
||||
1677269817358, |
||||
1677270183358, |
||||
1677270549358, |
||||
1677270915358, |
||||
1677271281358, |
||||
1677271647358, |
||||
1677272013358, |
||||
1677272379358, |
||||
1677272745358, |
||||
1677273111358, |
||||
1677273477358, |
||||
1677273843358, |
||||
1677274209358, |
||||
1677274575358, |
||||
1677274941358, |
||||
1677275307358, |
||||
1677275673358, |
||||
1677276039358, |
||||
1677276405358, |
||||
1677276771358, |
||||
1677277137358, |
||||
1677277503358, |
||||
1677277869358, |
||||
1677278235358 |
||||
], |
||||
[ |
||||
1, |
||||
3, |
||||
5, |
||||
7, |
||||
4, |
||||
6, |
||||
8, |
||||
10, |
||||
1, |
||||
3, |
||||
5, |
||||
7, |
||||
4, |
||||
6, |
||||
8, |
||||
10, |
||||
1, |
||||
3, |
||||
5, |
||||
7, |
||||
4, |
||||
6, |
||||
8, |
||||
10, |
||||
1, |
||||
3, |
||||
5, |
||||
7, |
||||
4, |
||||
6, |
||||
8, |
||||
10, |
||||
1, |
||||
3, |
||||
5, |
||||
7, |
||||
4, |
||||
6, |
||||
8, |
||||
10, |
||||
1, |
||||
3, |
||||
5, |
||||
7, |
||||
4, |
||||
6, |
||||
8, |
||||
10, |
||||
1, |
||||
3, |
||||
5, |
||||
7, |
||||
4, |
||||
6, |
||||
8, |
||||
10, |
||||
1, |
||||
3, |
||||
5, |
||||
7 |
||||
], |
||||
[ |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d", |
||||
"a", |
||||
"b", |
||||
"c", |
||||
"d" |
||||
], |
||||
[ |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y", |
||||
"x", |
||||
"y" |
||||
] |
||||
] |
||||
}, |
||||
"schema": { |
||||
"fields": [ |
||||
{ |
||||
"config": {}, |
||||
"labels": {}, |
||||
"name": "timestamp", |
||||
"type": "time", |
||||
"typeInfo": { |
||||
"frame": "time.Time" |
||||
} |
||||
}, |
||||
{ |
||||
"config": {}, |
||||
"labels": {}, |
||||
"name": "numericData", |
||||
"type": "number", |
||||
"typeInfo": { |
||||
"frame": "float64", |
||||
"nullable": true |
||||
} |
||||
}, |
||||
{ |
||||
"config": {}, |
||||
"labels": {}, |
||||
"name": "dim1", |
||||
"type": "string", |
||||
"typeInfo": { |
||||
"frame": "string" |
||||
} |
||||
}, |
||||
{ |
||||
"config": {}, |
||||
"labels": {}, |
||||
"name": "dim2", |
||||
"type": "string", |
||||
"typeInfo": { |
||||
"frame": "string" |
||||
} |
||||
} |
||||
], |
||||
"meta": { |
||||
"type": "timeseries-long", |
||||
"typeVersion": [ |
||||
0, |
||||
0 |
||||
] |
||||
}, |
||||
"name": "New Frame", |
||||
"refId": "A" |
||||
} |
||||
}, |
||||
{ |
||||
"data": { |
||||
"values": [ |
||||
[ |
||||
1677256641358, |
||||
1677257007358, |
||||
1677257373358, |
||||
1677257739358, |
||||
1677258105358, |
||||
1677258471358, |
||||
1677258837358, |
||||
1677259203358, |
||||
1677259569358, |
||||
1677259935358, |
||||
1677260301358, |
||||
1677260667358, |
||||
1677261033358, |
||||
1677261399358, |
||||
1677261765358, |
||||
1677262131358, |
||||
1677262497358, |
||||
1677262863358, |
||||
1677263229358, |
||||
1677263595358, |
||||
1677263961358, |
||||
1677264327358, |
||||
1677264693358, |
||||
1677265059358, |
||||
1677265425358, |
||||
1677265791358, |
||||
1677266157358, |
||||
1677266523358, |
||||
1677266889358, |
||||
1677267255358, |
||||
1677267621358, |
||||
1677267987358, |
||||
1677268353358, |
||||
1677268719358, |
||||
1677269085358, |
||||
1677269451358, |
||||
1677269817358, |
||||
1677270183358, |
||||
1677270549358, |
||||
1677270915358, |
||||
1677271281358, |
||||
1677271647358, |
||||
1677272013358, |
||||
1677272379358, |
||||
1677272745358, |
||||
1677273111358, |
||||
1677273477358, |
||||
1677273843358, |
||||
1677274209358, |
||||
1677274575358, |
||||
1677274941358, |
||||
1677275307358, |
||||
1677275673358, |
||||
1677276039358, |
||||
1677276405358, |
||||
1677276771358, |
||||
1677277137358, |
||||
1677277503358, |
||||
1677277869358, |
||||
1677278235358 |
||||
], |
||||
[ |
||||
1, |
||||
2, |
||||
3, |
||||
2, |
||||
3, |
||||
5, |
||||
6, |
||||
3, |
||||
1, |
||||
2, |
||||
3, |
||||
2, |
||||
3, |
||||
5, |
||||
6, |
||||
3, |
||||
1, |
||||
2, |
||||
3, |
||||
2, |
||||
3, |
||||
5, |
||||
6, |
||||
3, |
||||
1, |
||||
2, |
||||
3, |
||||
2, |
||||
3, |
||||
5, |
||||
6, |
||||
3, |
||||
1, |
||||
2, |
||||
3, |
||||
2, |
||||
3, |
||||
5, |
||||
6, |
||||
3, |
||||
1, |
||||
2, |
||||
3, |
||||
2, |
||||
3, |
||||
5, |
||||
6, |
||||
3, |
||||
1, |
||||
2, |
||||
3, |
||||
2, |
||||
3, |
||||
5, |
||||
6, |
||||
3, |
||||
1, |
||||
2, |
||||
3, |
||||
2 |
||||
], |
||||
[ |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h" |
||||
], |
||||
[ |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r", |
||||
"q", |
||||
"r" |
||||
] |
||||
] |
||||
}, |
||||
"schema": { |
||||
"fields": [ |
||||
{ |
||||
"config": {}, |
||||
"labels": {}, |
||||
"name": "timestamp", |
||||
"type": "time", |
||||
"typeInfo": { |
||||
"frame": "time.Time" |
||||
} |
||||
}, |
||||
{ |
||||
"config": {}, |
||||
"labels": {}, |
||||
"name": "value", |
||||
"type": "number", |
||||
"typeInfo": { |
||||
"frame": "float64", |
||||
"nullable": true |
||||
} |
||||
}, |
||||
{ |
||||
"config": {}, |
||||
"labels": {}, |
||||
"name": "dim3", |
||||
"type": "string", |
||||
"typeInfo": { |
||||
"frame": "string" |
||||
} |
||||
}, |
||||
{ |
||||
"config": {}, |
||||
"labels": {}, |
||||
"name": "dim4", |
||||
"type": "string", |
||||
"typeInfo": { |
||||
"frame": "string" |
||||
} |
||||
} |
||||
], |
||||
"meta": { |
||||
"type": "timeseries-long", |
||||
"typeVersion": [ |
||||
0, |
||||
0 |
||||
] |
||||
}, |
||||
"name": "New Frame", |
||||
"refId": "B" |
||||
} |
||||
} |
||||
] |
||||
} |
||||
], |
||||
"title": "timeseries-long", |
||||
"transformations": [], |
||||
"type": "table" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "palette-classic" |
||||
}, |
||||
"custom": { |
||||
"axisCenteredZero": false, |
||||
"axisColorMode": "text", |
||||
"axisLabel": "", |
||||
"axisPlacement": "auto", |
||||
"barAlignment": 0, |
||||
"drawStyle": "line", |
||||
"fillOpacity": 0, |
||||
"gradientMode": "none", |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"lineInterpolation": "linear", |
||||
"lineWidth": 1, |
||||
"pointSize": 5, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
}, |
||||
"showPoints": "auto", |
||||
"spanNulls": false, |
||||
"stacking": { |
||||
"group": "A", |
||||
"mode": "none" |
||||
}, |
||||
"thresholdsStyle": { |
||||
"mode": "off" |
||||
} |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green" |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 11, |
||||
"x": 8, |
||||
"y": 0 |
||||
}, |
||||
"id": 10, |
||||
"options": { |
||||
"legend": { |
||||
"calcs": [], |
||||
"displayMode": "list", |
||||
"placement": "bottom", |
||||
"showLegend": true |
||||
}, |
||||
"tooltip": { |
||||
"mode": "single", |
||||
"sort": "none" |
||||
} |
||||
}, |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"panelId": 8, |
||||
"refId": "A" |
||||
} |
||||
], |
||||
"title": "Timeseries panel requires a transform to render timeseries-long", |
||||
"type": "timeseries" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 5, |
||||
"x": 19, |
||||
"y": 0 |
||||
}, |
||||
"id": 4, |
||||
"options": { |
||||
"code": { |
||||
"language": "plaintext", |
||||
"showLineNumbers": false, |
||||
"showMiniMap": false |
||||
}, |
||||
"content": "The timeseries panel can not show timeseries-long directly, it must first be converted to `timeseries-wide` or `timeseries-multi` first.\n\nThe UI should show a button indicating this.", |
||||
"mode": "markdown" |
||||
}, |
||||
"pluginVersion": "10.0.0-pre", |
||||
"title": "Timeseries-long info", |
||||
"type": "text" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "palette-classic" |
||||
}, |
||||
"custom": { |
||||
"axisCenteredZero": false, |
||||
"axisColorMode": "text", |
||||
"axisLabel": "", |
||||
"axisPlacement": "auto", |
||||
"barAlignment": 0, |
||||
"drawStyle": "line", |
||||
"fillOpacity": 0, |
||||
"gradientMode": "none", |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"lineInterpolation": "linear", |
||||
"lineWidth": 1, |
||||
"pointSize": 5, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
}, |
||||
"showPoints": "auto", |
||||
"spanNulls": false, |
||||
"stacking": { |
||||
"group": "A", |
||||
"mode": "none" |
||||
}, |
||||
"thresholdsStyle": { |
||||
"mode": "off" |
||||
} |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green" |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 8, |
||||
"x": 0, |
||||
"y": 8 |
||||
}, |
||||
"id": 11, |
||||
"options": { |
||||
"legend": { |
||||
"calcs": [], |
||||
"displayMode": "list", |
||||
"placement": "bottom", |
||||
"showLegend": true |
||||
}, |
||||
"tooltip": { |
||||
"mode": "single", |
||||
"sort": "none" |
||||
} |
||||
}, |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"refId": "A", |
||||
"scenarioId": "random_walk", |
||||
"seriesCount": 0 |
||||
} |
||||
], |
||||
"title": "Expected no-data message (empty series", |
||||
"type": "timeseries" |
||||
} |
||||
], |
||||
"refresh": "", |
||||
"revision": 1, |
||||
"schemaVersion": 38, |
||||
"style": "dark", |
||||
"tags": [], |
||||
"templating": { |
||||
"list": [] |
||||
}, |
||||
"time": { |
||||
"from": "2023-02-24T16:37:21.358Z", |
||||
"to": "2023-02-24T22:37:15.358Z" |
||||
}, |
||||
"timepicker": {}, |
||||
"timezone": "", |
||||
"title": "Panel Tests - Timeseries - Supported input formats", |
||||
"uid": "f4ca24309dd4", |
||||
"version": 1, |
||||
"weekStart": "" |
||||
} |
@ -0,0 +1,25 @@ |
||||
# Prometheus behind an OAuth2-proxy |
||||
|
||||
## How to setup OAuth2-proxy |
||||
|
||||
1. Make a copy of `oauth2-proxy.example.cfg` and rename it to `oauth2-proxy.cfg` |
||||
1. Fill in the required information (`azure client id`, `azure client secret`, `azure tenant id`) |
||||
1. Start the containers by executing `make devenv sources="prometheus,auth/prometheus_oauth2_proxy_azure"` |
||||
> If you would like to test the login flow from the browser then you need to setup TLS or start a tunnel. I usually use a tunnel (`cloudflared tunnel --url http://localhost:4180`). Do not forget to set the Redirect URIs on Azure's App Registration page |
||||
|
||||
## How to add a new Prometheus datasource with Azure Authentication enabled |
||||
|
||||
1. Navigate to Grafana and login |
||||
1. Add a new Prometheus datasource |
||||
1. On the new Prometheus datasource page |
||||
1. Set the URL |
||||
1. Enable Azure Authentication |
||||
1. Fill in the required fields of the `Azure Authentication` section |
||||
1. Click `Save & test` |
||||
1. You should get a "Data source is working" message |
||||
|
||||
If you check the logs of OAuth2-proxy, you should see similar lines to this: |
||||
``` |
||||
2023-04-19 11:29:40 172.31.0.1:55602 - d96b832a-170a-41eb-a974-6558c5ce4454 - - [2023/04/19 09:29:40] some-random-tunnel-address.trycloudflare.com GET / "/api/v1/status/buildinfo" HTTP/1.1 "Grafana/10.0.0-pre" 200 187 0.016 |
||||
2023-04-19 11:29:41 172.31.0.1:55602 - db27c56a-ccd6-4cdb-a040-318113781abf - 65ac87f4-931f-4e46-9761-f8bf1ad36b48 [2023/04/19 09:29:41] some-random-tunnel-address.trycloudflare.com POST / "/api/v1/query" HTTP/1.1 "Grafana/10.0.0-pre" 200 103 0.003 |
||||
``` |
@ -0,0 +1,27 @@ |
||||
oauth2proxy: |
||||
container_name: oauth2-proxy |
||||
image: quay.io/oauth2-proxy/oauth2-proxy:v7.4.0 |
||||
command: --config /oauth2-proxy.cfg |
||||
# command: [ |
||||
# "--provider=azure", |
||||
# "--cookie-secret=SECRETSECRET1234", |
||||
# "--client-id=<azure client id>", |
||||
# "--client-secret=<azure client secret>", |
||||
# "--azure-tenant=<azure tenant id>", |
||||
# "--oidc-issuer-url=https://login.microsoftonline.com/<azure tenant id>/v2.0", |
||||
# "--email-domain=*", |
||||
# "--http-address=0.0.0.0:4180", |
||||
# "--ssl-upstream-insecure-skip-verify=true", |
||||
# "--upstream=http://local-prometheus:9090/", |
||||
# "--skip-jwt-bearer-tokens=true", |
||||
# "--extra-jwt-issuers=https://sts.windows.net/<azure tenant id>/=https://prometheus.monitor.azure.com", |
||||
# "--skip-auth-route=/api/v1/status/buildinfo", |
||||
# ] |
||||
ports: |
||||
- 4180:4180 |
||||
hostname: oauth2-proxy |
||||
volumes: |
||||
- "./docker/blocks/auth/prometheus_oauth2_proxy_azure/oauth2-proxy.cfg:/oauth2-proxy.cfg" |
||||
extra_hosts: |
||||
- "local-prometheus:host-gateway" |
||||
restart: unless-stopped |
@ -0,0 +1,13 @@ |
||||
provider="azure" |
||||
cookie_secret="SECRETSECRET1234" |
||||
client_id="<azure client id>" |
||||
client_secret="<azure client secret>" |
||||
azure_tenant="<azure tenant id>" |
||||
oidc_issuer_url="https://login.microsoftonline.com/<azure tenant id>/v2.0" |
||||
email_domains=["*"] |
||||
http_address="0.0.0.0:4180" |
||||
ssl_upstream_insecure_skip_verify="true" |
||||
upstreams=[ "http://local-prometheus:9090/" ] |
||||
skip_jwt_bearer_tokens="true" |
||||
extra_jwt_issuers="https://sts.windows.net/<azure tenant id>/=https://prometheus.monitor.azure.com" |
||||
skip_auth_routes=[ "/api/v1/status/buildinfo" ] |
@ -1 +1 @@ |
||||
mysql_version=5.7.39 |
||||
mysql_version=8.0.32 |
||||
|
@ -1 +1 @@ |
||||
mysql_version=5.7.39 |
||||
mysql_version=8.0.32 |
||||
|
@ -0,0 +1,6 @@ |
||||
pyroscope: |
||||
image: "pyroscope/pyroscope:latest" |
||||
command: |
||||
- "server" |
||||
ports: |
||||
- "4040:4040" |
@ -0,0 +1,202 @@ |
||||
# |
||||
# This is the default configuration file. It allows all users to do anything, |
||||
# please read carefully the documentation and best practices to |
||||
# improve security. |
||||
# |
||||
# Do not configure host and port under `listen` in this file |
||||
# as it will be ignored when using docker. |
||||
# see https://verdaccio.org/docs/en/docker#docker-and-custom-port-configuration |
||||
# |
||||
# Look here for more config file examples: |
||||
# https://github.com/verdaccio/verdaccio/tree/5.x/conf |
||||
# |
||||
# Read about the best practices |
||||
# https://verdaccio.org/docs/best |
||||
|
||||
# path to a directory with all packages |
||||
storage: /verdaccio/storage/data |
||||
# path to a directory with plugins to include |
||||
plugins: /verdaccio/plugins |
||||
|
||||
# https://verdaccio.org/docs/webui |
||||
web: |
||||
title: Verdaccio |
||||
# comment out to disable gravatar support |
||||
# gravatar: false |
||||
# by default packages are ordercer ascendant (asc|desc) |
||||
# sort_packages: asc |
||||
# convert your UI to the dark side |
||||
# darkMode: true |
||||
# html_cache: true |
||||
# by default all features are displayed |
||||
# login: true |
||||
# showInfo: true |
||||
# showSettings: true |
||||
# In combination with darkMode you can force specific theme |
||||
# showThemeSwitch: true |
||||
# showFooter: true |
||||
# showSearch: true |
||||
# showRaw: true |
||||
# showDownloadTarball: true |
||||
# HTML tags injected after manifest <scripts/> |
||||
# scriptsBodyAfter: |
||||
# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>' |
||||
# HTML tags injected before ends </head> |
||||
# metaScripts: |
||||
# - '<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>' |
||||
# - '<script type="text/javascript" src="https://browser.sentry-cdn.com/5.15.5/bundle.min.js"></script>' |
||||
# - '<meta name="robots" content="noindex" />' |
||||
# HTML tags injected first child at <body/> |
||||
# bodyBefore: |
||||
# - '<div id="myId">html before webpack scripts</div>' |
||||
# Public path for template manifest scripts (only manifest) |
||||
# publicPath: http://somedomain.org/ |
||||
|
||||
# https://verdaccio.org/docs/configuration#authentication |
||||
auth: |
||||
htpasswd: |
||||
file: /verdaccio/storage/htpasswd |
||||
# Maximum amount of users allowed to register, defaults to "+infinity". |
||||
# You can set this to -1 to disable registration. |
||||
# max_users: 1000 |
||||
# Hash algorithm, possible options are: "bcrypt", "md5", "sha1", "crypt". |
||||
# algorithm: bcrypt # by default is crypt, but is recommended use bcrypt for new installations |
||||
# Rounds number for "bcrypt", will be ignored for other algorithms. |
||||
# rounds: 10 |
||||
|
||||
# https://verdaccio.org/docs/configuration#uplinks |
||||
# a list of other known repositories we can talk to |
||||
uplinks: |
||||
npmjs: |
||||
url: https://registry.npmjs.org/ |
||||
|
||||
# Learn how to protect your packages |
||||
# https://verdaccio.org/docs/protect-your-dependencies/ |
||||
# https://verdaccio.org/docs/configuration#packages |
||||
packages: |
||||
'@*/*': |
||||
# allow all users (including non-authenticated users) to read and |
||||
# publish scoped packages |
||||
access: $anonymous |
||||
publish: $anonymous |
||||
unpublish: $anonymous |
||||
proxy: npmjs |
||||
|
||||
'**': |
||||
# allow all users (including non-authenticated users) to read and |
||||
# publish all packages |
||||
# |
||||
# you can specify usernames/groupnames (depending on your auth plugin) |
||||
# and three keywords: "$all", "$anonymous", "$authenticated" |
||||
access: $anonymous |
||||
|
||||
# allow all known users to publish/publish packages |
||||
# (anyone can register by default, remember?) |
||||
publish: $anonymous |
||||
unpublish: $anonymous |
||||
|
||||
# if package is not available locally, proxy requests to 'npmjs' registry |
||||
proxy: npmjs |
||||
|
||||
# To improve your security configuration and avoid dependency confusion |
||||
# consider removing the proxy property for private packages |
||||
# https://verdaccio.org/docs/best#remove-proxy-to-increase-security-at-private-packages |
||||
|
||||
# https://verdaccio.org/docs/configuration#server |
||||
# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections. |
||||
# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout. |
||||
# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough. |
||||
server: |
||||
keepAliveTimeout: 60 |
||||
# Allow `req.ip` to resolve properly when Verdaccio is behind a proxy or load-balancer |
||||
# See: https://expressjs.com/en/guide/behind-proxies.html |
||||
# trustProxy: '127.0.0.1' |
||||
|
||||
# https://verdaccio.org/docs/configuration#offline-publish |
||||
# publish: |
||||
# allow_offline: false |
||||
|
||||
# https://verdaccio.org/docs/configuration#url-prefix |
||||
# url_prefix: /verdaccio/ |
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org'; |
||||
# url_prefix: '/my_prefix' |
||||
# // url -> https://somedomain.org/my_prefix/ |
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org'; |
||||
# url_prefix: '/' |
||||
# // url -> https://somedomain.org/ |
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org/first_prefix'; |
||||
# url_prefix: '/second_prefix' |
||||
# // url -> https://somedomain.org/second_prefix/' |
||||
|
||||
# https://verdaccio.org/docs/configuration#security |
||||
# security: |
||||
# api: |
||||
# legacy: true |
||||
# jwt: |
||||
# sign: |
||||
# expiresIn: 29d |
||||
# verify: |
||||
# someProp: [value] |
||||
# web: |
||||
# sign: |
||||
# expiresIn: 1h # 1 hour by default |
||||
# verify: |
||||
# someProp: [value] |
||||
|
||||
# https://verdaccio.org/docs/configuration#user-rate-limit |
||||
# userRateLimit: |
||||
# windowMs: 50000 |
||||
# max: 1000 |
||||
|
||||
# https://verdaccio.org/docs/configuration#max-body-size |
||||
# max_body_size: 10mb |
||||
|
||||
# https://verdaccio.org/docs/configuration#listen-port |
||||
# listen: |
||||
# - localhost:4873 # default value |
||||
# - http://localhost:4873 # same thing |
||||
# - 0.0.0.0:4873 # listen on all addresses (INADDR_ANY) |
||||
# - https://example.org:4873 # if you want to use https |
||||
# - "[::1]:4873" # ipv6 |
||||
# - unix:/tmp/verdaccio.sock # unix socket |
||||
|
||||
# The HTTPS configuration is useful if you do not consider use a HTTP Proxy |
||||
# https://verdaccio.org/docs/configuration#https |
||||
# https: |
||||
# key: ./path/verdaccio-key.pem |
||||
# cert: ./path/verdaccio-cert.pem |
||||
# ca: ./path/verdaccio-csr.pem |
||||
|
||||
# https://verdaccio.org/docs/configuration#proxy |
||||
# http_proxy: http://something.local/ |
||||
# https_proxy: https://something.local/ |
||||
|
||||
# https://verdaccio.org/docs/configuration#notifications |
||||
# notify: |
||||
# method: POST |
||||
# headers: [{ "Content-Type": "application/json" }] |
||||
# endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken |
||||
# content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}' |
||||
|
||||
middlewares: |
||||
audit: |
||||
enabled: true |
||||
|
||||
# https://verdaccio.org/docs/logger |
||||
# log settings |
||||
logs: { type: stdout, format: pretty, level: http } |
||||
#experiments: |
||||
# # support for npm token command |
||||
# token: false |
||||
# # enable tarball URL redirect for hosting tarball with a different server, the tarball_url_redirect can be a template string |
||||
# tarball_url_redirect: 'https://mycdn.com/verdaccio/${packageName}/${filename}' |
||||
# # the tarball_url_redirect can be a function, takes packageName and filename and returns the url, when working with a js configuration file |
||||
# tarball_url_redirect(packageName, filename) { |
||||
# const signedUrl = // generate a signed url |
||||
# return signedUrl; |
||||
# } |
||||
|
||||
# translate your registry, api i18n not available yet |
||||
# i18n: |
||||
# list of the available translations https://github.com/verdaccio/verdaccio/blob/master/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md |
||||
# web: en-US |
@ -1,33 +1,8 @@ |
||||
.PHONY: pull docs docs-quick docs-no-pull docs-test docs-local-static |
||||
|
||||
PODMAN = $(shell if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)
|
||||
IMAGE = grafana/docs-base:latest
|
||||
CONTENT_PATH = /hugo/content/docs/grafana/latest
|
||||
LOCAL_STATIC_PATH = ../../website/static
|
||||
PORT = 3002:3002
|
||||
|
||||
pull: |
||||
$(PODMAN) pull $(IMAGE)
|
||||
|
||||
docs: pull |
||||
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z -p $(PORT) --rm -it $(IMAGE) make server
|
||||
|
||||
docs-preview: pull |
||||
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z -p $(PORT) --rm -it $(IMAGE) make server BUILD_DRAFTS=true
|
||||
|
||||
docs-no-pull: |
||||
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z -p $(PORT) --rm -it $(IMAGE) make server
|
||||
|
||||
docs-test: pull |
||||
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z --rm -it $(IMAGE) make prod
|
||||
|
||||
# expects that you have grafana/website checked out in same path as the grafana repo.
|
||||
docs-local-static: pull |
||||
if [ ! -d "$(LOCAL_STATIC_PATH)" ]; then echo "local path (website project) $(LOCAL_STATIC_PATH) not found"]; exit 1; fi
|
||||
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z \
|
||||
-v $(shell pwd)/$(LOCAL_STATIC_PATH):/hugo/static:Z -p $(PORT) --rm -it $(IMAGE)
|
||||
|
||||
.PHONY: doc-validator/% |
||||
doc-validator/%: ## Run doc-validator on a specific path. To lint the path /docs/sources/administration, run 'make doc-validator/administration'.
|
||||
doc-validator/%: |
||||
$(PODMAN) run --init -v "$(shell pwd)/sources:/sources" grafana/doc-validator:latest --skip-image-validation --include=$(subst doc-validator/,,$@) ./sources /docs/grafana/latest
|
||||
.ONESHELL: |
||||
.DELETE_ON_ERROR: |
||||
export SHELL := bash
|
||||
export SHELLOPTS := pipefail:errexit
|
||||
MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rule
|
||||
|
||||
include docs.mk |
||||
|
@ -0,0 +1,110 @@ |
||||
include variables.mk |
||||
-include variables.mk.local |
||||
|
||||
.ONESHELL: |
||||
.DELETE_ON_ERROR: |
||||
export SHELL := bash
|
||||
export SHELLOPTS := pipefail:errexit
|
||||
MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rule
|
||||
|
||||
.DEFAULT_GOAL: help |
||||
|
||||
# Adapted from https://www.thapaliya.com/en/writings/well-documented-makefiles/
|
||||
.PHONY: help |
||||
help: ## Display this help.
|
||||
help: |
||||
@awk 'BEGIN { \
|
||||
FS = ": ##"; \
|
||||
printf "Usage:\n make <target>\n\nTargets:\n" \
|
||||
} \
|
||||
/^[a-zA-Z0-9_\.\-\/%]+: ##/ { printf " %-15s %s\n", $$1, $$2 }' \
|
||||
$(MAKEFILE_LIST)
|
||||
|
||||
GIT_ROOT := $(shell git rev-parse --show-toplevel)
|
||||
|
||||
PODMAN := $(shell if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)
|
||||
|
||||
ifeq ($(PROJECTS),) |
||||
$(error "PROJECTS variable must be defined in variables.mk") |
||||
endif |
||||
|
||||
# First project is considered the primary one used for doc-validator.
|
||||
PRIMARY_PROJECT := $(subst /,-,$(firstword $(subst :, ,$(firstword $(PROJECTS)))))
|
||||
|
||||
# Name for the container.
|
||||
ifeq ($(origin DOCS_CONTAINER), undefined) |
||||
export DOCS_CONTAINER := $(PRIMARY_PROJECT)-docs
|
||||
endif |
||||
|
||||
# Host port to publish container port to.
|
||||
ifeq ($(origin DOCS_HOST_PORT), undefined) |
||||
export DOCS_HOST_PORT := 3002
|
||||
endif |
||||
|
||||
# Container image used to perform Hugo build.
|
||||
ifeq ($(origin DOCS_IMAGE), undefined) |
||||
export DOCS_IMAGE := grafana/docs-base:latest
|
||||
endif |
||||
|
||||
# Container image used for doc-validator linting.
|
||||
ifeq ($(origin DOC_VALIDATOR_IMAGE), undefined) |
||||
export DOC_VALIDATOR_IMAGE := grafana/doc-validator:latest
|
||||
endif |
||||
|
||||
# PATH-like list of directories within which to find projects.
|
||||
# If all projects are checked out into the same directory, ~/repos/ for example, then the default should work.
|
||||
ifeq ($(origin REPOS_PATH), undefined) |
||||
export REPOS_PATH := $(realpath $(GIT_ROOT)/..)
|
||||
endif |
||||
|
||||
# How to treat Hugo relref errors.
|
||||
ifeq ($(origin HUGO_REFLINKSERRORLEVEL), undefined) |
||||
export HUGO_REFLINKSERRORLEVEL := WARNING
|
||||
endif |
||||
|
||||
.PHONY: docs-rm |
||||
docs-rm: ## Remove the docs container.
|
||||
$(PODMAN) rm -f $(DOCS_CONTAINER)
|
||||
|
||||
.PHONY: docs-pull |
||||
docs-pull: ## Pull documentation base image.
|
||||
$(PODMAN) pull $(DOCS_IMAGE)
|
||||
|
||||
make-docs: ## Fetch the latest make-docs script.
|
||||
make-docs: |
||||
if [[ ! -f "$(PWD)/make-docs" ]]; then
|
||||
echo 'WARN: No make-docs script found in the working directory. Run `make update` to download it.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
.PHONY: docs |
||||
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
|
||||
docs: docs-pull make-docs |
||||
$(PWD)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: docs-no-pull |
||||
docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
|
||||
docs-no-pull: make-docs |
||||
$(PWD)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: docs-debug |
||||
docs-debug: ## Run Hugo web server with debugging enabled. TODO: support all SERVER_FLAGS defined in website Makefile.
|
||||
docs-debug: make-docs |
||||
WEBSITE_EXEC='hugo server --debug' $(PWD)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: doc-validator |
||||
doc-validator: ## Run docs-validator on the entire docs folder.
|
||||
doc-validator: make-docs |
||||
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(PWD)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: doc-validator/% |
||||
doc-validator/%: ## Run doc-validator on a specific path. To lint the path /docs/sources/administration, run 'make doc-validator/administration'.
|
||||
doc-validator/%: make-docs |
||||
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) DOC_VALIDATOR_INCLUDE=$(subst doc-validator/,,$@) $(PWD)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: update |
||||
update: ## Fetch the latest version of this Makefile and the `make-docs` script from Writers' Toolkit.
|
||||
curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk
|
||||
curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs
|
||||
chmod +x make-docs
|
@ -0,0 +1,359 @@ |
||||
#!/bin/sh |
||||
# The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs. |
||||
|
||||
set -ef |
||||
|
||||
readonly DOCS_CONTAINER="${DOCS_CONTAINER:-make-docs}" |
||||
readonly DOCS_HOST_PORT="${DOCS_HOST_PORT:-3002}" |
||||
readonly DOCS_IMAGE="${DOCS_IMAGE:-grafana/docs-base:latest}" |
||||
|
||||
readonly DOC_VALIDATOR_INCLUDE="${DOC_VALIDATOR_INCLUDE:-.+\.md$}" |
||||
|
||||
readonly HUGO_REFLINKSERRORLEVEL="${HUGO_REFLINKSERRORLEVEL:-WARNING}" |
||||
readonly WEBSITE_EXEC="${WEBSITE_EXEC:-make server}" |
||||
# If set, the docs-base image will run a prebuild script that sets up Hugo mounts. |
||||
readonly WEBSITE_MOUNTS="${WEBSITE_MOUNTS:-}" |
||||
|
||||
PODMAN="$(if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)" |
||||
|
||||
about() { |
||||
cat <<EOF |
||||
Test documentation locally with multiple source repositories. |
||||
|
||||
The REPOS_PATH environment variable is a colon (:) separated list of paths in which to look for project repositories. |
||||
EOF |
||||
} |
||||
|
||||
usage() { |
||||
cat <<EOF |
||||
Usage: |
||||
REPOS_PATH=<PATH[:<PATH>...]> $0 [<PROJECT>[:<VERSION>[:<REPO>[:<DIR>]]]...] |
||||
|
||||
Examples: |
||||
REPOS_PATH=~/ext/grafana/ $0 writers-toolkit tempo:latest helm-charts/mimir-distributed:latest:mimir:docs/sources/mimir-distributed |
||||
EOF |
||||
} |
||||
|
||||
if [ $# -lt 1 ]; then |
||||
cat <<EOF >&2 |
||||
ERRR: arguments required but not supplied. |
||||
|
||||
$(about) |
||||
|
||||
$(usage) |
||||
EOF |
||||
exit 1 |
||||
fi |
||||
|
||||
readonly REPOS_PATH="${REPOS_PATH:-$(realpath "$(git rev-parse --show-toplevel)/..")}" |
||||
|
||||
if [ -z "${REPOS_PATH}" ]; then |
||||
cat <<EOF >&2 |
||||
ERRR: REPOS_PATH environment variable is required but has not been provided. |
||||
|
||||
$(usage) |
||||
EOF |
||||
exit 1 |
||||
fi |
||||
|
||||
SOURCES_as_code='as-code-docs' |
||||
SOURCES_enterprise_metrics='backend-enterprise' |
||||
SOURCES_enterprise_metrics_='backend-enterprise' |
||||
SOURCES_grafana_cloud='cloud-docs' |
||||
SOURCES_grafana_cloud_k6='k6-docs' |
||||
SOURCES_helm_charts_mimir_distributed='mimir' |
||||
SOURCES_helm_charts_tempo_distributed='tempo' |
||||
SOURCES_opentelemetry='opentelemetry-docs' |
||||
|
||||
VERSIONS_as_code='UNVERSIONED' |
||||
VERSIONS_grafana_cloud='UNVERSIONED' |
||||
VERSIONS_grafana_cloud_k6='UNVERSIONED' |
||||
VERSIONS_opentelemetry='UNVERSIONED' |
||||
VERSIONS_technical_documentation='UNVERSIONED' |
||||
VERSIONS_writers_toolkit='UNVERSIONED' |
||||
|
||||
PATHS_helm_charts_mimir_distributed='docs/sources/helm-charts/mimir-distributed' |
||||
PATHS_helm_charts_tempo_distributed='docs/sources/helm-charts/tempo-distributed' |
||||
PATHS_mimir='docs/sources/mimir' |
||||
PATHS_tempo='docs/sources/tempo' |
||||
|
||||
# identifier STR |
||||
# Replace characters that are not valid in an identifier with underscores. |
||||
identifier() { |
||||
echo "$1" | tr -C '[:alnum:]_\n' '_' |
||||
} |
||||
|
||||
# aget ARRAY KEY |
||||
# Get the value of KEY from associative array ARRAY. |
||||
# Characters that are not valid in an identifier are replaced with underscores. |
||||
aget() { |
||||
eval echo '$'"$(identifier "$1")_$(identifier "$2")" |
||||
} |
||||
|
||||
# new_proj populates a new project structure. |
||||
new_proj() { |
||||
_project="$1" |
||||
_version="$2" |
||||
_repo="$3" |
||||
_path="$4" |
||||
|
||||
# If version is not set, use the script mapping of project to default versions if it exists. |
||||
# Fallback to 'latest'. |
||||
if [ -z "${_version}" ]; then |
||||
if [ -z "$(aget VERSIONS "${_project}")" ]; then |
||||
_version=latest |
||||
else |
||||
_version="$(aget VERSIONS "${_project}")" |
||||
fi |
||||
fi |
||||
|
||||
# If repo is not set, use the script mapping of project to repo name if it exists. |
||||
# Fallback to using the project name. |
||||
if [ -z "${_repo}" ]; then |
||||
if [ -z "$(aget SOURCES "${_project}")" ]; then |
||||
_repo="${_project}" |
||||
else |
||||
_repo="$(aget SOURCES "${_project}")" |
||||
fi |
||||
fi |
||||
|
||||
# If path is not set, use the script mapping of project to docs sources path if it exists. |
||||
# Fallback to using 'docs/sources'. |
||||
if [ -z "${_path}" ]; then |
||||
if [ -z "$(aget PATHS "${_project}")" ]; then |
||||
_path="docs/sources" |
||||
else |
||||
_path="$(aget PATHS "${_project}")" |
||||
fi |
||||
fi |
||||
|
||||
echo "${_project}:${_version}:${_repo}:${_path}" |
||||
unset _project _version _repo _path |
||||
} |
||||
|
||||
# proj_url returns the webserver URL for a project. |
||||
# It expects a complete project structure as input. |
||||
proj_url() { |
||||
IFS=: read -r _project _version _ _ <<POSIX_HERESTRING |
||||
$1 |
||||
POSIX_HERESTRING |
||||
|
||||
if [ -z "${_version}" ] || [ "${_version}" = 'UNVERSIONED' ]; then |
||||
echo "http://localhost:${DOCS_HOST_PORT}/docs/${_project}/" |
||||
else |
||||
echo "http://localhost:${DOCS_HOST_PORT}/docs/${_project}/${_version}/" |
||||
fi |
||||
|
||||
unset _project _version |
||||
} |
||||
|
||||
# proj_ver returns the version for a project. |
||||
# It expects a complete project structure as input. |
||||
proj_ver() { |
||||
IFS=: read -r _ _ver _ _ <<POSIX_HERESTRING |
||||
$1 |
||||
POSIX_HERESTRING |
||||
|
||||
echo "${_ver}" |
||||
unset _ver |
||||
} |
||||
|
||||
# proj_dst returns the container path to content source for a project. |
||||
# It expects a complete project structure as input. |
||||
proj_dst() { |
||||
IFS=: read -r _project _version _ _ <<POSIX_HERESTRING |
||||
$1 |
||||
POSIX_HERESTRING |
||||
|
||||
if [ -z "${_version}" ] || [ "${_version}" = 'UNVERSIONED' ]; then |
||||
echo "/hugo/content/docs/${_project}" |
||||
else |
||||
echo "/hugo/content/docs/${_project}/${_version}" |
||||
fi |
||||
unset _project _version |
||||
} |
||||
|
||||
# proj_src returns the host path to content source for a project. |
||||
# It expects a complete project structure as input. |
||||
# It looks for the provided repository name in each of the paths specified in the REPOS_PATH environment variable. |
||||
proj_src() { |
||||
IFS=: read -r _ _ _repo _path <<POSIX_HERESTRING |
||||
$1 |
||||
POSIX_HERESTRING |
||||
|
||||
IFS=: |
||||
for lookup in ${REPOS_PATH}; do |
||||
if [ -d "${lookup}/${_repo}" ]; then |
||||
echo "${lookup}/${_repo}/${_path}" |
||||
unset _path _repo |
||||
return |
||||
fi |
||||
done |
||||
unset IFS |
||||
|
||||
echo "ERRR: could not find project '${_repo}' in any of the paths in REPOS_PATH '${REPOS_PATH}'." >&2 |
||||
echo "NOTE: you must have a checkout of the project '${_repo}' at '${REPOS_PATH##:*}/${_repo}'." >&2 |
||||
echo "NOTE: if you have cloned the repository into a directory with a different name, consider changing it to ${_repo}." >&2 |
||||
unset _path _repo |
||||
exit 1 |
||||
} |
||||
|
||||
# proj_canonical returns the canonical absolute path partial URI for a project. |
||||
# It expects a complete project structure as input. |
||||
proj_canonical() { |
||||
IFS=: read -r _project _version _ _ <<POSIX_HERESTRING |
||||
$1 |
||||
POSIX_HERESTRING |
||||
|
||||
if [ -z "${_version}" ] || [ "${_version}" = 'UNVERSIONED' ]; then |
||||
echo "/docs/${_project}" |
||||
else |
||||
echo "/docs/${_project}/${_version}" |
||||
fi |
||||
unset _project _version |
||||
} |
||||
|
||||
proj_to_url_src_dst_ver() { |
||||
_url="$(proj_url "$1")" |
||||
_src="$(proj_src "$1")" |
||||
_dst="$(proj_dst "$1")" |
||||
_ver="$(proj_ver "$1")" |
||||
|
||||
echo "${_url}^${_src}^${_dst}^${_ver}" |
||||
unset _url _src _dst _ver |
||||
} |
||||
|
||||
url_src_dst_vers() { |
||||
for arg in "$@"; do |
||||
IFS=: read -r _project _version _repo _path <<POSIX_HERESTRING |
||||
$arg |
||||
POSIX_HERESTRING |
||||
|
||||
case "${_project}" in |
||||
# Workaround for arbitrary mounts where the version field is expected to be the local directory |
||||
# and the repo field is expected to be the container directory. |
||||
arbitrary) |
||||
echo "${_project}^${_version}^${_repo}^" # TODO |
||||
;; |
||||
logs) |
||||
proj_to_url_src_dst_ver "$(new_proj loki "${_version}")" |
||||
proj_to_url_src_dst_ver "$(new_proj enterprise-logs "${_version}")" |
||||
;; |
||||
metrics) |
||||
proj_to_url_src_dst_ver "$(new_proj mimir "${_version}")" |
||||
proj_to_url_src_dst_ver "$(new_proj helm-charts/mimir-distributed "${_version}")" |
||||
proj_to_url_src_dst_ver "$(new_proj enterprise-metrics "${_version}")" |
||||
;; |
||||
traces) |
||||
proj_to_url_src_dst_ver "$(new_proj tempo "${_version}")" |
||||
proj_to_url_src_dst_ver "$(new_proj enterprise-traces "${_version}")" |
||||
;; |
||||
*) |
||||
proj_to_url_src_dst_ver "$(new_proj "${_project}" "${_version}" "${_repo}" "${_path}")" |
||||
;; |
||||
esac |
||||
done |
||||
|
||||
unset _project _version _repo _path |
||||
} |
||||
|
||||
url_src_dst_vers="$(url_src_dst_vers "$@")" |
||||
|
||||
volumes="" |
||||
redirects="" |
||||
|
||||
for x in ${url_src_dst_vers}; do |
||||
IFS='^' read -r _url _src _dst _ver <<POSIX_HERESTRING |
||||
$x |
||||
POSIX_HERESTRING |
||||
|
||||
if [ "${_url}" != "arbitrary" ]; then |
||||
if [ ! -f "${_src}/_index.md" ]; then |
||||
echo "ERRR: Index file '${_src}/_index.md' does not exist." >&2 |
||||
echo "Is '${_src}' the correct source directory?" >&2 |
||||
exit 1 |
||||
fi |
||||
fi |
||||
|
||||
echo "DEBG: Mounting '${_src}' at container path '${_dst}'" >&2 |
||||
if [ -z "${volumes}" ]; then |
||||
volumes="--volume=${_src}:${_dst}" |
||||
else |
||||
volumes="${volumes} --volume=${_src}:${_dst}" |
||||
fi |
||||
|
||||
if [ -n "${_ver}" ] && [ "${_ver}" != 'UNVERSIONED' ]; then |
||||
if [ -z "${redirects}" ]; then |
||||
redirects="${_dst}^${_ver}" |
||||
else |
||||
redirects="${redirects} ${_dst}^${_ver}" |
||||
fi |
||||
fi |
||||
unset _url _src _dst _ver |
||||
done |
||||
|
||||
IFS=':' read -r image _ <<POSIX_HERESTRING |
||||
${DOCS_IMAGE} |
||||
POSIX_HERESTRING |
||||
|
||||
if [ "${image}" = "grafana/doc-validator" ]; then |
||||
echo |
||||
"${PODMAN}" run \ |
||||
--init \ |
||||
--interactive \ |
||||
--name "${DOCS_CONTAINER}" \ |
||||
--platform linux/amd64 \ |
||||
--rm \ |
||||
--tty \ |
||||
${volumes} \ |
||||
"${DOCS_IMAGE}" \ |
||||
--skip-image-validation \ |
||||
--include="${DOC_VALIDATOR_INCLUDE}" \ |
||||
/hugo/content/docs \ |
||||
"$(proj_canonical "$(new_proj "$1")")" |
||||
else |
||||
|
||||
cat <<EOF >/tmp/make-docs-entrypoint |
||||
#!/usr/bin/env bash |
||||
for redirect in ${redirects}; do |
||||
IFS='^' read -r path ver <<<"\${redirect}" |
||||
echo -e "---\\nredirectURL: \"\${path/\/hugo\/content/}\"\\ntype: redirect\\n---\\n" > "\${path/\${ver}/_index.md}" |
||||
|
||||
if [[ -n "${WEBSITE_MOUNTS}" ]]; then |
||||
unset WEBSITE_SKIP_MOUNTS |
||||
fi |
||||
done |
||||
|
||||
${WEBSITE_EXEC} |
||||
EOF |
||||
chmod +x /tmp/make-docs-entrypoint |
||||
volumes="${volumes} --volume=/tmp/make-docs-entrypoint:/entrypoint" |
||||
readonly volumes |
||||
|
||||
echo |
||||
echo "Documentation will be served at the following URLs:" |
||||
for x in ${url_src_dst_vers}; do |
||||
IFS='^' read -r url _ _ <<POSIX_HERESTRING |
||||
$x |
||||
POSIX_HERESTRING |
||||
|
||||
if [ -n "${url}" ]; then |
||||
echo " ${url}" |
||||
fi |
||||
done |
||||
|
||||
echo |
||||
"${PODMAN}" run \ |
||||
--env "HUGO_REFLINKSERRORLEVEL=${HUGO_REFLINKSERRORLEVEL}" \ |
||||
--init \ |
||||
--interactive \ |
||||
--name "${DOCS_CONTAINER}" \ |
||||
--platform linux/amd64 \ |
||||
--publish "${DOCS_HOST_PORT}:3002" \ |
||||
--publish "3003:3003" \ |
||||
--rm \ |
||||
--tty \ |
||||
${volumes} \ |
||||
"${DOCS_IMAGE}" \ |
||||
/entrypoint |
||||
fi |
@ -0,0 +1,35 @@ |
||||
--- |
||||
title: Correlations |
||||
weight: 900 |
||||
keywords: |
||||
- correlations |
||||
- Explore |
||||
--- |
||||
|
||||
# Correlations |
||||
|
||||
You can create interactive links for Explore visualizations to run queries related to presented data by setting up Correlations. |
||||
|
||||
A correlation defines how data in one [data source]({{< relref "/docs/grafana/latest/datasources/" >}}) is used to query data in another data source. Some examples: |
||||
|
||||
- an application name returned in a logs data source can be used to query metrics related to that application in a metrics data source, or |
||||
- a user name returned by an SQL data source can be used to query logs related to that particular user in a logs data source |
||||
|
||||
[Explore]({{< relref "/docs/grafana/latest/explore/" >}}) takes user-defined correlations to display links inside the visualizations. You can click on a link to run the related query and see results in [Explore Split View]({{< relref "/docs/grafana/latest/explore/#split-and-compare" >}}). |
||||
|
||||
Explore visualizations that currently support showing links based on correlations: |
||||
|
||||
- [Logs Panel]({{< relref "./use-correlations-in-visualizations#correlations-in-logs-panel">}}) |
||||
- [Table]({{< relref "./use-correlations-in-visualizations#correlations-in-table">}}) |
||||
|
||||
You can configure correlations using [Administration > Correlation page]({{< relref "/docs/grafana/latest/administration/" >}}) or with [provisioning]({{< relref "/docs/grafana/latest/administration/provisioning" >}}). |
||||
|
||||
> **Note:** Correlations are available in Grafana 10.0+ as an opt-in beta feature. Modify Grafana [configuration file]({{< relref "/docs/grafana/latest/setup-grafana/configure-grafana/#configuration-file-location" >}}) to enable the `correlations` [feature toggle]({{< relref "/docs/grafana/latest/setup-grafana/configure-grafana/#feature_toggles" >}}) to use it. |
||||
|
||||
## Example of how links work in Explore once set up |
||||
|
||||
{{< figure src="/static/img/docs/correlations/correlations-in-explore-10-0.gif" caption="Correlations links in Explore" >}} |
||||
|
||||
See also: |
||||
|
||||
{{< section >}} |
@ -0,0 +1,18 @@ |
||||
--- |
||||
title: Add permissions to create new correlations |
||||
menuTitle: Add permissions |
||||
weight: 30 |
||||
--- |
||||
|
||||
# Add permissions to create new correlations |
||||
|
||||
## Before you begin |
||||
|
||||
Adding access to create correlations for [Viewers and Editors]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/" >}}) is available with [Role-based access control]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/access-control/" >}}). |
||||
|
||||
## Add permissions to create correlations |
||||
|
||||
1. Go to the Administration section in Grafana. |
||||
1. Open Users page. |
||||
1. Select the user to be granted access to create correlations. |
||||
1. Add _Data sources writer_ role. |
@ -0,0 +1,101 @@ |
||||
--- |
||||
title: Correlation |
||||
weight: 10 |
||||
--- |
||||
|
||||
# Correlation |
||||
|
||||
Each correlation is configured with the following options: |
||||
|
||||
**Label** |
||||
: Link label, shown in the visualization |
||||
|
||||
**Description** |
||||
: Optional description |
||||
|
||||
**Source data source** |
||||
: The source of results that have links displayed |
||||
|
||||
**Results field** |
||||
: Defines where the link is shown in a visualization |
||||
|
||||
**Target query** |
||||
: The target query run when a link is clicked |
||||
|
||||
**Transformations** |
||||
: Optional manipulations to the source data included passed to the target query |
||||
|
||||
Learn how to create correlations using the [Administration page]({{< relref "./create-a-new-correlation#create-a-correlation-in-administration-page" >}}) or with [provisioning]({{< relref "./create-a-new-correlation#create-a-correlation-with-provisioning" >}}). |
||||
|
||||
## Source data source and result field |
||||
|
||||
Links are shown in Explore visualizations for the results from the correlation’s source data source. A link is assigned to one of the fields from the result provided in the correlation configuration (the results field). Each visualization displays fields with links in a different way ([Correlations in Logs Panel]({{< relref "./use-correlations-in-visualizations#correlations-in-logs-panel">}}) and see [Correlations in Table]({{< relref "./use-correlations-in-visualizations#correlations-in-table">}})) |
||||
|
||||
## Target query |
||||
|
||||
The target query is run when a link is clicked in the visualization. You can use the query editor of the selected target data source to specify the target query. Source data results can be accessed inside the target query with variables. |
||||
|
||||
### Correlation Variables |
||||
|
||||
You can use variables inside the target query to access the source data related to the query. Correlations use [Grafana variable syntax]({{< relref "/docs/grafana/latest/dashboards/variables/variable-syntax" >}}). Variables are filled with values from the source results when the link is clicked. There are two types of variables you can use: |
||||
|
||||
- [field variables]({{< relref "/docs/grafana/latest/panels-visualizations/configure-data-links#field-variables" >}}) (allows to access field values and labels) |
||||
- correlation variables (allows to access field values and transformations) |
||||
|
||||
Example: If source results contain a field called “employee”, the value of the field can be accessed with: |
||||
|
||||
- A field variable ${\_\_data.fields.employee} |
||||
- A correlation variable that maps the field value above to ${employee} |
||||
|
||||
In addition to mapping field values to shorter variable names, more correlation variables can be created by applying transformations to existing fields |
||||
|
||||
For more details, please see the example in [Use variables and transformations in a correlation]({{< relref "./use-variables-and-transformations" >}}). |
||||
|
||||
### Correlation Transformations |
||||
|
||||
Correlations provide a way to extract more variables out of field values. The output of transformations is a set of new variables that can be accessed as any other variable. |
||||
|
||||
There are two types of transformations: logfmt and regular expression. |
||||
|
||||
Each transformation uses a selected field value as the input. The output of a transformation is a set of new variables based on the type and options of the transformation. |
||||
|
||||
For more details, please see the example in [Use variables and transformations in a correlation]({{< relref "./use-variables-and-transformations" >}}) for more details. |
||||
|
||||
### Logfmt transformation |
||||
|
||||
The logfmt transformation deconstructs a field value containing text formatted with [logfmt key/value pairs](https://brandur.org/logfmt). Each pair becomes a variable with the key being the name of the variable. |
||||
|
||||
The logfmt transformation only requires specifying the input field name if you would like the transformation to apply to a different field than the results field. |
||||
Example output variables for field = “host=srv001 endpoint=/test app=foo”: |
||||
|
||||
| name | value | |
||||
| :------- | :----- | |
||||
| host | srv001 | |
||||
| endpoint | /test | |
||||
| app | foo | |
||||
|
||||
### Regular expression transformation |
||||
|
||||
The regular expression transformation deconstructs a field value based on the provided regular expression. |
||||
|
||||
Regular expression transformation options: |
||||
|
||||
**field** |
||||
: Input field name |
||||
|
||||
**expression** |
||||
: Regular expression. Named capture groups are mapped to variables matching the group name. If non-named matching groups are used a variable is created out of the first match. The value overrides the variable matching the input field or a new variable is created if mapValue is provided (check the example below) |
||||
|
||||
**mapValue** |
||||
: Used with simple regex groups without named matching groups. By default, the first match overrides the variable with the name of the field that is used as the input. To change that default behavior you can specify the mapValue property. The provided name is used to create a new variable. This can be useful if your target query requires both the exact value and a part of the value extracted with the transformation. |
||||
|
||||
Example: Assuming the selected field name is “employee” and the field value is “John Doe”. |
||||
|
||||
Various output variables based on expression and mapValue options: |
||||
|
||||
| expression | mapValue | output variables | comment | |
||||
| :---------------- | :------- | :--------------------------- | :------------------------------------------------------------------------------------------------ | |
||||
| /\\w+ (\\w+)/ | - | employee=Doe | No mapValue provided. The first matching is mapped to the existing field name variable (employee) | |
||||
| /(\\w+) (\\w+)/ | name | name=John | The first matching is mapped to a new variable called “name” | |
||||
| /(?\\w+) (?\\w+)/ | - | firstName=John, lastName=Doe | When named groups are used they are the names of the output variables and mapValue is ignored. | |
||||
| /(?\\w+) (?\\w+)/ | name | firstName=John, lastName=Doe | Same as above | |
@ -0,0 +1,15 @@ |
||||
--- |
||||
title: Permissions |
||||
weight: 20 |
||||
--- |
||||
|
||||
# Permissions |
||||
|
||||
Users with [Viewer base role]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/" >}}) or with [datasources:query RBAC role]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/access-control/" >}}) can: |
||||
|
||||
- Use correlations in Explore’s visualizations |
||||
- List all available correlations in read-only mode |
||||
|
||||
Users with [Admin base role]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/" >}}) or with [datasources:write RBAC role]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/access-control/" >}}) can: |
||||
|
||||
- Add, edit and delete correlations |
@ -0,0 +1,120 @@ |
||||
--- |
||||
title: Create a new correlation |
||||
weight: 40 |
||||
--- |
||||
|
||||
# Create a new correlation |
||||
|
||||
## Before you begin |
||||
|
||||
Make sure you have permission to add new correlations. Only users with write permissions to data sources can define new correlations. |
||||
|
||||
## Create a correlation in Administration page |
||||
|
||||
1. Go to the Administration section in Grafana. |
||||
1. Open Correlations page. |
||||
1. Click the “Add” button in the top right corner. |
||||
1. Provide a **label** for the correlation. |
||||
1. Provide an optional **description**. |
||||
1. Go to the next page. |
||||
1. Provide **target data source**. |
||||
1. Provide **target query** using variables. |
||||
1. Go to the next page. |
||||
1. Provide **source data source**. |
||||
1. Provide **results field**. |
||||
1. Add transformations if you need variables that are not fields in the source data source. |
||||
1. Click “Add” to add a new transformation. |
||||
1. Select the type of a transformation. |
||||
1. Configure transformation depending on the selected type. |
||||
1. Save correlation. |
||||
|
||||
You can edit correlation in the same way, but you cannot change the selected data sources. |
||||
|
||||
## Create a correlation with provisioning |
||||
|
||||
Provision correlations by extending provisioned data sources. Correlations are defined as a subsection of the source data source configuration: |
||||
|
||||
```yaml |
||||
datasources: |
||||
- name: Data source name # source data source |
||||
... |
||||
jsonData: |
||||
... |
||||
correlations: |
||||
- targetUID: uid |
||||
label: "test" |
||||
description: "..." |
||||
config: |
||||
type: "query" |
||||
target: |
||||
expr: "..." |
||||
field: "name" |
||||
transformations: |
||||
- type: regex |
||||
field: "test" |
||||
expression: /\w+/ |
||||
mapValue: "other" |
||||
- type: logfmt |
||||
field: "test" |
||||
``` |
||||
|
||||
Description of provisioning properties: |
||||
|
||||
**targetUID** |
||||
: Target data source UID |
||||
|
||||
**label** |
||||
: Link label |
||||
|
||||
**description** |
||||
: Optional description |
||||
|
||||
**config** |
||||
: Config object |
||||
|
||||
**config.type** |
||||
: Correlation type. “query” is the only supported type at the moment |
||||
|
||||
**config.target** |
||||
: [Target query model]({{< relref "#determine-target-query-model-structure" >}}) |
||||
|
||||
**config.field** |
||||
: Name of the field where link is shown |
||||
|
||||
**config.transformations (list)** |
||||
: List of transformation objects |
||||
|
||||
**transformation.type** |
||||
: regex, or logfmt |
||||
|
||||
**transformation.field** |
||||
: The field that will be transformed. If this is not defined, it will apply the transformation to the data from the correlation's config.field. |
||||
|
||||
**transformation.expression** |
||||
: Regex expression (regex transformation only) |
||||
|
||||
**transformation.mapValue** |
||||
: New name of the variable from the first regex match (regex transformation only) |
||||
|
||||
### Determine target query model structure |
||||
|
||||
When you set up a correlation with admin page you can use the target query editor. When you use provisioning you may need to know the structure of the target query which may not be well documented depending on the plugin. Here is a quick step-by-step guide on how to determine the target query model: |
||||
|
||||
1. Open Explore. |
||||
1. Select the data source you want to use as the target of the correlation. |
||||
1. Open the inspector tab and select “Query”. |
||||
1. Run a sample query. |
||||
1. Inspect results. |
||||
1. Look for the “queries” list object. Each object is created using the query model structure defined by the data source. You can use the same structure in your provisioning file. |
||||
|
||||
{{< figure src="/static/img/docs/correlations/determine-target-query-structure-inspector-10-0.png" max-width="600px" caption="Query inspector with target query structure" >}} |
||||
|
||||
The query model in this example is represented by the first entry in the queries list. Properties “refId” and “datasource” are added to all queries in runtime and can be omitted: |
||||
|
||||
```json |
||||
{ |
||||
"scenario_id": "random_walk", |
||||
"alias": "app", |
||||
"seriesCount: 2 |
||||
} |
||||
``` |
@ -0,0 +1,29 @@ |
||||
--- |
||||
title: Use correlations in visualizations |
||||
weight: 70 |
||||
--- |
||||
|
||||
# Use correlations in visualizations |
||||
|
||||
## Correlations in Logs Panel |
||||
|
||||
1. Setup a correlation. |
||||
1. Open Explore. |
||||
1. Select a data source that you chose as the source data source of the correlation. |
||||
1. Run a query that results in data containing fields required to build variables in the target query. |
||||
1. Expand log row details. |
||||
1. If the selected row contains all the information required to build the target query a link appears in the “Links” section at the bottom. |
||||
1. Additional information about used variables and their values is shown next to each link. |
||||
|
||||
{{< figure src="/static/img/docs/correlations/correlations-in-logs-panel-10-0.png" max-width="600px" caption="Correlation links in Logs panel" >}} |
||||
|
||||
## Correlations in Table |
||||
|
||||
1. Setup a correlation. |
||||
1. Open Explore. |
||||
1. Select a data source that you chose as the source data source of the correlation. |
||||
1. Run a query that results in data containing fields required to build variables in the target query. |
||||
1. Links are added to cell rows in the column representing the field with the assigned link ([the results field]({{< relref "/docs/grafana/latest/administration/correlations/correlation-configuration#source-data-source-and-result-field" >}}). |
||||
1. Cells containing multiple links accessible with a context menu. |
||||
|
||||
{{< figure src="/static/img/docs/correlations/correlations-in-table-10-0.png" max-width="600px" caption="Correlations links in table" >}} |
@ -0,0 +1,135 @@ |
||||
--- |
||||
title: Use variables and transformations in a correlation |
||||
weight: 60 |
||||
--- |
||||
|
||||
# Use variables and transformations in a correlation |
||||
|
||||
## Before you begin |
||||
|
||||
This example walks through creating a link in a test data source but the same principles apply to any data source. |
||||
|
||||
The example emulates a scenario with two data sources: |
||||
|
||||
- Logs containing lines in the format: “2020-01-01 10:00 level=error message=error service=app1.loginService” stored in a field named “msg” |
||||
- Metrics for application included in the service name of a log line (e.g. app1) |
||||
|
||||
Instructions below show how to set up a link that can run metrics query for the host included in each log line with provisioning and regex transformation. Additionally, a link with a query containing the full name of the service is set up to demonstrate the logfmt transformation. |
||||
|
||||
## Use variables and transformations in provisioning |
||||
|
||||
1. Add the following provisioning configuration to your Grafana: |
||||
|
||||
```yaml |
||||
datasources: |
||||
- name: Target |
||||
uid: test-target |
||||
type: testdata |
||||
|
||||
- name: Source |
||||
uid: test-source |
||||
type: testdata |
||||
- name: Source |
||||
uid: test-source |
||||
type: testdata |
||||
correlations: |
||||
- targetUID: test-target |
||||
label: App metrics |
||||
description: Application HTTP request metrics |
||||
config: |
||||
type: query |
||||
target: |
||||
scenario_id: random_walk |
||||
alias: $${application} |
||||
field: msg |
||||
transformations: |
||||
- type: regex |
||||
field: msg |
||||
expression: service=(\w+)\.\w+ |
||||
mapValue: application |
||||
- targetUID: test-target |
||||
label: Service metrics |
||||
description: Service metrics |
||||
config: |
||||
type: query |
||||
target: |
||||
scenario_id: random_walk |
||||
alias: $${service} |
||||
field: msg |
||||
transformations: |
||||
- type: logfmt |
||||
field: msg |
||||
``` |
||||
|
||||
Two data sources are created: Source (emulating logs data source) and Target (emulating metrics data source): |
||||
|
||||
- A correlation called “App metrics” is created targeting the Target data source with its UID. |
||||
- The label and description are provided as text |
||||
- Each correlation contains the following configuration: |
||||
- Required correlation type (query) |
||||
- Target query matching test data source model |
||||
- “App metrics” correlation contains the following configuration: |
||||
- Alias is set to ${application} variable (note that in provisioning files $ is used to access environment variables so it has to be [escaped]({{< relref "/docs/grafana/latest/administration/provisioning#using-environment-variables" >}})). |
||||
- Regular expression transformation is created to extract values from “msg” field |
||||
- Regular expression transformation is used to capture the application name from the full name of the service stored in the log line. |
||||
- The output of the transformation is mapped to a variable called “application”. |
||||
- “Service metrics” correlation is created in a similar way but with logfmt transformation to break down log message and access full name of the service (e.g. “app1.loginService”). |
||||
- For example, when a logline “2020-01-01 10:00 level=error message=error service=app1.loginService” is provided as the input, the transformation produces new variables: level, message, and service. |
||||
- “service” variable is used as the alias in the target query. |
||||
|
||||
1. Navigate to Explore and open “Source” data source. |
||||
1. Select the “Raw Frames” scenario and provide the following data frames to emulate returning log lines: |
||||
```json |
||||
[ |
||||
{ |
||||
"meta": { |
||||
"preferredVisualisationType": "logs" |
||||
}, |
||||
"fields": [ |
||||
{ |
||||
"name": "time", |
||||
"values": [1, 2] |
||||
}, |
||||
{ |
||||
"name": "msg", |
||||
"values": [ |
||||
"level=error msg=error service=app1.loginService", |
||||
"level=debug msg=info service=app2.userProfileService" |
||||
] |
||||
} |
||||
] |
||||
} |
||||
] |
||||
``` |
||||
1. Run the query and open log details by clicking on the log line. |
||||
|
||||
{{< figure src="/static/img/docs/correlations/correlations-in-logs-panel-10-0.png" max-width="600px" caption="Correlation links in Logs panel" >}} |
||||
|
||||
A link “App metrics” and “Service metrics” show next to variables extracted out of the log line with transformations |
||||
|
||||
1. Click on the “App metrics” link. |
||||
1. A split view is opened and the target query is run. |
||||
1. Notice how the application name from the log line is filled in as the alias property in the target query. |
||||
|
||||
{{< figure src="/static/img/docs/correlations/interpolated-target-query-10-0.png" max-width="600px" caption="Interpolated target query" >}} |
||||
|
||||
This allows you to run a specific query based on the source results: |
||||
|
||||
{{< figure src="/static/img/docs/correlations/target-query-results-10-0.png" max-width="600px" caption="Interpolated target query results" >}} |
||||
|
||||
1. Go back to the source query and change raw frames’ preferred visualization type to “table” to see how links are displayed in a Table visualization. |
||||
|
||||
```json |
||||
[ |
||||
{ |
||||
"meta": { |
||||
"preferredVisualisationType": "table" |
||||
}, |
||||
"fields": [...] |
||||
} |
||||
] |
||||
``` |
||||
|
||||
1. Run the query and notice how links are created in the Table cell: |
||||
|
||||
{{< figure src="/static/img/docs/correlations/correlations-in-table-10-0.png" max-width="600px" caption="Correlations links in table" >}} |
@ -0,0 +1,90 @@ |
||||
--- |
||||
aliases: |
||||
- ../../../enterprise/access-control/troubleshooting/ |
||||
labels: |
||||
products: |
||||
- cloud |
||||
- enterprise |
||||
- oss |
||||
description: RBAC troubleshooting guide. |
||||
menuTitle: Troubleshooting RBAC |
||||
title: Troubleshooting RBAC |
||||
weight: 80 |
||||
--- |
||||
|
||||
# Troubleshooting RBAC |
||||
|
||||
In this section, you’ll learn about logs that are available for RBAC and you’ll find the most common RBAC issues. |
||||
|
||||
## Enable debug logging |
||||
|
||||
You can enable debug log messages for RBAC in the Grafana configuration file. Debug logs are added to the Grafana server logs. |
||||
|
||||
```bash |
||||
[log] |
||||
filters = accesscontrol:debug accesscontrol.evaluator:debug dashboard.permissions:debug |
||||
``` |
||||
|
||||
## Enable audit logging |
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.3 and later, and [Grafana Cloud Advanced](/docs/grafana-cloud). |
||||
|
||||
You can enable auditing in the Grafana configuration file. |
||||
|
||||
```bash |
||||
[auditing] |
||||
enabled = true |
||||
``` |
||||
|
||||
All permission and role updates, and role assignments are added to audit logs. |
||||
Learn more about [access control audit logs]({{< relref "../../../../setup-grafana/configure-security/audit-grafana/#access-control" >}}). |
||||
|
||||
## Missing dashboard, folder or data source permissions |
||||
|
||||
[Dashboard and folder permissions]({{< relref "../../#dashboard-permissions" >}}) and [data source permissions]({{< relref "../../#data-source-permissions" >}}) can go out of sync if a Grafana instance version is upgraded, downgraded and then upgraded again. |
||||
This happens when an instance is downgraded from a version that uses RBAC to a version that uses the legacy access control, and dashboard, folder or data source permissions are updated. |
||||
These permission updates will not be applied to RBAC, so permissions will be out of sync when the instance is next upgraded to a version with RBAC. |
||||
|
||||
> **Note:** the steps provided below will set all dashboard, folder and data source permissions to what they are set to with the legacy access control. |
||||
> If you have made dashboard, folder or data source permission updates with RBAC enabled, these updates will be wiped. |
||||
|
||||
To resynchronize the permissions: |
||||
|
||||
1. make a backup of your database |
||||
1. run the following SQL queries |
||||
```sql |
||||
DELETE |
||||
FROM builtin_role |
||||
where role_id IN (SELECT id |
||||
FROM role |
||||
WHERE name LIKE 'managed:%'); |
||||
DELETE |
||||
FROM team_role |
||||
where role_id IN (SELECT id |
||||
FROM role |
||||
WHERE name LIKE 'managed:%'); |
||||
DELETE |
||||
FROM user_role |
||||
where role_id IN (SELECT id |
||||
FROM role |
||||
WHERE name LIKE 'managed:%'); |
||||
DELETE |
||||
FROM permission |
||||
where role_id IN (SELECT id |
||||
FROM role |
||||
WHERE name LIKE 'managed:%'); |
||||
DELETE |
||||
FROM role |
||||
WHERE name LIKE 'managed:%'; |
||||
DELETE |
||||
FROM migration_log |
||||
WHERE migration_id IN ('teams permissions migration', |
||||
'dashboard permissions', |
||||
'dashboard permissions uid scopes', |
||||
'data source permissions', |
||||
'data source uid permissions', |
||||
'managed permissions migration', |
||||
'managed folder permissions alert actions repeated migration', |
||||
'managed permissions migration enterprise'); |
||||
``` |
||||
1. restart your Grafana instance |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue