فهرست منبع

Merge branch 'master' into docs-5.1

Marcus Efraimsson 7 سال پیش
والد
کامیت
41ff37f0a1

+ 3 - 0
CHANGELOG.md

@@ -3,6 +3,7 @@
 * **MSSQL**: New Microsoft SQL Server data source [#10093](https://github.com/grafana/grafana/pull/10093), [#11298](https://github.com/grafana/grafana/pull/11298), thx [@linuxchips](https://github.com/linuxchips)
 * **Prometheus**: The heatmap panel now support Prometheus histograms [#10009](https://github.com/grafana/grafana/issues/10009)
 * **Postgres/MySQL**: Ability to insert 0s or nulls for missing intervals [#9487](https://github.com/grafana/grafana/issues/9487), thanks [@svenklemm](https://github.com/svenklemm)
+* **Postgres/MySQL/MSSQL**: Fix precision for the time column in table mode [#11306](https://github.com/grafana/grafana/issues/11306)
 * **Graph**: Align left and right Y-axes to one level [#1271](https://github.com/grafana/grafana/issues/1271) &  [#2740](https://github.com/grafana/grafana/issues/2740) thx [@ilgizar](https://github.com/ilgizar)
 * **Graph**: Thresholds for Right Y axis [#7107](https://github.com/grafana/grafana/issues/7107), thx [@ilgizar](https://github.com/ilgizar)
 * **Graph**: Support multiple series stacking in histogram mode [#8151](https://github.com/grafana/grafana/issues/8151), thx [@mtanda](https://github.com/mtanda)
@@ -19,6 +20,8 @@
 * **Units**: Second to HH:mm:ss formatter [#11107](https://github.com/grafana/grafana/issues/11107), thx [@gladdiologist](https://github.com/gladdiologist)
 * **Singlestat**: Add color to prefix and postfix in singlestat panel [#11143](https://github.com/grafana/grafana/pull/11143), thx [@ApsOps](https://github.com/ApsOps)
 * **Dashboards**: Version cleanup fails on old databases with many entries [#11278](https://github.com/grafana/grafana/issues/11278)
+* **Server**: Adjust permissions of unix socket [#11343](https://github.com/grafana/grafana/pull/11343), thx [@corny](https://github.com/corny)
+* **Shortcuts**: Add shortcut for duplicate panel [#11102](https://github.com/grafana/grafana/issues/11102)
 
 # 5.0.4 (unreleased)
 * **Dashboard** Fixed bug where collapsed panels could not be directly linked to/renderer [#11114](https://github.com/grafana/grafana/issues/11114) & [#11086](https://github.com/grafana/grafana/issues/11086)

+ 1 - 1
docs/sources/features/datasources/graphite.md

@@ -75,7 +75,7 @@ You can reference queries by the row “letter” that they’re on (similar to
 ## Point consolidation
 
 All Graphite metrics are consolidated so that Graphite doesn't return more data points than there are pixels in the graph. By default,
-this consolidation is done using `avg` function. You can how Graphite consolidates metrics by adding the Graphite consolidateBy function.
+this consolidation is done using `avg` function. You can control how Graphite consolidates metrics by adding the Graphite consolidateBy function.
 
 > *Notice* This means that legend summary values (max, min, total) cannot be all correct at the same time. They are calculated
 > client side by Grafana. And depending on your consolidation function only one or two can be correct at the same time.

+ 1 - 0
docs/sources/features/shortcuts.md

@@ -42,6 +42,7 @@ Hit `?` on your keyboard to open the shortcuts help modal.
 - `e`	Toggle panel edit view
 - `v`	Toggle panel fullscreen view
 - `p` `s` Open Panel Share Modal
+- `p` `d` Duplicate Panel
 - `p` `r` Remove Panel
 
 ### Time Range

+ 4 - 1
pkg/api/http_server.go

@@ -74,12 +74,15 @@ func (hs *HTTPServer) Start(ctx context.Context) error {
 			return nil
 		}
 	case setting.SOCKET:
-		ln, err := net.Listen("unix", setting.SocketPath)
+		ln, err := net.ListenUnix("unix", &net.UnixAddr{Name: setting.SocketPath, Net: "unix"})
 		if err != nil {
 			hs.log.Debug("server was shutdown gracefully")
 			return nil
 		}
 
+		// Make socket writable by group
+		os.Chmod(setting.SocketPath, 0660)
+
 		err = hs.httpSrv.Serve(ln)
 		if err != nil {
 			hs.log.Debug("server was shutdown gracefully")

+ 11 - 0
pkg/api/pluginproxy/ds_proxy.go

@@ -89,6 +89,9 @@ func (proxy *DataSourceProxy) HandleRequest() {
 	span.SetTag("user_id", proxy.ctx.SignedInUser.UserId)
 	span.SetTag("org_id", proxy.ctx.SignedInUser.OrgId)
 
+	proxy.addTraceFromHeaderValue(span, "X-Panel-Id", "panel_id")
+	proxy.addTraceFromHeaderValue(span, "X-Dashboard-Id", "dashboard_id")
+
 	opentracing.GlobalTracer().Inject(
 		span.Context(),
 		opentracing.HTTPHeaders,
@@ -98,6 +101,14 @@ func (proxy *DataSourceProxy) HandleRequest() {
 	proxy.ctx.Resp.Header().Del("Set-Cookie")
 }
 
+func (proxy *DataSourceProxy) addTraceFromHeaderValue(span opentracing.Span, headerName string, tagName string) {
+	panelId := proxy.ctx.Req.Header.Get(headerName)
+	dashId, err := strconv.Atoi(panelId)
+	if err == nil {
+		span.SetTag(tagName, dashId)
+	}
+}
+
 func (proxy *DataSourceProxy) getDirector() func(req *http.Request) {
 	return func(req *http.Request) {
 		req.URL.Scheme = proxy.targetUrl.Scheme

+ 5 - 4
pkg/tsdb/graphite/graphite.go

@@ -28,12 +28,9 @@ func NewGraphiteExecutor(datasource *models.DataSource) (tsdb.TsdbQueryEndpoint,
 	return &GraphiteExecutor{}, nil
 }
 
-var (
-	glog log.Logger
-)
+var glog = log.New("tsdb.graphite")
 
 func init() {
-	glog = log.New("tsdb.graphite")
 	tsdb.RegisterTsdbQueryEndpoint("graphite", NewGraphiteExecutor)
 }
 
@@ -52,6 +49,7 @@ func (e *GraphiteExecutor) Query(ctx context.Context, dsInfo *models.DataSource,
 	}
 
 	for _, query := range tsdbQuery.Queries {
+		glog.Info("graphite", "query", query.Model)
 		if fullTarget, err := query.Model.Get("targetFull").String(); err == nil {
 			target = fixIntervalFormat(fullTarget)
 		} else {
@@ -79,6 +77,9 @@ func (e *GraphiteExecutor) Query(ctx context.Context, dsInfo *models.DataSource,
 	span.SetTag("target", target)
 	span.SetTag("from", from)
 	span.SetTag("until", until)
+	span.SetTag("datasource_id", dsInfo.Id)
+	span.SetTag("org_id", dsInfo.OrgId)
+
 	defer span.Finish()
 
 	opentracing.GlobalTracer().Inject(

+ 1 - 0
public/app/core/components/help/help.ts

@@ -31,6 +31,7 @@ export class HelpCtrl {
         { keys: ['e'], description: 'Toggle panel edit view' },
         { keys: ['v'], description: 'Toggle panel fullscreen view' },
         { keys: ['p', 's'], description: 'Open Panel Share Modal' },
+        { keys: ['p', 'd'], description: 'Duplicate Panel' },
         { keys: ['p', 'r'], description: 'Remove Panel' },
       ],
       'Time Range': [

+ 2 - 0
public/app/core/utils/kbn.ts

@@ -447,6 +447,7 @@ kbn.valueFormats.currencyDKK = kbn.formatBuilders.currency('kr');
 kbn.valueFormats.currencyISK = kbn.formatBuilders.currency('kr');
 kbn.valueFormats.currencyNOK = kbn.formatBuilders.currency('kr');
 kbn.valueFormats.currencySEK = kbn.formatBuilders.currency('kr');
+kbn.valueFormats.currencyCZK = kbn.formatBuilders.currency('czk');
 
 // Data (Binary)
 kbn.valueFormats.bits = kbn.formatBuilders.binarySIPrefix('b');
@@ -869,6 +870,7 @@ kbn.getUnitFormats = function() {
         { text: 'Icelandic Króna (kr)', value: 'currencyISK' },
         { text: 'Norwegian Krone (kr)', value: 'currencyNOK' },
         { text: 'Swedish Krona (kr)', value: 'currencySEK' },
+        { text: 'Czech koruna (czk)', value: 'currencyCZK' },
       ],
     },
     {

+ 1 - 0
public/app/features/panel/metrics_panel_ctrl.ts

@@ -225,6 +225,7 @@ class MetricsPanelCtrl extends PanelCtrl {
     var metricsQuery = {
       timezone: this.dashboard.getTimezone(),
       panelId: this.panel.id,
+      dashboardId: this.dashboard.id,
       range: this.range,
       rangeRaw: this.range.raw,
       interval: this.interval,

+ 1 - 0
public/app/features/panel/panel_ctrl.ts

@@ -190,6 +190,7 @@ export class PanelCtrl {
         text: 'Duplicate',
         click: 'ctrl.duplicate()',
         role: 'Editor',
+        shortcut: 'p d',
       });
 
       menu.push({

+ 2 - 0
public/app/plugins/datasource/graphite/datasource.ts

@@ -50,6 +50,8 @@ export function GraphiteDatasource(instanceSettings, $q, backendSrv, templateSrv
       data: params.join('&'),
       headers: {
         'Content-Type': 'application/x-www-form-urlencoded',
+        'X-Dashboard-Id': options.dashboardId, // enables distributed tracing in ds_proxy
+        'X-Panel-Id': options.panelId, // enables distributed tracing in ds_proxy
       },
     };