Commit Graph

1031 Commits

Author SHA1 Message Date
ryan
fb9c714a9a run go fmt 2017-10-18 23:49:33 +02:00
ryan
4440133f4d Add a setting to allow DB queries 2017-10-18 23:33:10 +02:00
Alexander Zobnin
74e90d01ec Fixes for annotations API (#9577)
* annotations: throw error if no text specified and set default time to Now() if empty, #9571

* annotations: fix saving graphite event with empty string tags

* docs: add /api/annotations/graphite endpoint docs, #9571
2017-10-18 10:13:02 +02:00
bergquist
b5727949fd logging: dont use cli logger in http_server 2017-10-12 15:29:01 +02:00
bergquist
88f55b01d8 oauth: raise error if session state is missing
ref #9476
2017-10-12 15:25:27 +02:00
bergquist
0848ba2e9c oauth: provide more logging for failed oauth requests 2017-10-12 15:25:27 +02:00
Carl Bergquist
ee5f69beb4 metrics: disable gzip for /metrics endpoint (#9468)
Prometheus client lib support gzip by itself. Which caused the
response to be double gzipped sometimes. We should use the Grafana
middle ware instead.

closes #9464
2017-10-12 12:02:36 +02:00
Carl Bergquist
9d53653647 Merge pull request #9378 from mattbostock/verify_tls
Bugfix: Always verify TLS unless explicitly told otherwise
2017-10-12 11:11:02 +02:00
bergquist
4ca3cc90dd Merge branch 'mattbostock-verify_datasource_tls' 2017-10-12 10:39:07 +02:00
bergquist
c0d257a0ee Merge branch 'verify_datasource_tls' of https://github.com/mattbostock/grafana into mattbostock-verify_datasource_tls 2017-10-12 10:15:32 +02:00
Alexander Zobnin
04ea7efac9 annotations: add endpoint for writing graphite-like events (#9495)
* annotations: add endpoint for writing graphite-like events

* annotations: fix new line handling in tooltip

* annotations: support tags in prior to Graphite 0.10.0 format
2017-10-12 10:12:15 +02:00
Matt Bostock
a286ffa5f2 Alias macron package in app_routes.go
...to make this file compatible with goimports:
https://godoc.org/golang.org/x/tools/cmd/goimports
2017-10-11 08:18:03 +01:00
Daniel Lee
8423260f58 gzip: plugin readme content set explicitly
Macaron's gzip middleware tries to automatically figure out the content
type for a file when gzipped and seems to mostly fail with plugin
readmes. This change sets the content type to plain text.

Fixes #9344. Ref #5952.
2017-10-09 10:17:45 +02:00
Torkel Ödegaard
25aa9df270 Create annotations (#8197)
* annotations: add 25px space for events section

* annotations: restored create annotation action

* annotations: able to use fa icons as event markers

* annotations: initial emoji support from twemoji lib

* annotations: adjust fa icon position

* annotations: initial emoji picker

* annotation: include user info into annotation requests

* annotation: add icon info

* annotation: display user info in tooltip

* annotation: fix region saving

* annotation: initial region markers

* annotation: fix region clearing (add flot-temp-elem class)

* annotation: adjust styles a bit

* annotations: minor fixes

* annoations: removed userId look in loop, need a sql join or a user cache for this

* annotation: fix invisible events

* lib: changed twitter emoij lib to be npm dependency

* annotation: add icon picker to Add Annotation dialog

* annotation: save icon to annotation table

* annotation: able to set custom icon for annotation added by user

* annotations: fix emoji after library upgrade (switch to 72px)

* emoji: temporary remove bad code points

* annotations: improve icon picker

* annotations: icon show icon picker at the top

* annotations: use svg for emoji

* annotations: fix region drawing when add annotation editor opened

* annotations: use flot lib for drawing region fill

* annotations: move regions building into event_manager

* annotations: don't draw additional space if no events are got

* annotations: deduplicate events

* annotations: properly render cut regions

* annotations: fix cut region building

* annotations: refactor

* annotations: adjust event section size

* add-annotations: fix undefined default icon

* create-annotations:  edit event (frontend part)

* fixed bug causes error when hover event marker

* create-annotations:  update event (backend)

* ignore grafana-server debug binary in git (created VS Code)

* create-annotations: use PUT request for updating annotation.

* create-annotations: fixed time format when editing existing event

* create-annotations: support for region update

* create-annotations: fix bug with limit and event type

* create-annotations: delete annotation

* create-annotations: show only selected icon in edit mode

* create-annotations: show event editor only for users with at least Editor role

* create-annotations: handle double-sized emoji codepoints

* create-annotations: refactor

use CP_SEPARATOR from emojiDef

* create-annotations: update emoji list, add categories.

* create-annotations: copy SVG emoji into public/vendor/npm and use it as a base path

* create-annotations: initial tabs for emoji picker

* emoji-picker: adjust styles

* emoji-picker: minor refactor

* emoji-picker: refactor - rename and move into one directory

* emoji-picker: build emoji elements on app load, not on picker open

* emoji-picker: fix emoji searching

* emoji-picker: refactor

* emoji-picker: capitalize category name

* emoji-picker: refactor

move buildEmojiElem() into emoji_converter.ts for future reuse.

* jquery.flot.events: refactor

use buildEmojiElem() for making emojis, remove unused code for font awesome based icons.

* emoji_converter: handle converting error

* tech: updated

* merged with master

* shore: clean up some stuff

* annotation: wip tags

* annotation: filtering by tags

* tags: parse out spaces etc. from a tags string

* annotations: use tagsinput component for tag filtering

* annotation: wip work on how we query alert & panel annotations

* annotations: support for updating tags in an annotation

* linting

* annotations: work on unifying how alert history annotations and manual panel annotations are created

* tslint: fixes

* tags: create tag on blur as well

Currently, the tags directive only creates the tag when the
user presses enter. This change means the tag is created on
blur as well (when the user clicks outside the input field).

* annotations: fix update after refactoring

* annotations: progress on how alert annotations are fetched

* annotations: minor progress

* annotations: progress

* annotation: minor progress

* annotations: move tag parsing from tooltip to ds

Instead of parsing a tag string into an array in the annotation_tooltip
class, this moves the parsing to the datasources. InfluxDB ds already
does that parsing. Graphite now has it.

* annotations: more work on querying

* annotations: change from tags as string to array

when saving in the db and in the api.

* annotations: delete tag link if removed on edit

* annotation: more work on depricating annotation title

* annotations: delete tag links on delete

* annotations: fix for find

* annotation: added user to annotation tooltip and added alertName to annoation dto

* annotations: use id from route instead from cmd for updating

* annotations: http api docs

* create annotation: last edits

* annotations: minor fix for querying annotations before dashboard saved

* annotations: fix for popover placement when legend is on the side (and doubel render pass is causing original marker to be removed)

* annotations: changing how the built in query gets added

* annotation: added time to header in edit mode

* tests: fixed jshint built issue
2017-10-07 10:31:39 +02:00
Matt Bostock
83f1ae4e3e OAuth: Rename sslcli
Rename `sslcli` to the more descriptive `oauthClient`.
2017-10-06 17:10:03 +01:00
Matt Bostock
ccf093da81 OAuth: Separate TLS client auth and CA config
It should be specify to either use TLS client authentication or use a
user-supplied CA; previously you had to enable client authentication to
use a custom CA.
2017-10-06 17:10:03 +01:00
Matt Bostock
f2f8ca52d9 OAuth: Check both TLS client cert and key
If either is set, try to use them.

This should help avoid a situation where someone has half-configured TLS
client authentication and it doesn't work without raising an obvious
error.
2017-10-06 17:10:03 +01:00
Matt Bostock
16c5d0e4b7 Always verify TLS unless explicitly told otherwise
TLS was not being verified in a number of places:

- connections to grafana.com

- connections to OAuth providers when TLS client authentication was
  enabled

- connections to self-hosted Grafana installations when using the CLI
  tool

TLS should always be verified unless the user explicitly enables an
option to skip verification.

Removes some instances where `InsecureSkipVerify` is explicitly set to
`false`, the default, to help avoid confusion and make it more difficult
to regress on this fix by accident.

Adds a `--insecure` flag to `grafana-cli` to skip TLS verification.

Adds a `tls_skip_verify_insecure` setting for OAuth.

Adds a `app_tls_skip_verify_insecure` setting under a new `[plugins]`
section.

I'm not super happy with the way the global setting is used by
`pkg/api/app_routes.go` but that seems to be the existing pattern used.
2017-10-06 17:09:27 +01:00
Mitsuhiro Tanda
fe9fca381c move cloudwatch crendential related code 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
4f5f38f41b remove old handler 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
1dcc51adce re-implement dimension_values() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
78e3556e95 remove performEC2DescribeInstances() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
f66e1c02a6 remove obsolete GetMetricStatistics() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
f590db1b78 move test code 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
feed90c0e2 re-implement get regions 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
0c95148486 move the metric find query code 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
d31f264576 cache creds for keys/credentials auth type 2017-09-29 13:44:00 +09:00
Mitsuhiro Tanda
39607d09d7 (cloudwatch) alerting 2017-09-29 13:44:00 +09:00
Carl Bergquist
e9e8ffc769 Merge pull request #9367 from bobrik/dualstack
Enable dualstack in every net.Dialer, fixes #9364
2017-09-28 11:15:49 +02:00
Ivan Babrou
9a4ae30227
Enable dualstack in every net.Dialer, fixes #9364
Default transport enables it:

* https://github.com/golang/go/blob/d2826d3e06/src/net/http/transport.go#L42-L46

```
    DialContext: (&net.Dialer{
	Timeout:   30 * time.Second,
	KeepAlive: 30 * time.Second,
	DualStack: true,
    }).DialContext,
```

See also: https://github.com/golang/go/issues/15324
2017-09-27 22:29:48 -07:00
bergquist
8175783f93 go fmt 2017-09-24 18:59:21 +02:00
bergquist
c927209447 Merge branch 'master' of https://github.com/BrandonArp/grafana into BrandonArp-master 2017-09-24 18:56:46 +02:00
bergquist
ed661767f8 follow go idiom and return error as second param 2017-09-21 18:04:16 +02:00
bergquist
0229d28d64 remove unused structs 2017-09-21 15:02:17 +02:00
Carl Bergquist
0db678e18f Merge pull request #9213 from grafana/dist_tracing
Add support for distributed tracing with Jaeger
2017-09-21 10:42:25 +02:00
bergquist
4326790bb4 bug: enable HEAD requests again
ref #9307
2017-09-20 09:45:00 +02:00
Will Sewell
4a6da233d9 Add DbClusterIdentifier to CloudWatch dimensions (#9297)
Unfortunately CloudWatch dimensions are case-sensitive and it uses both `DBClusterIdentifier` and `DbClusterIdentifier` (notice the lower case `b`) depending on the metric. All metrics which also have the `Role` dimension appear to use `DBClusterIdentifier`, whereas metric with the `EngineName` dimension use `DbClusterIdentifier`.
2017-09-20 08:31:54 +02:00
bergquist
e3211f6e48 use route as span name 2017-09-18 11:08:58 +02:00
bergquist
ee2e4c6567 add trace headers for outgoing requests 2017-09-18 11:08:58 +02:00
bergquist
3c8133aa4b add traces for datasource reverse proxy requests 2017-09-18 11:08:58 +02:00
bergquist
2e350bbb8e adds basic traces using open traces 2017-09-18 11:08:58 +02:00
Torkel Ödegaard
24d69ca205 fix: jsonData should not be allowed to be null, fixes #9258 2017-09-18 09:38:02 +02:00
bergquist
314bff1b78 adds grafana_ prefix for none standard metrics 2017-09-14 14:26:32 +02:00
bergquist
9c30bf53cf introduce concept of named middleware 2017-09-14 14:26:32 +02:00
bergquist
4bc6ecb241 adds metric middlware to route register 2017-09-14 14:26:32 +02:00
bergquist
6372e22180 migrate handlers to new register 2017-09-14 14:26:32 +02:00
bergquist
f842265388 add custom route register 2017-09-14 14:26:32 +02:00
bergquist
bf138d1845 adds small docs page metrics 2017-09-14 14:26:32 +02:00
bergquist
6d22a67a30 return /metrics before session middleware 2017-09-14 14:26:32 +02:00
bergquist
2de94d6548 convert old metrics to prom metrics 2017-09-14 14:26:32 +02:00