Compare commits

...

4506 Commits

Author SHA1 Message Date
bergquist 9d916fdad6 changelog: adds note about closing #9516 2017-10-13 10:29:11 +02:00
bergquist ec14fa58b5 alerting: add count_non_null reducer
makes it possible to have a second condition requering
at least X points of data.
2017-10-13 09:47:10 +02:00
Carl Bergquist 8e4a7060ca Merge pull request #9515 from imweijh/patch-1
Update rpm.md
2017-10-13 08:54:19 +02:00
weijh d0ace0bc13 Update rpm.md
for error "The GPG keys listed for the "grafana" repository are already installed but they are not correct for this package."
2017-10-13 12:00:22 +08:00
Torkel Ödegaard 2992fb4b0e fix: can now remove annotation tags without popover closing 2017-10-12 16:24:32 +02:00
Alexander Zobnin 3b14bee559 tech: add backward compatibility for <spectrum-picker> directive (#9510) 2017-10-12 15:31:59 +02:00
Torkel Ödegaard e7b718ed7a fix: fixed links on new 404 page, fixes #9493 2017-10-12 15:31:41 +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
bergquist 23c610015f prepare for 4.6.0-beta1 release 2017-10-12 15:25:27 +02:00
Torkel Ödegaard 2564dda2d0 docs: updated whats new article 2017-10-12 14:53:29 +02:00
Patrick O'Carroll 1334a9e138 docs: initial draft release v46 2017-10-12 13:55:27 +02:00
Daniel Lee 4bdc3a5829 graph: fix y-axis decimalTick check. Fixes #9405 2017-10-12 12:45:20 +02:00
Torkel Ödegaard a7068d835a Merge branch 'master' of github.com:grafana/grafana 2017-10-12 12:40:43 +02:00
Torkel Ödegaard c879cc7615 minor docs update 2017-10-12 12:40:37 +02:00
Torkel Ödegaard a90052dac3 docs: annotation docs update 2017-10-12 12:19:25 +02:00
bergquist 7548734510 changelog: adds note about closing #7104 2017-10-12 12:13:00 +02:00
bergquist a45bd400f1 changelog: adds note about closing #9373 2017-10-12 12:11:51 +02:00
Carl Bergquist b63725033e Merge pull request #9450 from utkarshcmu/kafka_alert
Kafka alerting
2017-10-12 12:11:13 +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
Patrick O'Carroll 5895f9dc89 Annotation docs (#9506)
* added images to annotation docs

* added gifs and png to annotations, minor code formatting fix in alertlist
2017-10-12 11:37:42 +02:00
Torkel Ödegaard 98f00f7e1f Update CHANGELOG.md 2017-10-12 11:35:47 +02:00
Daniel Lee 55d510a319 Update PLUGIN_DEV.md 2017-10-12 11:32:33 +02:00
Daniel Lee b38016e97f Update PLUGIN_DEV.md 2017-10-12 11:31:04 +02:00
Torkel Ödegaard 64d75db514 Update README.md 2017-10-12 11:30:01 +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
Patrick O'Carroll 45704d4570 Fixed link issue in CHANGELOG 2017-10-12 10:56:24 +02:00
Torkel Ödegaard b81e01d1ec Create PLUGIN_DEV.md
initial draft of plugin dev document
2017-10-12 10:53:42 +02:00
bergquist 1f4df2b694 changelog: adds note about closing #9371,#5334,#8812 2017-10-12 10:44:40 +02:00
bergquist 4ca3cc90dd Merge branch 'mattbostock-verify_datasource_tls' 2017-10-12 10:39:07 +02:00
bergquist 79afd638bb ds_edit: placeholder should only be cert header 2017-10-12 10:38:45 +02:00
Patrick O'Carroll b76de790f9 fixed minor styling issus (#9497)
* fixed minor styling issus

* fixed code formatting
2017-10-12 10:33:42 +02:00
Torkel Ödegaard 81a4df1372 fix: alert api limit param did not work and caused SQL syntax error, fixes #9492 2017-10-12 10:22:53 +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
Carl Bergquist 19a57f7cb1 Merge pull request #9505 from PaulMest/you-to-your-typo
You to your typo
2017-10-12 08:49:58 +02:00
Paul Mestemaker 2f73208ca8 Update unsaved_changes_modal.ts 2017-10-11 15:57:33 -07:00
Paul Mestemaker e1d61c9678 Merge pull request #1 from grafana/master
Merging upstream
2017-10-11 15:55:05 -07:00
Torkel Ödegaard 2bc57d856c fix: set lastSeenAt date when creating users to then years in past insteasd of empty date, fixes #9260 2017-10-11 11:29:17 +02:00
Torkel Ödegaard 71a839deaf ux: minor ux fix 2017-10-11 11:17:54 +02:00
Matt Bostock 4f3856adfb Retain old name for TLS client auth
I renamed `tlsAuth` to `tlsClientAuth` to better describe the fact that
this variable is used to enable TLS client authentication (as opposed to
server authentication) in c04d95f35.

However, changing the name breaks backwards compatibility for existing
installations using this feature and Grafana does not have a
standardised way of migrating changes in the schema:
https://github.com/grafana/grafana/pull/9377#issuecomment-333063543

For reasons of expediency given the severity of the bug (not verifying
TLS), keep the old name.
2017-10-11 08:18:04 +01:00
Matt Bostock f6aa0e41e5 Return error if datasource TLS CA not parsed 2017-10-11 08:18:03 +01:00
Matt Bostock e23c678df9 Datasource settings: Make HTTP all caps
It's an acronym, so it should be all caps.
2017-10-11 08:18:03 +01:00
Matt Bostock 5d312be419 Datasource HTTP settings: Add TLS skip verify
In c04d95f35 I changed the default for datasource HTTP requests so that
TLS is always verified.

This commit adds a checkbox to allow an admin to explicitly skip TLS
verification, for testing purposes.
2017-10-11 08:18:03 +01:00
Matt Bostock ef52d956bf Make URL capitalisation consistent in UI
URL is an acronym, it should be all caps.
2017-10-11 08:18:03 +01: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
Matt Bostock 43169e4302 Verify datasource TLS and split client auth and CA 2017-10-11 08:18:03 +01:00
Matt Bostock 4719a8c8dd Tidy spacing in datasource TLS settings 2017-10-11 08:18:03 +01:00
Matt Bostock 592c46c8b5 Tests: Clarify what InsecureSkipVerify does 2017-10-11 08:18:03 +01:00
Daniel Lee 7713009caa postgres: add missing ngInject decorator 2017-10-11 09:15:55 +02:00
Torkel Ödegaard 05fbed4a36 docs: initial docs for new annotation features, #9483 2017-10-10 16:02:56 +02:00
Daniel Lee 679b169291 Adds note for #9209 to changelog 2017-10-10 15:23:22 +02:00
Daniel Lee d1c9760fa8 Postgres Data Source (#9475)
* add postgresql datasource

* add rest of files for postgres datasource

* fix timeseries query, remove unused code

* consistent naming, refactoring

* s/mysql/postgres/

* s/mysql/postgres/

* couple more tests

* tests for more datatypes

* fix macros for postgres

* add __timeSec macro

* add frontend for postgres datasource

* adjust documentation

* fix formatting

* add proper plugin description

* merge editor changes from mysql

* port changes from mysql datasource

* set proper defaultQuery for postgres

* add time_sec to timeseries query
accept int for value for timeseries query

* revert allowing time_sec and handle int or float values as unix
timestamp for "time" column

* fix tslint error

* handle decimal values in timeseries query

* allow setting sslmode for postgres datasource

* use type switch for handling data types

* fix value for timeseries query

* refactor timeseries queries to make them more flexible

* remove debug statement from inner loop in type conversion

* use plain for loop in getTypedRowData

* fix timeseries queries

* adjust postgres datasource to tsdb refactoring

* adjust postgres datasource to frontend changes

* update lib/pq to latest version

* move type conversion to getTypedRowData

* handle address types cidr, inet and macaddr

* adjust response parser and docs for annotations

* convert unknown types to string

* add documentation for postgres datasource

* add another example query with metric column

* set more helpful default query

* update help text in query editor

* handle NULL in value column of timeseries query

* add __timeGroup macro

* add test for __timeGroup macro

* document __timeGroup and set proper default query for annotations

* fix typos in docs

* add postgres to list of datasources

* add postgres to builtInPlugins

* mysql: refactoring as prep for merging postgres

Refactors out the initialization of the xorm engine and the query logic
for an sql data source.

* mysql: rename refactoring + test update

* postgres:refactor to use SqlEngine(same as mysql)

Refactored to use a common base class with the MySql data source.

Other changes from the original PR:
- Changed time column to be time_sec to allow other time units in the
future and to be the same as MySQL
- Changed integration test to test the main Query method rather than
the private transformToTable method
- Changed the __timeSec macro name to __timeEpoch
- Renamed PostgresExecutor to PostgresQueryEndpoint

Fixes #9209 (the original PR)

* postgres: encrypt password on config page

With some other cosmetic changes to the config page:
- placeholder texts
- reset button for the password after it has been encrypted.
- default value for the sslmode field.

* postgres: change back col name to time from time_sec

* postgres mysql: remove annotation title

Title has been removed from annotations

* postgres: fix images for docs page

* postgres mysql: fix specs
2017-10-10 15:19:14 +02:00
Torkel Ödegaard 630e6f5da6 tech: expose more to plugins, closes #9456 2017-10-10 15:07:09 +02:00
Alexander Zobnin 3184942aeb Fix NaN handling (#9469)
* graph: fix NaN formatting, #9012

* singlestat: prevent null value coloring, #9012, #8404

* timeseries: add tests for #9012 and move test file to TS
2017-10-10 14:25:57 +02:00
Alexander Zobnin 473c47cd1c snapshots: improve snapshot listing performance, #9314 (#9477)
exclude dashboard field from snapshot list search
2017-10-10 14:25:19 +02:00
Daniel Lee 002b4d3403 mysql: fix interpolation for numbers in temp vars 2017-10-10 11:59:44 +02:00
utkarshcmu 8aff343ce3 Added docs for Kafka alerting 2017-10-10 02:11:02 -07:00
utkarshcmu da47dc8947 Fixed failing go tests 2017-10-09 18:56:05 -07:00
utkarshcmu a562dc7c2b gofmt fixes 2017-10-09 18:27:04 -07:00
utkarshcmu 138bee99ef Added tests 2017-10-09 18:27:04 -07:00
utkarshcmu d60339a9b1 Kafka REST Proxy works with Grafana 2017-10-09 18:27:04 -07:00
Patrick O'Carroll 68829a821e added insrtuctions for oauth2 okta bitbucket (#9471) 2017-10-09 15:41:14 +02:00
Alexander Zobnin a174ad4c9a Unified Color picker fixes (#9466)
* colorpicker: fix opening error when color is undefined

* colorpicker: replace spectrum picker by new color picker

* colorpicker: remove old spectrum picker directive

* annotations: use tinycolor for working with region colors
2017-10-09 13:54:14 +02:00
Axel 6ce990af57 Show min interval query option for mixed datasource (#9467) 2017-10-09 12:56:34 +02: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
bergquist 5e4bbfb08e ignore pattern for vendored libs 2017-10-09 10:11:36 +02:00
Torkel Ödegaard 4814b05746 Merge branch 'master' of github.com:grafana/grafana 2017-10-09 07:24:28 +02:00
Torkel Ödegaard ec802dbc1f fix: escape metric segment auto complete, fixes #9423 2017-10-09 07:24:09 +02:00
Anton Hvornum 08dc08550c Corrected a PostgreSQL SELECT statement. (#9460)
At least in my Postgresql 9.6.5, the old syntax of capitalized queries doesn't work (Linux).<br>
Running with UTF-8 as standard encoding and the ` notations didn't work either, so removed those.
2017-10-08 20:37:16 +02:00
Torkel Ödegaard 9e61cacd16 tests: found the unhandled promise issue in the dash import tests 2017-10-08 15:56:42 +02:00
Torkel Ödegaard b228c23dbe testing: fixing tests 2017-10-07 22:05:31 +02:00
Torkel Ödegaard 3519d8d69b annotations: minor change to default/edit annotation color 2017-10-07 12:23:20 +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
Lucas Costa 43903d71ec fix: threshold's colors in table panels (#9445) (#9453) 2017-10-06 17:05:26 +02:00
Alexander Zobnin 5561a099b0 singlestat: fix sizing bug #9337 (#9448) 2017-10-06 13:41:39 +02:00
Torkel Ödegaard 7af4daf23b Revert "Fix coloring in singlestat if null value (#9438)" (#9443)
This reverts commit 213ba0377b.
2017-10-05 20:29:06 +02:00
Adrien Raffin-Caboisse 213ba0377b Fix coloring in singlestat if null value (#9438)
This modification aim to allow users to set value via textMapping and
these values to be used in background coloring as it text coloring.

This pull request closes #8404, but doesn't agree with #9012.
The issue #9012 consider that no coloring output should be put when
there is no data. I partially agree with this as I explicitely setted a
value in the textMapping I obviously want to treat `N/A` as a number.

`data.valueFormatted` contain the stringified version of `data.value`

If `Number()` cannot convert a string into a number a `NaN` value is
returned. So the code is still valid if the inputted value in
`data.valueFormatted` is not a number.
2017-10-05 20:26:28 +02:00
Torkel Ödegaard e42c118b3d fix: missing semicolon 2017-10-05 19:06:46 +02:00
Patrick O'Carroll d6b512478e changed jsontree to use jsonexplorer (#9416) 2017-10-05 19:01:23 +02:00
Patrick O'Carroll e951200404 docs page for authproxy (#9420) 2017-10-05 19:01:15 +02:00
Patrick O'Carroll 81be4e2612 Update codebox (#9430)
* updated the codeboxes in docs

* codebox change from json to http
2017-10-05 19:01:03 +02:00
Alexander Zobnin 19b5d91b75 Series color picker fix (#9442)
* colorpicker: fix spectrum color update on series color picker

* colorpicker: minor refactor
2017-10-05 18:34:12 +02:00
Carl Bergquist 9b34346f6b Merge pull request #9441 from genofire/patch-1
fix typo in readme
2017-10-05 17:38:33 +02:00
Geno 22cfb614bf fix type in readme 2017-10-05 17:34:13 +02:00
Carl Bergquist 6f4038e885 Merge pull request #9437 from Ijin08/table-column-styles
fixed layout for column options, changed dropdown for date format kep…
2017-10-05 17:18:15 +02:00
Patrick O'Carroll bb52f00d2d removed commented line 2017-10-05 16:29:01 +02:00
Carl Bergquist 7e432df511 Merge pull request #9439 from shabscan/patch-1
Fixed typo
2017-10-05 16:13:46 +02:00
bergquist 4cda9d0128 changelog: adds note about closing #9110 2017-10-05 16:13:03 +02:00
shabscan eb4a568240 Fixed typo 2017-10-05 10:11:57 -04:00
Carl Bergquist ab5bc1bf4a Merge pull request #9111 from eloo/feature/enhance_hipchat_card
Feature/enhance hipchat card
2017-10-05 16:11:04 +02:00
Joseph Weigl 6a030b2e8c Change empty string checks and improve logging 2017-10-05 16:00:55 +02:00
Carl Bergquist 6979dbd921 Merge pull request #9435 from alin-amana/fix_404_spelling
Fix spelling on 404 page.
2017-10-05 15:01:29 +02:00
bergquist 1590729a24 changelog: adds note about closing #9208 2017-10-05 15:00:12 +02:00
Carl Bergquist 8e4efeeece Merge pull request #9208 from mtanda/prometheus_ace_complete_improve_label_name_complete
(prometheus) support label name/value completion
2017-10-05 14:54:07 +02:00
Carl Bergquist 363ded6ec1 Merge pull request #9434 from Yuav/patch-1
Add Norwegian Krone currency
2017-10-05 14:34:16 +02:00
Alin Sinpalean 79feba0004 Fix spelling on 404 page. 2017-10-05 13:51:02 +02:00
Jon Skarpeteig 789473fd34 Lint fix 2017-10-05 13:46:42 +02:00
Jon Skarpeteig 7479c82687 Update kbn.js
Adding the other kr currencies not to offend any maintainers
2017-10-05 13:44:23 +02:00
Jon Skarpeteig 531586beba Add Norwegian Krone denominator for currency
See http://www.xe.com/symbols.php for currency symbols reference
2017-10-05 13:34:07 +02:00
Patrick O'Carroll 7a7e8c57d1 fixed layout for column options, changed dropdown for date format kept old code 2017-10-05 13:27:36 +02:00
Daniel Lee 0841eb94a8 build: add noUnusedLocals to tsc parameters 2017-10-05 11:37:00 +02:00
bergquist b6d09a3443 Merge branch 'go1.9.1' 2017-10-05 11:35:25 +02:00
bergquist eeb2e2c6c9 build: install go based on env variable 2017-10-05 11:35:14 +02:00
bergquist 15ece1da04 changes go version to 1.9.1 2017-10-05 11:35:14 +02:00
bergquist 69b0e63502 changelog: adds note about closing #9226 2017-10-05 11:16:40 +02:00
Carl Bergquist 32342926cf Merge pull request #9226 from alin-amana/adjust_interval_variable_with_min_step
Prometheus: Rework interval and step computation
2017-10-05 10:51:31 +02:00
bergquist 273c17f3f3 changelog: add note about closing #9429 2017-10-05 10:43:23 +02:00
Carl Bergquist 27ec5449d9 Merge pull request #9429 from s1061123/table_time_ms
Add milliseconds format in table panel's config
2017-10-05 10:41:16 +02:00
bergquist 70f102dad4 changelog: adds note about closing #9399 2017-10-05 10:02:42 +02:00
Carl Bergquist 6a20c28c8c Merge pull request #9399 from cglrkn/master
Update script to make it use OpsGenie's REST API
2017-10-05 09:56:27 +02:00
Cagla Arikan 5a3f32521e Fix formatting issue 2017-10-05 08:42:45 +03:00
Tomofumi Hayashi f8719efb67 Add milliseconds format in table panel's config
This changes introduce milliseconds format option in table panel
config GUI. Current grafana support milliseconds in time and
actually used at graph panel, however current table does not
provide the way to show milliseconds. This fix is to add format
in table panel to show milliseconds in table as well as graph.
2017-10-05 13:40:52 +09:00
Ricard Clau e4541a7fd1 support for s3 path (#9151) 2017-10-04 21:04:20 +02:00
Alin Sinpalean 9cf7a2d2ed Remove apparently unnecessary .flush() calls. 2017-10-04 16:23:24 +02:00
Joseph Weigl 7284db0e54 Fix empty message and toolong attribute names
Use default state message if no message is provided by the user
Slice attribute name to maximum of 50 chars
2017-10-04 16:07:13 +02:00
Alin Sinpalean 02d426a2d4 Merge branch 'master' into adjust_interval_variable_with_min_step 2017-10-04 15:30:38 +02:00
Alin Sinpalean 2276869efc Merge remote-tracking branch 'upstream/master' 2017-10-04 15:30:16 +02:00
Alin Sinpalean 080c46f835 Address review comments. 2017-10-04 15:30:07 +02:00
bergquist 0c31c7b106 changelog: add note about closing #7175 2017-10-04 10:42:34 +02:00
Carl Bergquist ba074062d6 Merge pull request #9392 from xginn8/slack_image_upload
adding support for token-based slack file.upload API call for posting images to slack
2017-10-04 10:29:15 +02:00
Daniel Lee 3c1beb1bdd plugin_loader: expose app_events to plugins 2017-10-04 09:41:22 +02:00
cglrkn 548bc6b7c4 Add the missing comma 2017-10-04 10:15:39 +03:00
Torkel Ödegaard be3c5d1355 colorpicker: refactoring the new unififed colorpicker, #9347 2017-10-04 07:56:41 +02:00
Alexander Zobnin 2aae2556a5 Unified colorpicker (#9347)
* colorpicker: initial picker with predefined palette and spectrum

* colorpicker: highlight selected color

* colorpicker: add onChange() callback

* colorpicker: replace singlestat picker by new one

* colorpicker: style tweak

* colorpicker: parse color on input blur

* colorpicker: sort palette by hue and lightness

* colorpicker: refactor, move colors sorting to 'app/core/utils/colors'

* tech: colorpicker - fix linter errors

* colorpicker: convert to React components

* colorpicker: fix spectrum import after moving to webpack

* colorpicker: minor refactor

* colorpicker: initial series color picker

* colorpicker: fix tests error
2017-10-04 07:15:23 +02:00
Dan Cech 7859d4ffca fix missing column headers in excel export (#9413) 2017-10-04 07:04:10 +02:00
Torkel Ödegaard 1af00f5209 build: remove clean plugin from dev build 2017-10-03 20:25:47 +02:00
Torkel Ödegaard 0831238420 build: fixed broken elastic unit test 2017-10-03 19:38:52 +02:00
Torkel Ödegaard a1b543aa35 shore: cleanup unused stuff in common.d.ts 2017-10-03 18:27:25 +02:00
cglrkn ef518f6ecd Build URL for close alert request differently 2017-10-03 15:13:05 +03:00
Patrick O'Carroll e1a86e63b8 some restyling (#9409) 2017-10-03 13:35:12 +02:00
Patrick O'Carroll dd83b67de5 Docs text fixes (#9408)
* styling changes and some text changes

* styling changes
2017-10-03 13:34:52 +02:00
Patrick O'Carroll 50e2f7e366 Checkbox fixes (#9400)
* fixing checkboxes

* deleted old file, fixed checkboxes

* minor change
2017-10-03 13:23:05 +02:00
Torkel Ödegaard 3dac77468b fix: ensure panel.datasource is null as default 2017-10-03 12:18:22 +02:00
Torkel Ödegaard 4c4564b138 plugibs: expose more to plugins 2017-10-03 11:02:40 +02:00
Matthew McGinn be0d471467 properly parse & pass upload image bool from config 2017-10-02 23:18:48 -04:00
Matthew McGinn 122e2b5c42 break out slack upload into separate function 2017-10-02 20:48:35 -04:00
Torkel Ödegaard a365719d3f tech: minor npm scripts update 2017-10-02 17:25:43 +02:00
Torkel Ödegaard 4cc878b56d build: fixed build 2017-10-02 17:10:23 +02:00
Torkel Ödegaard fa79be1f2d Merge branch 'ctide-day_rounding2' 2017-10-02 16:45:44 +02:00
Torkel Ödegaard a02cac2126 refactoring: minor refactoring of PR #8916 2017-10-02 16:45:25 +02:00
Torkel Ödegaard 42a0e9ebdf Merge branch 'day_rounding' of https://github.com/ctide/grafana into ctide-day_rounding2 2017-10-02 16:20:23 +02:00
cglrkn d8f6c73aab Update script to make it use OpsGenie's REST API
The script is making API calls to the deprecated OpsGenie Web API, we updated the script to make it use new OpsGenie's REST API.
2017-10-02 16:42:09 +03:00
Torkel Ödegaard d4e5a7d3f0 Merge branch 'master' of github.com:grafana/grafana 2017-10-02 15:30:50 +02:00
Torkel Ödegaard 503336bcd5 docs: minor docs fix 2017-10-02 15:30:37 +02:00
Torkel Ödegaard 03a88206a3 Merge branch 'master' of github.com:grafana/grafana 2017-10-02 15:30:14 +02:00
Torkel Ödegaard ae14655749 plugins: expose datemath to plugins as well, fixes zabbix plugin 2017-10-02 13:39:39 +02:00
Torkel Ödegaard c338d8250b build: minor webpack fix 2017-10-02 13:15:28 +02:00
Patrick O'Carroll bd348e16bb redesigned dashboard links settingd, fixed a misspelling in rows and added fixed width to buttons (#9397) 2017-10-02 13:04:48 +02:00
Torkel Ödegaard 010a29a42d Merge branches 'master' and 'master' of github.com:grafana/grafana 2017-10-02 10:56:12 +02:00
Torkel Ödegaard 38ae460f59 docs: updated building from source docs 2017-10-02 10:55:56 +02:00
bergquist cb0ded069a playlist: play and edit should use same width 2017-10-02 09:58:58 +02:00
Torkel Ödegaard f5e8a4069c docs: minor fixes for #9369 2017-10-02 09:02:58 +02:00
Torkel Ödegaard 1dea7dab2a shore: fixed html indentation, #9368 2017-10-02 08:51:45 +02:00
Torkel Ödegaard a22dded6fa Merge branch 'update-alert-lists' of https://github.com/Ijin08/grafana into Ijin08-update-alert-lists 2017-10-02 08:43:56 +02:00
Torkel Ödegaard 6bc6911293 tech: updated yarn.lock 2017-10-02 08:24:56 +02:00
Torkel Ödegaard fea741d7c2 shore: minor cleanup 2017-10-01 20:35:01 +02:00
Torkel Ödegaard 0c86241c5b Webpack (#9391)
* webpack poc, this is not going to work for plugins, dam

* tech: webpack and systemjs for plugins starting to work

* tech: webpack and systemjs combo starting to work

* tech: webpack + karma tests progress

* tech: webpack + karma progress

* tech: working on tests

* tech: webpack

* tech: webpack + karma, all tests pass

* tech: webpack + karma, all tests pass

* tech: webpack all tests pass

* webpack: getting closer

* tech: webpack progress

* webpack: further build refinements

* webpack: ng annotate fixes

* webpack: optimized build fix

* tech: minor fix for elasticsearch

* tech: webpack + ace editor

* tech: restored lodash move mixin compatability

* tech: added enzyme react test and upgraded to react v16

* tech: package version fix

* tech: added testdata to built in bundle

* webpack: sass progress

* tech: prod & dev build is working for the sass

* tech: clean up unused grunt stuff and moved to scripts folder

* tech: added vendor and manifest chunks, updated readme and docs

* tech: webpack finishing touches
2017-10-01 20:02:25 +02:00
Matthew McGinn 89ca4b247b fixing json for CI 2017-10-01 10:37:59 -04:00
Matthew McGinn 00726e93eb adding support for token-based slack file.upload API call for posting images to slack 2017-09-30 21:20:20 -04:00
bergquist f6cc741a6d changelog: adds note about closing #8479 2017-09-29 15:43:30 +02:00
Carl Bergquist 8a7f87b752 Merge pull request #9311 from ctrlok/ctrlok/pagerdutyinfo
Include triggering metrics to pagerduty alerts (pretty print)
2017-09-29 15:40:49 +02:00
bergquist 46cc1464c4 changelog: adds note about closing #8050 2017-09-29 13:40:07 +02:00
Carl Bergquist cabb21317f Merge pull request #8050 from mtanda/cloudwatch_alert
(cloudwatch) alerting
2017-09-29 13:36:36 +02:00
bergquist a8006ada1e changelog: adds note about closing #9386 2017-09-29 13:30:38 +02:00
Carl Bergquist 7d2b989459 Merge pull request #9386 from shanhuhai5739/master
add diff and pdiff for conditions
2017-09-29 13:16:03 +02:00
coral 68ed4d45fa change pdiff to percent_diff for conditions 2017-09-29 18:14:17 +08:00
Daniel Lee 992cc1b680 panel: rename label on csv export modal 2017-09-29 11:32:13 +02:00
coral 9e48d54465 add diff and pdiff for conditions 2017-09-29 17:20:02 +08:00
Carl Bergquist dd56c4b94b Merge pull request #9382 from yagonobre/master
add brazil currency
2017-09-29 10:30:22 +02:00
Mitsuhiro Tanda 5850ae51b1 fix, add targetContainsTemplate() 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda 8d6513a564 fix cloudwatch alert bug 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda 5e88177f28 add debug log 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda 468e8c13ee move extend statistics handling code to backend 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda 6c375ed2cb fix assume role 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda f3a2dc7c5f improve cloudwatch tsdb 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda a21f53cf82 refactor cloudwatch code 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda 59cdd4d8d2 remove obsolete code 2017-09-29 13:45:11 +09: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 e1fe15e094 fix annotation query 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda bf5268c0b4 fix time 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda d98d8a404f fix dimension convertion 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda c140d7aa06 re-implement annotation query 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda 8f3b060946 fix parameter format 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 17445e0c98 fix alert feature 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 8243ac39c2 fix parameter format 2017-09-29 13:44:01 +09:00
bergquist fe1d395d79 refactor cloudwatch to support new tsdb interface 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 4b34ff5b83 refactor cloudwatch frontend code 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda e4de6332de refactor cloudwatch frontend code 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda ea704306a0 fix test 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 1dcc51adce re-implement dimension_values() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda ec632bb9ed fix error message 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 78e3556e95 remove performEC2DescribeInstances() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 8fba6dcb0d re-implement ec2_instance_attribute() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda cf23734d7d re-implement ebs_volume_ids() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda e588b682fb import the change, https://github.com/grafana/grafana/pull/9268 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 36a537a3ce fix conflict 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda fa074249e4 fix test 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda f66e1c02a6 remove obsolete GetMetricStatistics() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 01d2aa8af0 fix test 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda f590db1b78 move test code 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 1d265e05c9 fix conflict 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda fe3d3bc384 porting other suggestion 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 62d84c1e14 (cloudwatch) move query parameter to 'parameters' 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda 110f157621 parse duration 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda c6607f3fa7 remove offset for startTime 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 83b79dd624 fix test 2017-09-29 13:44:00 +09:00
Mitsuhiro Tanda 728e96e134 fix invalid query filter 2017-09-29 13:44:00 +09:00
Mitsuhiro Tanda dcb5ea58ce count up metrics 2017-09-29 13:44:00 +09:00
Mitsuhiro Tanda 39607d09d7 (cloudwatch) alerting 2017-09-29 13:44:00 +09:00
Yago Nobre 9c026a8e04 add brazil currency 2017-09-28 14:18:14 -03:00
Torkel Ödegaard 73295ab3ed tech: upgrade of systemjs to 0.20.x working 2017-09-28 14:08:59 +02:00
Torkel Ödegaard 8950f57050 Merge branch 'master' of github.com:grafana/grafana 2017-09-28 13:06:44 +02:00
Torkel Ödegaard 9bfda72a55 tech: reverted to systemjs 2017-09-28 13:06:23 +02:00
Torkel Ödegaard 7aa753a25f tech: migrating elasticsearch to typescript 2017-09-28 12:52:39 +02:00
bergquist 4dea94791d changelog: add note about using golang 1.9 2017-09-28 11:53:01 +02:00
bergquist 7f6924ff13 change go version to 1.9 2017-09-28 11:22:13 +02:00
bergquist c94fa7015f changelog: adds note about closing #9367 2017-09-28 11:19:01 +02: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
Torkel Ödegaard 487c475a1e tech: systemjs upgrade 2017-09-28 10:37:33 +02:00
Patrick O'Carroll 0a65100eaf made a text-panel page, maybe we don't need it 2017-09-28 10:05:28 +02:00
Patrick O'Carroll 0d5540ca09 cleaned up html/sass and added final touches 2017-09-28 09:41:33 +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 2ec7bbb2bd jaeger: capitalize tracer name 2017-09-27 16:38:00 +02:00
bergquist 2ae74bf13d jaeger: logging improvement 2017-09-27 16:36:42 +02:00
Torkel Ödegaard 9ee343f33d tech: systemjs upgrade 2017-09-27 15:42:06 +02:00
Alin Sinpalean bb8849785a Have include intervalFactor in its calculation, so always equal to the step query parameter. 2017-09-27 14:20:51 +02:00
Alin Sinpalean 25a6ed8718 Merge remote-tracking branch 'upstream/master' into adjust_interval_variable_with_min_step 2017-09-27 11:37:14 +02:00
Alin Sinpalean 1543dc4234 Merge remote-tracking branch 'upstream/master' 2017-09-27 11:36:50 +02:00
bergquist 5373a6027c alertlist: toggle play/pause button
closes #9355
2017-09-27 10:49:39 +02:00
Patrick O'Carroll 8615912018 updated css and html for recent state changes for alert lists 2017-09-27 10:38:01 +02:00
chrisrd 0e5e2f3fb9 Fix export_modal message (#9353)
Remove duplicate "to", and "others" is plural not possessive.
2017-09-27 09:46:56 +02:00
Torkel Ödegaard eaefa3c1fa s3: minor fix for PR #9223 2017-09-27 09:43:32 +02:00
Torkel Ödegaard 50d82155ed Merge branch 'master' of https://github.com/williamjoy/grafana into williamjoy-master 2017-09-27 09:37:26 +02:00
Alin Sinpalean f25aeadf21 Resolve merge conflicts with remote/master. 2017-09-26 17:55:30 +02:00
Alin Sinpalean 7366d7eae0 Merge branch 'master' of git+ssh://github.com/alin-amana/grafana 2017-09-26 17:44:37 +02:00
bergquist 2ed753232f internal metrics: add grafana version 2017-09-26 15:25:44 +02:00
bergquist 0778f31828 changelog: adds note about closing 5765 2017-09-26 14:40:43 +02:00
Carl Bergquist da3aea5e0a Merge pull request #9186 from mtanda/prometehus_instant_query2
(prometheus) instant query support
2017-09-26 14:37:10 +02:00
Torkel Ödegaard 5b3e6e67ea Update latest.json 2017-09-26 11:58:37 +02:00
Torkel Ödegaard 7b42e13c79 typescript: stricter typescript option 2017-09-26 11:24:58 +02:00
bergquist ff108bd871 prom_docker: give targets correct job name 2017-09-25 08:55:54 +02:00
bergquist 3641e85233 testdata: add bucket scenarios for heatmap
these scenarios makes it easier debug panels based
on the same numbers without sharing datasource

ref #9332
2017-09-24 22:08:28 +02:00
bergquist 7eec60ec2e dev-docker: add grafana as target 2017-09-24 21:58:33 +02:00
Carl Bergquist dd7f42ba03 changelog: add note ablout closing #9319 2017-09-24 21:46:51 +02:00
Carl Bergquist 9aa4f5c42a Merge pull request #9341 from thz/smtp_ehlo_identity
introduce smtp config option for EHLO identity
2017-09-24 21:41:57 +02:00
Tobias Hintze af79d046db introduce smtp config option for EHLO identity 2017-09-24 20:48:20 +02:00
bergquist 3fac31e808 changelog: note about closing #9250 2017-09-24 19:02:25 +02: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
Patrick O'Carroll 3f1452fddb new page for text, needs more work 2017-09-22 17:14:39 +02:00
Patrick O'Carroll 1258dc1cbb replaced img in graph, created alert list page 2017-09-22 16:31:34 +02:00
Torkel Ödegaard ca0085f429 docs: update docs 2017-09-22 14:05:25 +02:00
Torkel Ödegaard a98124add7 Update CHANGELOG.md 2017-09-22 13:30:23 +02:00
bergquist ae249a623d changelog: adds note about closing #5873 2017-09-22 13:17:09 +02:00
Carl Bergquist 63f78c0b59 Merge pull request #9299 from seuf/grafana-cli-plugin-url
Added --pluginUrl option to grafana-cli for local network plugin inst…
2017-09-22 13:13:17 +02:00
Carl Bergquist 632ae0986c Merge pull request #9320 from xiahuibing/patch-1
Update _navbar.scss
2017-09-22 13:06:11 +02:00
Patrick O'Carroll 31243e7132 replaced image 2017-09-22 12:53:37 +02:00
Patrick O'Carroll 367acc37c7 Docs new updates (#9324)
* replaced images, updating text(not finished)

* text uppdates for dashlist and singlestat(+img). updated the keyboard shortcuts

* deleted old shortcuts instruction

* another img update
2017-09-22 10:49:47 +02:00
Torkel Ödegaard e695ce4aa5 Update CHANGELOG.md 2017-09-22 10:33:03 +02:00
Torkel Ödegaard dd0f4460cb Update latest.json 2017-09-22 10:08:56 +02:00
Torkel Ödegaard f22d1af9e0 cleanup: removed unused file 2017-09-22 10:07:22 +02:00
Torkel Ödegaard c0c86c1138 tech: remove bower and moved remaining bower dependencies to npm 2017-09-22 09:47:25 +02:00
Torkel Ödegaard 6aad2a5b2d tech: cleanup and fixed build issue 2017-09-21 21:12:49 +02:00
Torkel Ödegaard f0e0e61809 tech: upgraded angularjs and moved dependency from bower to npm, closes #9327 2017-09-21 20:58:32 +02:00
bergquist ed661767f8 follow go idiom and return error as second param 2017-09-21 18:04:16 +02:00
Torkel Ödegaard 79b873e40e Merge branch 'stricter-ts-lint-rules' 2017-09-21 17:34:47 +02:00
Torkel Ödegaard 8fe21b43e9 tech: updated tsconfig 2017-09-21 17:34:22 +02:00
Daniel Lee 53d862143b docker: adds alertmanager to prometheus fig
with an alert rule that will always fire
2017-09-21 17:28:31 +02:00
Torkel Ödegaard 491fa6cad8 tech: more tslint rules 2017-09-21 17:23:31 +02:00
Patrick O'Carroll bf88242282 another img update 2017-09-21 16:58:25 +02:00
Torkel Ödegaard b8d9722b4f tech: removing unused variables from typescript files, and making tslint rules more strict 2017-09-21 16:40:18 +02:00
Patrick O'Carroll f6aefbd361 deleted old shortcuts instruction 2017-09-21 16:18:24 +02:00
Patrick O'Carroll fe05a996b7 text uppdates for dashlist and singlestat(+img). updated the keyboard shortcuts 2017-09-21 15:58:19 +02:00
bergquist a45e2ec9c3 context is reserved for go's context 2017-09-21 15:23:34 +02:00
bergquist 16b5b9f6be make ds a param for Query 2017-09-21 15:09:14 +02:00
bergquist c0260fd913 remove batch abstraction 2017-09-21 15:02:17 +02:00
bergquist 7f9f388293 rename executor into tsdbqueryendpoint 2017-09-21 15:02:17 +02:00
bergquist 0229d28d64 remove unused structs 2017-09-21 15:02:17 +02:00
bergquist 55f1b36e31 refactor response flow 2017-09-21 15:02:17 +02:00
Torkel Ödegaard adda84d124 tech: removed test component 2017-09-21 14:05:24 +02:00
Torkel Ödegaard 837beda155 Merge branch 'react-poc' 2017-09-21 13:59:26 +02:00
Torkel Ödegaard 9500eb8aaa ux: minor singlestat update 2017-09-21 13:59:21 +02:00
Torkel Ödegaard 1887c4f279 singlestat: minor change 2017-09-21 13:59:21 +02:00
Torkel Ödegaard 01fc37571e Update CHANGELOG.md 2017-09-21 13:58:48 +02:00
Patrick O'Carroll de17dcf3b0 Singlestat time (#9298)
* Added a timestamp option to single stat

* can now choose last time as value

* Finished last_time so it formats correctly, updated value stat

* fixed som issues, but still issue with testing

* Clean up after fake clock in test

* timezone-issue fix, fake time for from now test

* fix for timedifference
2017-09-21 13:34:51 +02:00
Torkel Ödegaard fed35909cc tech: progress on react poc 2017-09-21 13:32:57 +02:00
bergquist f1036a9382 adds note about closing #9213 2017-09-21 10:46:59 +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
xiahuibing 416510773b Update _navbar.scss
line66 and line118 :  "min-height:: $navbarHeight;" has double “:”
2017-09-21 16:40:49 +08:00
Patrick O'Carroll ece6588c03 replaced images, updating text(not finished) 2017-09-21 09:40:58 +02:00
Gordon McGuire 5e013f82b4 fix: close for 'Unsaved Changes' modal, #9284 (#9313)
Missing reference to the controller instance.
2017-09-21 09:05:59 +02:00
Alexander Zobnin f8b8907cc4 Initial graphite tags support (#9239)
* graphite: initial seriesByTag() support

* graphite: groupByTags() function

* graphite: aliasByTags() function

* graphite: fix optional params update, issue #9238

* graphite: fix tag-related functions version

* graphite: add 1.1.x version to config

* graphite: fix seriesByTag() series parsing
2017-09-21 08:22:56 +02:00
Torkel Ödegaard 84b1519480 tech: initial react poc 2017-09-20 17:44:23 +02:00
Vsevolod Polyakov d355862328 Make details more clean in PD description 2017-09-20 13:03:18 +03: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
Alexander Zobnin fdec9a4daf templating: fix dependent variable updating (#9306) 2017-09-19 20:35:48 +02:00
tamayika bef4b9b3b0 Fix adhoc filters restoration (#9303) 2017-09-19 14:25:35 +02:00
Andreas Kohn 3b565dccd8 Explicitly refer to Github 'OAuth' applications
A 'Github Application' is now something else, and will not work with Grafana.
2017-09-19 13:21:15 +02:00
William 88a8991722 config bucket and region for s3 uploader
this is to support cn-north-1 region as it can get s3 url programatically.
also keeps support 'bucket_url' for backward compatiblity
2017-09-19 04:57:25 -04:00
bergquist 13e8eb6d2e Merge branch 'v4.5.x' 2017-09-19 08:34:44 +02:00
bergquist fe3c6ac355 fixes bug introduced with prom namespaces
ref #9279
2017-09-19 08:16:23 +02:00
Matthew McGinn 2840968861 fixing spelling of millesecond -> millisecond 2017-09-19 07:20:14 +02:00
Matthew McGinn 3a7ed2305d fixing spelling of millesecond -> millisecond 2017-09-19 06:14:43 +02:00
Aaron Kirkbride 442f625a4e Remove duplicate bus.AddHandler() (#9289)
`bus.AddHandler("sql", SetUsingOrg)` is already called on line 24.

Very minor change.
2017-09-18 15:52:15 +02:00
Torkel Ödegaard 5f6de33487 Update CHANGELOG.md 2017-09-18 15:21:00 +02:00
bergquist 353bb57a6f use same key as mt 2017-09-18 14:59:59 +02:00
bergquist 6c7454fc2b tag alert queries that return no_data 2017-09-18 14:53:30 +02:00
Patrick O'Carroll d6725d4fbe updated error page html+css, added ds_store to ignore (#9285) 2017-09-18 14:04:55 +02:00
deep-42-thought 5749489e7e public/app/plugins/panel/graph/specs/graph_specs.ts: relax tests to be "within" instead of "equal", so they won't fail on i686 (#9286) 2017-09-18 14:03:54 +02:00
Sven Nierlein d0ddf76730 Fix path to icon (#9276)
grafana_mask_icon.svg is located in the img/ folder.
2017-09-18 12:54:20 +02:00
bergquist 915412754c Merge branch 'v4.5.x' 2017-09-18 12:35:02 +02:00
bergquist 6d901fe145 adds note about fix in v4.5.2 2017-09-18 12:29:32 +02:00
bergquist 0a8a6fd872 skip NaN values when writing to graphite
ref #9279
2017-09-18 12:25:37 +02:00
Andrew Prokhorenkov 00b18a8aea addded mass units, #9265 (#9273) 2017-09-18 11:13:56 +02:00
Ryan Patterson a20c419583 Fully fill out nulls in cloudfront data source (#9268)
Summary:
Previously, cloudwatch data sources would only fill in a single null value if
there was missing data. This results in behavior described in #9267. This
resolves that issue by filling the entire missing period with null values. The
null values can then be interpreted as normal by the graphing frontend.

Test Plan:
Used on a data source that had missing data for many consecutive periods.
Ensured that the graph remained at 0 across the entire window.
2017-09-18 11:12:52 +02:00
bergquist bcf784375b make it possible to configure sampler type 2017-09-18 11:08:58 +02:00
bergquist 861843f4ca mark >=400 responses as error 2017-09-18 11:08:58 +02:00
bergquist 83ddd2b158 change port for jaeger dev container 2017-09-18 11:08:58 +02:00
bergquist f211455643 logwrapper for jaeger 2017-09-18 11:08:58 +02:00
bergquist f37a595f68 make samplerconfig.param configurable 2017-09-18 11:08:58 +02:00
bergquist ec29b469e4 adds custom tags from settings 2017-09-18 11:08:58 +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 98c84f9458 docker file for running jaeger 2017-09-18 11:08:58 +02:00
bergquist bc678899f7 better formating for error trace 2017-09-18 11:08:58 +02:00
bergquist d55b49b7b7 attach context with span to *http.Request 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 8c8fdadb78 trace failed executions 2017-09-18 11:08:58 +02:00
bergquist e128310045 use tags instead of logs 2017-09-18 11:08:58 +02:00
bergquist 89c86c7a22 use opentracing ext package when possible 2017-09-18 11:08:58 +02:00
bergquist 935dad653c set example port to zipkin default 2017-09-18 11:08:58 +02:00
bergquist e84ff24833 adds codahale to vendor 2017-09-18 11:08:58 +02:00
bergquist a234e894bb makes jaeger tracing configurable 2017-09-18 11:08:58 +02:00
bergquist f160ad3bc8 add trace parameters for outgoing 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
bergquist 2ac6e23fc5 Merge branch 'invalid_panel_data' 2017-09-18 10:36:17 +02:00
bergquist 89eda76f29 require dashboard panels to have id
closes #9234
2017-09-18 10:32:58 +02:00
Torkel Ödegaard a687a6605d Merge branch 'v4.5.x' 2017-09-18 09:40:00 +02:00
Torkel Ödegaard 24d69ca205 fix: jsonData should not be allowed to be null, fixes #9258 2017-09-18 09:38:02 +02:00
Torkel Ödegaard 7a80a6627a Merge branch 'reduce-package-size' 2017-09-18 09:09:38 +02:00
Torkel Ödegaard a081f90403 Merge branch 'master' of github.com:grafana/grafana 2017-09-18 09:08:42 +02:00
Torkel Ödegaard d99c873221 packaging: reduce package size 2017-09-18 09:02:45 +02:00
ParadoxalManiak c94f5b456a Update upgrading.md (#9263)
Fixed some minor writing issues.
2017-09-15 22:15:12 +02:00
THIERRY SALLE e978bfc368 Added --pluginUrl option to grafana-cli for local network plugin installation 2017-09-15 20:34:08 +02:00
bergquist 67469e1809 adds note about closing #1395 2017-09-15 17:26:48 +02:00
Andrew Prokhorenkov 8cdf12b694 add locale format 2017-09-15 17:26:18 +02:00
bergquist 114ba801b9 update changelog 2017-09-15 16:25:17 +02:00
bergquist 87308fd97f fixes broken tests 💥 2017-09-15 16:11:02 +02:00
bergquist 16b1c0e63e minor code adjusetments 2017-09-15 16:11:02 +02:00
bergquist c7698a09ed pass context to image uploaders 2017-09-15 16:11:02 +02:00
bergquist d0ab028cfc remove unused deps 2017-09-15 16:11:02 +02:00
Konstantin Chukhlomin 7e3c9fcc1c Reduced OAuth scope to read_write 2017-09-15 16:11:02 +02:00
Konstantin Chukhlomin fcdf282090 GCS support via JSON API 2017-09-15 16:11:02 +02:00
Konstantin Chukhlomin 1188f8df73 gofmt fixes 2017-09-15 16:11:02 +02:00
Konstantin Chukhlomin 72d7c4d620 Added GCS support #8370 2017-09-15 16:11:02 +02:00
bergquist 93cff1a42a move more known datasources from others 2017-09-15 14:26:29 +02:00
Alexander Zobnin 54f0650321 Remove alert thresholds on panel duplicate, issue #9178 (#9257) 2017-09-15 13:34:31 +02:00
Daniel Lee f534ea057c 4.5.1 docs + update version to 5.0.0-pre1 2017-09-15 11:27:16 +02:00
Daniel Lee 3aed6595c7 Merge branch 'v4.5.x' 2017-09-15 11:10:55 +02:00
Daniel Lee 085245f97d publish_both.sh update for 4.5.1 2017-09-15 11:09:48 +02:00
Daniel Lee c114c46119 update version to 4.5.1 2017-09-15 10:05:51 +02:00
Torkel Ödegaard 9fdecb320c Merge branch 'master' of github.com:grafana/grafana 2017-09-15 10:00:17 +02:00
Torkel Ödegaard 7cac2e1817 Merge branch 'v4.5.x' 2017-09-15 09:59:44 +02:00
Torkel Ödegaard bbe191a975 graphite: do not show error for cancelled requests, fixes #9249 2017-09-15 09:59:23 +02:00
Torkel Ödegaard c532c8640b Update CHANGELOG.md 2017-09-15 09:17:44 +02:00
Torkel Ödegaard 0107f1eddb docs: updated changelog 2017-09-14 20:34:23 +02:00
Torkel Ödegaard f8326c29f9 mysql: fix query editor not showing issue, fixes #9247 2017-09-14 20:30:01 +02:00
bergquist 491e6897e7 metrics: set summary unit
we have to use milleseconds since graphite
doesnt support float64
2017-09-14 19:28:54 +02:00
Alin Sinpalean 719151b9cb Merge remote-tracking branch 'upstream/master' 2017-09-14 19:25:54 +02:00
Andrew Prokhorenkov 5b74bea476 add Ukrainian hryvnia sign 2017-09-14 19:06:25 +02:00
Torkel Ödegaard 210df23430 packaging: reducing package size be only including public vendor stuff we need 2017-09-14 17:33:58 +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 c177a9a77a make bridge prefix backwards compatible 2017-09-14 14:26:32 +02:00
bergquist 6d22a67a30 return /metrics before session middleware 2017-09-14 14:26:32 +02:00
bergquist 6b1ae1a8a8 use internal init for settings 2017-09-14 14:26:32 +02:00
bergquist dd9d4ecfbe update stat gauges first run to avoid gaps 2017-09-14 14:26:32 +02:00
bergquist fca80ff525 add support for deltas in histogram and summaries 2017-09-14 14:26:32 +02:00
bergquist 2de94d6548 convert old metrics to prom metrics 2017-09-14 14:26:32 +02:00
bergquist 788f677ed7 remove old internal metrics lib 2017-09-14 14:26:32 +02:00
bergquist d6b8c6a2d2 add graphite bridge that support delta counters 2017-09-14 14:26:32 +02:00
Torkel Ödegaard c1ef89d3bf Update CHANGELOG.md 2017-09-14 11:55:44 +02:00
Torkel Ödegaard aa24839ac9 Update CHANGELOG.md 2017-09-14 11:55:07 +02:00
Torkel Ödegaard a5c08a72fb docs: update download links 2017-09-14 11:28:59 +02:00
Patrick O'Carroll 337fb9bdfa fixed some images (#9237) 2017-09-14 11:04:01 +02:00
Torkel Ödegaard 512535e8ff release: bumped version to v4.5.0 stable 2017-09-14 10:51:21 +02:00
Torkel Ödegaard 4e719aa0c1 docs: minor update 2017-09-14 10:50:34 +02:00
Brandon Arp cffbcb504d allow ssl renegotiation for datasources 2017-09-13 16:20:24 -07:00
Daniel Lee 29de6387cb plugins: add styles for ol tags in markdown 2017-09-13 17:13:53 +02:00
Torkel Ödegaard a76f3fba2e docs: minor fixes to images 2017-09-13 17:11:10 +02:00
Patrick O'Carroll d71456b96f Docs image updates (#9225)
* replaced old images and gifs with new ones

* replaced images, changed some text especially for column styles

* replaced and added images and gifs
2017-09-13 16:29:53 +02:00
Torkel Ödegaard 85bd1861d6 fix: improve behavior when switching back and forth between x-axis modes, fixes #9229 2017-09-13 14:38:22 +02:00
Torkel Ödegaard 1a53d6453b Merge branch 'v4.4.x' 2017-09-13 10:02:04 +02:00
Torkel Ödegaard 10f058036c Merge branch 'master' of github.com:grafana/grafana 2017-09-13 09:48:56 +02:00
Torkel Ödegaard 73248d6687 fixes for metrics tab when data source was not found 2017-09-13 09:48:50 +02:00
Mitsuhiro Tanda 5bdd554671 check args for query 2017-09-13 16:34:28 +09:00
Mitsuhiro Tanda 6bf8144793 add test for completer 2017-09-13 16:34:28 +09:00
Mitsuhiro Tanda 1a5e786467 fix 2017-09-13 16:34:28 +09:00
Mitsuhiro Tanda 56c0d91ee5 follow token name change 2017-09-13 16:34:28 +09:00
Mitsuhiro Tanda d530ccff1c (prometheus) support label value completion 2017-09-13 16:34:28 +09:00
Mitsuhiro Tanda 40b74e6664 (prometheus) support label name completion 2017-09-13 16:34:28 +09:00
Mitsuhiro Tanda b349b3ef55 provide ace editor for external datasource plugin (#9224) 2017-09-13 09:29:53 +02:00
William 37962216ed get s3 url via aws-sdk-go, fix #9189 2017-09-12 21:52:40 -04:00
Alin Sinpalean 7a7837f47e Merge remote-tracking branch 'upstream/master' 2017-09-12 21:57:32 +02:00
Alin Sinpalean 2a62374a61 Prometheus: Rework the interaction between auto interval (computed based on graph resolution), min interval (where specified, per query) and intervalFactor (AKA resolution, where specified, per query).
As a bonus, have  and  reflect the actual interval (not the auto interval), taking into account min interval and Prometheus' 11k data points limit.
2017-09-12 16:36:27 +02:00
Torkel Ödegaard dd67c9d420 Merge branch 'master' of github.com:grafana/grafana 2017-09-12 11:36:47 +02:00
Torkel Ödegaard 968ba30fa5 ux: increased code editor auto complete width from 320px to 550px, fixes #9203 2017-09-12 11:36:30 +02:00
Daniel Lee 379f984293 docs: windows - add note about ini comments 2017-09-12 11:08:28 +02:00
Torkel Ödegaard 3c16230158 prometheus: added completer unit test, #9208 2017-09-12 11:05:32 +02:00
Torkel Ödegaard fd76c855f9 Merge branch 'master' of github.com:grafana/grafana 2017-09-12 10:32:02 +02:00
Torkel Ödegaard e16cadaa27 docs: minor update 2017-09-12 10:31:53 +02:00
Daniel Lee 665fef0114 docs: kiosk mode options add to playlist doc 2017-09-12 10:31:13 +02:00
Daniel Lee ff4cd1aef6 influxdb: small css fix for order by in query editor 2017-09-12 09:24:54 +02:00
Torkel Ödegaard 0e18c82d95 style: corrected indentation in sass file 2017-09-12 09:21:17 +02:00
Patrick O'Carroll a7b0a01b13 replaced old images and gifs with new ones (#9217) 2017-09-12 09:07:36 +02:00
Torkel Ödegaard 18cfe1b192 Merge branch 'master' of github.com:grafana/grafana 2017-09-12 09:05:47 +02:00
Torkel Ödegaard f6100dd8eb ux: success/error alerts refactoring, #9214 2017-09-12 09:05:32 +02:00
bergquist ee4bbf61a9 remove node restriction from package.json
yarn requires correct node version in package.json
and wont install with 4.x. removing since we dont
care about it.
2017-09-12 08:15:48 +02:00
Torkel Ödegaard 7164183739 Merge branch 'master' of github.com:grafana/grafana 2017-09-12 08:01:51 +02:00
Patrick O'Carroll 90602942f5 New alert design (#9214)
* ux: updated alert design

* fixed bg-color for alerts

* more changes to alerts, index fixed
2017-09-12 08:01:44 +02:00
Torkel Ödegaard 6e344f6eea api: tsdb api orgId fix 2017-09-12 08:01:34 +02:00
bergquist 057b8a6b2d improve error message for timeouts
closes #9220
2017-09-11 20:07:57 +02:00
Torkel Ödegaard e5f84484eb prometheus: another prometheus syntax highlight fix, #9212, #9167 2017-09-11 16:36:53 +02:00
Alexander Zobnin b1580bf385 ace: fix braces highlight in prometheus (#9212) 2017-09-11 15:49:15 +02:00
Torkel Ödegaard 293daf2ca1 fix: removed text option from text panel edit options, was by mistake not removed from settings dropdown, fixes #9204 2017-09-11 10:45:00 +02:00
Mitsuhiro Tanda f5a17e535b minor fix 2017-09-11 13:11:45 +09:00
Torkel Ödegaard 75c4c4d8b5 fix: query ctrl unit tests now pass as before 2017-09-08 13:52:28 +02:00
Torkel Ödegaard 2953d64429 prometheus: minor update to focus editor PR, #9201 2017-09-08 11:43:29 +02:00
Torkel Ödegaard 4b851de648 Merge branch 'prom_give_focus' of https://github.com/mtanda/grafana into mtanda-prom_give_focus 2017-09-08 10:55:50 +02:00
Alin Sinpalean 1076b75a21 Fix rounding of intervals (#9197)
* Prometheus: Fix actual step computation logic when a min_step is specified and the range is longer than min_step * 11000.

* Fix kbn.round_interval for exact intervals.

* Remove redundant 1d return, fix a couple of comments.

* Be more cautious with values close to 1d not rounding up to 1d. They may, because of the way the calculation uses 2 potentially different current time values.
2017-09-08 10:37:57 +02:00
Daniel Lee b1506a2b09 securejson: decrypt should not modify src
When decrypting a source securejson byte array, should not
modify the source and now passes back a new dest byte array.
2017-09-08 10:19:07 +02:00
Mitsuhiro Tanda e13575eaef add AWS/NATGateway metrics (#9202) 2017-09-08 09:04:15 +02:00
Mitsuhiro Tanda 7c566a6539 fix to focus first query 2017-09-08 12:33:36 +09:00
Mitsuhiro Tanda d971eddc7a copy from give-focus 2017-09-08 11:49:44 +09:00
Mitsuhiro Tanda ce0de35a6c set give focus in code editor 2017-09-08 11:49:41 +09:00
Alin Sinpalean 13eb0c1ece Fix kbn.round_interval for exact intervals. 2017-09-07 22:14:37 +02:00
Alin Sinpalean 567e877b9e Merge remote-tracking branch 'upstream/master' 2017-09-07 20:26:28 +02:00
Mitsuhiro Tanda 6f8110956d (prometheus) support instant query for table format, use checkbox to switch query type 2017-09-08 01:15:07 +09:00
Torkel Ödegaard 93be16b106 docs: minor docs update 2017-09-07 16:55:36 +02:00
Torkel Ödegaard 8ec33574a1 docs: added v4.4 to docs archive 2017-09-07 16:44:41 +02:00
Patrick O'Carroll de647c4100 docs: uppdated getting started with images and text, added info on query inspector to version45 and trouble shooting (#9193) 2017-09-07 16:32:55 +02:00
bergquist 51d021a337 reduce readme to be about the code 2017-09-07 16:08:38 +02:00
bergquist 7dc6d67d46 adds note about closing #8876 2017-09-07 14:29:25 +02:00
Carl Bergquist 62979916ad Merge pull request #8876 from mtanda/shortcut_new_dashboard
add new dashboard shortcut
2017-09-07 14:26:05 +02:00
Carl Bergquist 4670c74942 Merge pull request #9022 from adriangarza/master
added CloudWatch data source API documentation
2017-09-07 14:10:53 +02:00
Torkel Ödegaard c9a30ef149 build: fixed broken build 2017-09-07 13:05:26 +02:00
Carl Bergquist 9dac602e98 Merge pull request #9191 from wgliang/master
Optimize some wrong usage and spelling
2017-09-07 12:04:45 +02:00
wangguoliang 652fce7e76 Optimize some wrong usage and spelling
Signed-off-by: wgliang <liangcszzu@163.com>
2017-09-07 17:50:11 +08:00
Mitsuhiro Tanda 56cb16ff5b (prometheus) instant query support 2017-09-07 18:03:53 +09:00
Mitsuhiro Tanda e98254e1e3 show only label name in label matcher (#9167) 2017-09-07 10:10:52 +02:00
Mitsuhiro Tanda 4446e95155 (prometheus) cache metric suggest query result (#9182)
* (prometheus) cache metric suggest query result

* add test
2017-09-07 10:09:59 +02:00
Alin Sinpalean 5d4b8b5a5c Have 'Hide series with only zeros' ignore nulls (#9179)
* Prometheus: Fix actual step computation logic when a min_step is specified and the range is longer than min_step * 11000.

* Have the 'Hide series with only zeros' option also apply to series with some null values.
2017-09-06 16:50:55 +02:00
Patrick O'Carroll 095ac80d19 docs: updated image in docs (#9184) 2017-09-06 16:31:17 +02:00
Torkel Ödegaard 9451e6af39 Merge branch 'master' of github.com:grafana/grafana 2017-09-06 14:20:53 +02:00
Alin Sinpalean 24a165662c Merge remote-tracking branch 'upstream/master' 2017-09-06 09:51:13 +02:00
Torkel Ödegaard 82d365bdb8 fix: graph right y label is now correctly possitioned, fixes #9172 2017-09-05 21:57:32 +02:00
Sergey Korobov ec64dc8fae Fix sortByName and percentileOfSeries in gfunc.js (#9169)
Fixing type of parameters from "select" to "boolean" for working with carbonapi (like it was done in summarize function) + some commas prettify.
2017-09-05 19:34:55 +02:00
Torkel Ödegaard b333ad9481 docs: updated docs with v4.5 beta links 2017-09-05 16:01:28 +02:00
Torkel Ödegaard 22be9436f7 Update CHANGELOG.md 2017-09-05 15:16:04 +02:00
Torkel Ödegaard bc690232fb version bump to v4.5-beta1 2017-09-05 10:39:55 +02:00
Torkel Ödegaard 0005f8e7b3 fix: fixed jshint issue 2017-09-05 10:17:24 +02:00
Torkel Ödegaard 4e387ed47a fix: Elasticsearch and adhoc filters fix, fixes #9165 2017-09-05 10:16:17 +02:00
Daniel Lee 52676161bb docs: update to http api admin section
Make it clearer that it only works with basic auth
2017-09-05 10:04:01 +02:00
bergquist 01e2729dba spring clean! 2017-09-04 23:19:09 +02:00
Carl Bergquist a1faa6d4d9 Merge pull request #9164 from summic/master
Add the missing step of "grunt build" to the README.md
2017-09-04 23:06:42 +02:00
Allen 1a3d34b918 Add the missing step of grunt build to the readme 2017-09-05 01:56:52 +08:00
Torkel Ödegaard 5d3c3a6889 packaging: changed how pid directory is created for systemd systems, #9133 2017-09-04 16:41:07 +02:00
Torkel Ödegaard 4eabf6ce81 Update CHANGELOG.md 2017-09-04 14:49:51 +02:00
Torkel Ödegaard 2789c4f1e1 dsfix: include routes in plugin model 2017-09-04 14:09:02 +02:00
Torkel Ödegaard 9bafb108f7 docs: added docs archive for v4.3 2017-09-04 13:38:46 +02:00
Torkel Ödegaard 88e4b6ee75 docs: update changelog 2017-09-04 13:34:33 +02:00
Torkel Ödegaard 2fc67da69a Merge branch 'metrics-tab-v3' 2017-09-04 13:27:44 +02:00
Torkel Ödegaard 6e4090abf2 feat: finished work on the interval changes #9161 2017-09-04 13:27:28 +02:00
Torkel Ödegaard 284cacf560 logging: write pid file path and pid during startup 2017-09-04 12:44:54 +02:00
mxlxm c5400ffe76 mysql: use collation instead of charset (#9156)
- use charset would issue additional 'SET NAMES <VALUE>' queries, set
collation would be better. see: https://github.com/go-sql-driver/mysql#charset
2017-09-04 12:32:07 +02:00
Torkel Ödegaard c3cffeb10c packaging: fixed issue with pid file on systemd systems, fixes #9133 2017-09-04 10:43:04 +02:00
bergquist ce6050f5d6 fix(graphite): jsonData is not always present. 2017-09-04 10:28:48 +02:00
Joseph Weigl 185b0dcc05 Merge branch 'master' into feature/enhance_hipchat_card 2017-09-02 19:04:40 +02:00
Torkel Ödegaard 07e192ff47 change: more work on changing default group by time interval to min interval setting 2017-09-01 15:57:02 +02:00
Torkel Ödegaard e8e1f1bc6d updated graphite help 2017-09-01 11:15:39 +02:00
Marcel Anacker 40c008f870 Cloudwatch Datasource: changed namespace of Web Application Firewall (#9128) 2017-09-01 10:43:23 +02:00
Nevins 66441650cd changing ordering so AWS API is only called if cache has expired (#9136) 2017-09-01 07:24:05 +02:00
Jesse White 91fb3f2224 fix: cancel the initial timer when changing the auto-refresh interval, fixes #9139 (#9140) 2017-09-01 07:19:51 +02:00
Torkel Ödegaard 7b1473649b Update README.md 2017-09-01 07:16:42 +02:00
Torkel Ödegaard eb0f5cc900 ux: progress on metrics tab changes 2017-08-31 16:38:49 +02:00
Torkel Ödegaard 84d4958a3c plugin change: make interval, cache timeout & max data points options in plugin.json, remove query.options component feature, add help markdown feature and toggle for data sources 2017-08-31 14:05:52 +02:00
Torkel Ödegaard 40ae2cef38 docs: updated changelog with #9131 2017-08-31 09:54:45 +02:00
Torkel Ödegaard 52177a45d9 influxdb: use paranthesis for influxdb queries in frontend query builder, #9131 2017-08-31 09:52:32 +02:00
Jonathan A. Sternberg bdfbc2453f Use parenthesis to surround the selected tags for influxdb queries (#9131)
The generated queries when selecting multiple tags are incorrect. In
InfluxQL, `AND` has a higher precedence than `OR` so the condition:

    WHERE "hostname" = 'server1' OR "hostname" = 'server2' AND time > now() - 5m

This is parsed as if it were:

    WHERE "hostname" = 'server1' OR ("hostname" = 'server2' AND time > now() - 5m)

But the intention is to write a query like this:

    WHERE ("hostname" = 'server1' OR "hostname" = 'server2') AND time > now() - 5m

This change modifies the generated query so it surrounds a query with
multiple conditions in parenthesis so it doesn't conflict with the time
expression in an unexpected way.

This is currently not an issue because InfluxDB doesn't actually
evaluate the condition for the time expression correctly. It just looks
through the AST for anything that looks like a time expression and then
assumes the proper format of `AND` was used rather than validating that
it was used correctly.
2017-08-31 09:33:03 +02:00
Torkel Ödegaard 9b60a63778 ux: metrics tab v3 2017-08-30 16:39:00 +02:00
Daniel Lee abeaef71cc DashExport: fix View JSON in export menu
ref #9002
2017-08-30 09:56:49 +02:00
Torkel Ödegaard 54129b1340 Merge branch 'master' of github.com:grafana/grafana
: Please enter a commit message to explain why this merge is necessary,
2017-08-29 15:52:17 +02:00
Torkel Ödegaard dda1cf1a88 Merge branch 'ace-editor' 2017-08-29 15:52:03 +02:00
Torkel Ödegaard bdb1cfb008 ace: minor fixes for ace editor 2017-08-29 15:51:54 +02:00
Torkel Ödegaard c5c5fa0db3 Update ROADMAP.md 2017-08-29 15:45:59 +02:00
Torkel Ödegaard 78ea1ea76e Updated master version to v4.5 2017-08-29 10:13:16 +02:00
Alin Sinpalean bdd239e933 Prometheus: Fix actual step computation logic when a min_step is specified and the range is longer than min_step * 11000. (#9109) 2017-08-29 09:57:45 +02:00
Torkel Ödegaard aef4eca254 fix: removed code intented to test/replicate an issue 2017-08-29 08:57:34 +02:00
Callum Loh 74ddebc8ea Fix spelling for Hipchat notifier (#9112) 2017-08-29 08:08:51 +02:00
Alin Sinpalean 84c6caabc5 Prometheus: Fix actual step computation logic when a min_step is specified and the range is longer than min_step * 11000. 2017-08-28 15:45:51 +02:00
Torkel Ödegaard 546f903141 ds: minor fix that resets data source model when switching data source type 2017-08-28 15:29:31 +02:00
Torkel Ödegaard c2b05341e5 Merge branch 'master' of github.com:grafana/grafana 2017-08-28 13:29:36 +02:00
Torkel Ödegaard c92317bafa fix: fixed gofmt formating for #9091 2017-08-28 13:29:24 +02:00
Torkel Ödegaard 407f1ad475 Merge branch 'master' of https://github.com/pdoan017/grafana 2017-08-28 13:28:13 +02:00
Torkel Ödegaard ead7ae7635 Update CHANGELOG.md 2017-08-28 11:46:54 +02:00
Torkel Ödegaard 311fa66590 Update CHANGELOG.md 2017-08-28 11:46:13 +02:00
Torkel Ödegaard 72690b3962 Update CHANGELOG.md 2017-08-28 11:45:25 +02:00
Torkel Ödegaard 62f5770908 fix: changed modal to fixed positioned, this change makes modal maintain scroll position, fixes #8800 2017-08-28 11:34:44 +02:00
Torkel Ödegaard bf110d02d1 fix: form dropdown, escape autocomplete dropdown items, fixes #9089 2017-08-28 11:00:42 +02:00
Torkel Ödegaard e91cf28f8d elasticsearch: changed ad hoc filters from using term filters to using phrase match queries, closing #9095 2017-08-28 10:52:10 +02:00
Torkel Ödegaard 3b9fbd60d8 ux: fix for showing pending invitations tab, fixes #9094 2017-08-28 09:52:53 +02:00
Dmitry Bedrin ad14ccf4bd non_negative_difference() function in InfluxDB 1.3 (#9104)
Add support of non_negative_difference() function from InfluxDB 1.3
https://docs.influxdata.com/influxdb/v1.3/administration/differences/#functions
2017-08-28 08:53:41 +02:00
Alexander Zobnin 9375441991 ace: add default light theme 2017-08-26 13:46:39 +03:00
Alexander Zobnin ef3c543620 ace: fix directive docs 2017-08-26 12:52:32 +03:00
Alexander Zobnin 54f932e960 ace: fix error when getCompleter() wasn't passed 2017-08-26 12:48:37 +03:00
Alexander Zobnin 451ecce4ab ace: styles tweak 2017-08-26 12:36:08 +03:00
Alexander Zobnin ef162c3dc7 ace: minor css refactor 2017-08-26 12:14:45 +03:00
pdoan017 3eea5d235d Added import for container/list 2017-08-24 15:42:54 -04:00
pdoan017 d6085755c4 Added series order according to query results
Raw query results would return as expected. But when appending new series to pointsBySeries map, order of keys is random. So I've added a list to keep track of series order. Should implement FIFO rules.
2017-08-24 15:38:36 -04:00
Joseph Weigl 81d3ab37c3 Add thumbnail to card 2017-08-24 14:52:23 +02:00
Joseph Weigl 9666f45e9c Add values to the hipchat card 2017-08-24 13:40:33 +02:00
Joseph Weigl c6f7d34c55 Reorder editorconfig 2017-08-24 13:40:19 +02:00
Alexander Zobnin a0cb744746 ace: reduce docs lines width 2017-08-24 13:58:26 +03:00
Alexander Zobnin dc7616e560 ace: prometheus functions docs 2017-08-24 13:56:22 +03:00
Alexander Zobnin f7ec8e0de0 Merge branch 'master' into ace-editor 2017-08-24 12:37:18 +03:00
Torkel Ödegaard 47f8145246 Merge branch 'master' of github.com:grafana/grafana 2017-08-24 11:18:44 +02:00
Torkel Ödegaard 71c22fdbff dataproxy: removed some logging, closes #9078 2017-08-24 11:18:06 +02:00
Torkel Ödegaard 71c9582944 data source with token auth is starting to work, #9078 2017-08-24 11:07:37 +02:00
Jason Stangroome 632a5e9b97 Support Azure MySQL (#8618)
Azure's MySQL implementation appears to always respond with an Authentication Method Switch Request Packet requesting `mysql_native_password` auth even though the client's initial Handshake Response already included the native password credentials.

Most MySQL client libraries support this but Golang's go-sql-driver/mysql requires the `allowNativePasswords` DSN parameter set to enable it. Without this parameter, Grafana fails to authenticate to the database with the error message "this user requires mysql native password authentication."

References:

* https://web.archive.org/web/20160814002743/http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest
* https://web.archive.org/web/20160814002743/http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse
* https://github.com/go-sql-driver/mysql#user-content-allownativepasswords
2017-08-24 10:24:10 +02:00
Torkel Ödegaard 3c9798bec9 datasource-proxy: token exchange 2017-08-23 17:18:43 +02:00
Daniel Lee bf4ffe41b0 Merge branch 'v4.4.x' 2017-08-23 15:19:51 +02:00
Daniel Lee e763104a6f csv: add toggle for export to Excel
Adds back feature that adds 'sep=;' text that excel needs in a csv file.
Also adds toggle to make this optional if exporting to other spreadsheet
programs. Fixes #9083.
2017-08-23 15:17:53 +02:00
Torkel Ödegaard 4f9fbcc211 dataproxy: added caching of datasources when doing data proxy requests, #9078 2017-08-23 13:31:26 +02:00
Torkel Ödegaard bcb3dfac9f Merge branch 'master' of github.com:grafana/grafana 2017-08-23 10:52:56 +02:00
Torkel Ödegaard 8bf49c51b9 dataproxy: refactoring data source proxy to support route templates and wrote more tests for data proxy code, #9078 2017-08-23 10:52:31 +02:00
jenlersadnie 0ba5706400 Fixing a minor typo under Selection Options (#9082)
Mulit => Multi
2017-08-23 08:50:22 +02:00
Torkel Ödegaard 63d6ab476a feat: data source proxy refactoring and route handling, #9078 2017-08-22 17:14:15 +02:00
Daniel Lee d19aa89ec0 docs: .ini file semicolon is comment
ref #7725
2017-08-21 21:28:49 +02:00
Daniel Lee bbf9d7677b Merge branch 'v4.4.x' 2017-08-21 21:05:43 +02:00
Daniel Lee a31d0df897 shortcuts: fixes expand/collapse all rows
Fixes #9069
2017-08-21 21:04:20 +02:00
Daniel Lee 5c2958023d Merge branch 'v4.4.x' 2017-08-21 13:45:04 +02:00
Daniel Lee 7b5019482e mysqlds: add placeholder/typeahead for localhost connection strings
for the host field on the data source config page. Fixes #9046
2017-08-21 13:44:33 +02:00
Daniel Lee 649122b4fb mysqlds: add placeholder/typeahead for localhost connection strings
for the host field on the data source config page. Fixes #9046
2017-08-21 13:43:09 +02:00
Torkel Ödegaard e3bd51e38d fix: remove duplicate set-cookie when logging in, fixes #9013 2017-08-21 11:10:59 +02:00
ericslaw 73f0bd3b4b fix link to opentsdb templating (#9039) 2017-08-16 16:57:27 +02:00
Andrei Burd 3222677493 Datasource Print the received error (#9043) 2017-08-16 16:56:51 +02:00
Matt Toback 020aae1427 Updated Grafana.net to .com 2017-08-14 11:05:28 +02:00
Torkel Ödegaard 17cb3f6e6a fix: graph fix for decimals, bug introduced by #61313478063b0e0721f204847f3c0298ea8f593f 2017-08-11 16:20:36 +02:00
Torkel Ödegaard d4dd0222fa fix: prometheus does not have two editor modes, fixes #9025 2017-08-11 12:33:56 +02:00
Daniel Lee 167995776f docs: update to tag alias
ref #9024
2017-08-11 11:30:30 +02:00
Daniel Lee 02248273ae mysqlds: remove alpha state from plugin.json 2017-08-11 10:25:37 +02:00
Daniel Lee c4feef2541 docs: http api /users - corrections + adds missing method 2017-08-11 10:24:54 +02:00
Adrian Garza 5420f271f1 added CloudWatch data source API documentation
access and secret keys are base64-encoded gibberish
2017-08-10 16:03:42 -07:00
Alexander Zobnin 776e6e2c3f ace: redefine completions for prometheus and add initial docs for functions 2017-08-10 19:58:59 +03:00
Alexander Zobnin 679ddc9696 ace: example snippet for prometheus 2017-08-10 16:49:09 +03:00
Daniel Lee b716a2595a mysqlds: add support for key/value template variables
If the template variable query has two columns named __text and __value
then return a list of key values. The value is used when the variable is
interpolated in the query. Allows mapping of texts to ids.
2017-08-10 14:42:27 +02:00
Alexander Zobnin d8d59fd8d4 ace: add custom behaviour for prometheus 2017-08-10 15:28:40 +03:00
Torkel Ödegaard c7959ff06e fix: Using table cell links and ad hoc filters together now works & looks correct, fixes #8052 2017-08-10 14:12:31 +02:00
Torkel Ödegaard d2437d3cf1 fix: ad-hoc filters now works with data source variables, fixes #8052 2017-08-10 12:04:46 +02:00
Alexander Zobnin b260a642e7 ace: fix broken karma tests (error loading ace.js ) 2017-08-10 12:33:53 +03:00
Alexander Zobnin e75b39376a ace: minor refactor 2017-08-10 11:53:55 +03:00
Alexander Zobnin 6b5400bdb6 ace: fix loading text snippets error 2017-08-10 11:23:32 +03:00
Torkel Ödegaard 149e694ce6 ace: prometheus completion improvements 2017-08-10 10:08:09 +02:00
Torkel Ödegaard 0b2cc404ff ace: working on editor completion stuff 2017-08-10 09:33:17 +02:00
Torkel Ödegaard b9540e4c49 ace: minor ace theme tweaks 2017-08-09 21:12:15 +02:00
Daniel Lee 43fa852cc1 mysql: change logging from into to debug for scan 2017-08-09 19:33:09 +02:00
Daniel Lee 1105bb371f mysqlds: adds support for template variables
Fixes #8855
2017-08-09 19:32:53 +02:00
Daniel Lee 59513ff963 tempvar: bug fix for duplicate template var
and a fix for when selecting the same value twice in
a template variable if it is not multi select. It threw an
exception on the second selection
2017-08-09 14:28:23 +02:00
Torkel Ödegaard 459a8ed695 ace: minor changes to ace directive 2017-08-09 11:43:02 +02:00
Torkel Ödegaard 80f5c914e8 ace: removed the old text areas 2017-08-09 11:06:21 +02:00
Torkel Ödegaard 68cac6ccb5 Merge branch 'master' into ace-editor 2017-08-09 10:51:31 +02:00
Torkel Ödegaard 668cb3c1ef Merge branch 'v4.4.x' 2017-08-09 10:37:06 +02:00
Torkel Ödegaard e8a20643d6 feat: store last seen date for users and present in stats and user lists, closes #9007 2017-08-09 10:36:41 +02:00
Alexander Zobnin 5c0773023f code-editor: increase autocomplete popup size 2017-08-09 11:23:05 +03:00
Alexander Zobnin 1c8c746956 code-editor: prometheus metrics autocomplete 2017-08-09 10:58:00 +03:00
Torkel Ödegaard eac0d30e99 Merge branch 'v4.4.x' 2017-08-09 07:20:52 +02:00
Torkel Ödegaard 26ad025705 feat: added os to stats 2017-08-09 07:20:37 +02:00
Alexander Zobnin aa670244f1 code-editor: initial prometheus syntax definition 2017-08-08 22:27:47 +03:00
Chris Burkhart 3e0b92d6fe Enable datasources to be able to round off to a UTC day properly 2017-08-08 09:34:41 -07:00
Alexander Zobnin e0bbb74b0c code-editor: test editors for MySQL and prometheus 2017-08-08 18:42:26 +03:00
Alexander Zobnin 0e0e60317e code-editor: tabSize option 2017-08-08 18:41:11 +03:00
Alexander Zobnin 152c4170da code-editor: onChange option and usage docs 2017-08-08 18:31:13 +03:00
Torkel Ödegaard 1652426dfe :Merge branch 'master' of github.com:grafana/grafana 2017-08-08 17:08:49 +02:00
Torkel Ödegaard 68c4ce34d5 fix: templating issue with data source variables, can now be used right away in other query variables and panels (without page reload), fixes #7510 2017-08-08 17:08:35 +02:00
Torkel Ödegaard fec41cf038 Update CHANGELOG.md 2017-08-08 16:21:20 +02:00
Torkel Ödegaard fee1e6df41 Merge branch 'master' of github.com:grafana/grafana 2017-08-08 16:18:26 +02:00
Torkel Ödegaard addeccb4f0 Merge branch 'v4.4.x' 2017-08-08 16:18:08 +02:00
Torkel Ödegaard a47b31ac62 fix: MySQL/Postgress max_idle_conn default was wrongly set to zero, which does not mean unlimited but zero, which in practice disables connection pooling, not good. now max idle conn is set to golang's default which is 2, fixes #8513 2017-08-08 16:17:52 +02:00
Alexander Zobnin cd16db4d09 code-editor: use data- attributes for editor options 2017-08-08 16:28:51 +03:00
Daniel Lee 563795245a mysqlds: support for more column types
Includes integration test for most column types. Fixes #8918
2017-08-08 15:24:41 +02:00
Alexander Zobnin 59d1654df4 code-editor: adjust editor styles 2017-08-08 16:05:15 +03:00
Daniel Lee 2fb25d8fa4 mysqlds: add tests for new macros 2017-08-08 14:40:27 +02:00
Brad Lhotsky a8ac215039 Add a few more MySQL macros:
* $__timeFrom() -> Returns the dashboard 'from' suitable for use querying
  against a MySQL TIMESTAMP field.
* $__timeTo() -> Returns the dashboard 'to' suitable for use querying
  against a MySQL TIMESTAMP field.
* $__unixEpochFiler(column) -> If you store timestamps as UNIX epoch's,
  this builds: column > 'from' AND column < 'to'
* $__unixEpochFrom() -> Returns the dashboard 'from' suitable for use querying
  against a MySQL integer field (UNIX epochs)
* $__unixEpochTo() -> Returns the dashboard 'to' suitable for use querying
  against a MySQL integer field (UNIX epochs)
2017-08-08 14:40:27 +02:00
Alexander Zobnin eb944551c0 code-editor: add autocomplete styles 2017-08-08 15:32:23 +03:00
Alexander Zobnin 928fedaad7 code-editor: minor refactor 2017-08-08 15:19:15 +03:00
Torkel Ödegaard d3680d290c fix: graphite issue with metricFind and sending from/until in normal format, fixes #8997 2017-08-08 13:51:54 +02:00
Torkel Ödegaard 83beff300b Merge branch 'v4.4.x' 2017-08-08 11:26:45 +02:00
Torkel Ödegaard 64b5153e7d fix: change view json to use the grafana built json viewer, fixes #9002 2017-08-08 11:26:16 +02:00
Torkel Ödegaard 781dd25c82 Merge branch 'elasticsearch-filtering' 2017-08-08 11:09:00 +02:00
Torkel Ödegaard f979e95820 tablepanel: minor update to table panel, #8052 2017-08-08 11:08:51 +02:00
Torkel Ödegaard 1507c02ebb Merge branch 'feat-8539' of https://github.com/alexanderzobnin/grafana 2017-08-08 09:33:23 +02:00
Torkel Ödegaard 7c14ade623 Merge branch 'v4.4.x' 2017-08-08 09:28:41 +02:00
Torkel Ödegaard 7031f7e772 fix: sqlite3 and storing/displaying dates used wrong timezone, fixes #8996 2017-08-08 09:28:16 +02:00
Alexander Zobnin bf8171fd63 code-editor: initial autocomplete 2017-08-07 21:30:36 +03:00
Alexander Zobnin b74fe05fec code-editor: support language mode 2017-08-07 20:19:15 +03:00
Alexander Zobnin ecb66e7678 code-editor: disable depreacation warning 2017-08-07 19:43:58 +03:00
Alexander Zobnin e4dabb657c code-editor: initial directive for rich code editor (ace) 2017-08-07 19:31:50 +03:00
Torkel Ödegaard 48fa642727 Update CHANGELOG.md 2017-08-07 16:03:03 +02:00
Torkel Ödegaard 3e392ef921 ux: added minor help tip to graphite ds settings 2017-08-07 15:55:05 +02:00
Torkel Ödegaard 0e2b809f7e docker: added graphite v1.x docker block 2017-08-07 15:12:12 +02:00
Alexander Zobnin 4fe79edd40 Graphite 1.0 functions (#8987)
* graphite-ds: add graphite version to config editor

* graphite-ds: modify add-graphite-function to show only version-related functions

* graphite-ds: refactor, move func filtering to gfunc.js

* graphite-ds: add new functions for graphite 1.0.x

* graphite-ds: fix unit tests (add jsonData)
2017-08-07 15:10:59 +02:00
Alexander 35522c475f Fix #8998 by not overriding GOMAXPROCS (#8999) 2017-08-07 15:02:04 +02:00
Daniel Lee 92f71136e6 Update CHANGELOG.md 2017-08-07 13:40:25 +02:00
Daniel Lee ee835242ca Merge branch 'v4.4.x' 2017-08-07 13:14:24 +02:00
Daniel Lee def45f55da docs: update installation for version 4.4.3 2017-08-07 13:11:57 +02:00
Daniel Lee 54c79c5648 updated version to v4.4.3 2017-08-07 10:50:18 +02:00
Daniel Lee 649fe7e462 Merge branch 'v4.4.x' 2017-08-07 10:47:23 +02:00
Daniel Lee 0d25357367 build: remove downloaded pkg files after publish 2017-08-07 10:46:37 +02:00
Daniel Lee aa889e59a1 tests: fix after interface change 2017-08-07 10:20:46 +02:00
Torkel Ödegaard d285045ff6 removed unused images 2017-08-07 10:11:39 +02:00
Torkel Ödegaard 132cd36b0c Delete fav16.png
fixes #8989
2017-08-07 10:10:37 +02:00
Daniel Lee 1e5778174c login: regenerates session id on login 2017-08-07 10:00:29 +02:00
Patrick Tescher c082372ffe Add a Safari Pinned Tab Icon (#8983)
Icon adopted from grafana_icon.svg

Reference document:
https://developer.apple.com/library/content/documentation/AppleApplicati
ons/Reference/SafariWebContent/pinnedTabs/pinnedTabs.html
2017-08-07 09:39:36 +02:00
Torkel Ödegaard 4f9cfcd632 Update CHANGELOG.md 2017-08-07 09:35:32 +02:00
Torkel Ödegaard 0bd03098ea Update CHANGELOG.md 2017-08-07 09:31:31 +02:00
Torkel Ödegaard ee297487a5 Update CHANGELOG.md 2017-08-07 09:31:04 +02:00
Torkel Ödegaard 8930e04f2b Update CHANGELOG.md 2017-08-07 09:29:54 +02:00
Louis Ventre 97d1676fe8 Add time extremity with InfluxDB (#8722) 2017-08-07 09:26:32 +02:00
Jesse White f547c93a4f fix: hide modals when pressing Esc, fixes #8988 (#8994) 2017-08-07 09:23:33 +02:00
Torkel Ödegaard 58528a951a Merge branch 'master' of github.com:grafana/grafana 2017-08-04 14:05:00 +02:00
Torkel Ödegaard 6e0f767af7 Update CHANGELOG.md 2017-08-04 14:04:16 +02:00
Torkel Ödegaard 0a23f3dd28 Merge branch 'master' of github.com:grafana/grafana 2017-08-04 14:02:18 +02:00
Torkel Ödegaard 26766ddb27 Merge branch 'v4.4.x' 2017-08-04 14:02:01 +02:00
Torkel Ödegaard c0b0a54a8f fix: search bug where search was hidden when you click starred or tags filter links, fixes #8981 2017-08-04 14:01:09 +02:00
Sébastien Fievet 8e618bc169 Fix some typos in alerting documentation (#8986) 2017-08-04 10:08:41 +01:00
Daniel Lee 6131347806 graph: adds decimals option for y-axis
Fixes #8187
2017-08-03 17:57:04 +02:00
Daniel Lee ef0c90b9ca graph: change tick decimal calculation for y-axis
Fixes #8872. Use the automatic calculation by Flot to get the
number of decimal places for ticks on the y-axis rather than
the number of decimal places for the min value.
2017-08-03 16:58:31 +02:00
Daniel Lee 1ce134cc6f docs: fixes #8972. Note on clustering and alerting. 2017-08-03 15:37:04 +02:00
David Wittman 8f5fbb4254 Fix typo in PagerDuty notifier options template (#8978) 2017-08-03 08:57:59 +02:00
Torkel Ödegaard c7ca4830a8 Merge branch 'v4.4.x' 2017-08-03 08:56:46 +02:00
Torkel Ödegaard 1372d2e517 fix: update user permissions validation was not working properly, fixes #8977 2017-08-03 08:56:34 +02:00
Alexander Zobnin 77b7f4b376 heatmap: add unit tests for convertToCards() 2017-08-02 21:27:10 +03:00
Alexander Zobnin c7e8b98d14 heatmap: minor refactor, don't repeat cards stats calculation 2017-08-02 21:24:59 +03:00
Torkel Ödegaard 8d7186d40d Merge branch 'v4.4.x' 2017-08-02 17:33:19 +02:00
Torkel Ödegaard 3dc9d76b38 fix: viewer role fix, fixes #8976 2017-08-02 17:33:06 +02:00
Torkel Ödegaard a5bdfec0de ES: return .raw fields in field lookups, closes #8975 2017-08-02 16:52:43 +02:00
Daniel Lee b5017d1e18 docs: var in singlestat panel. Fixes #8563 2017-08-02 16:44:43 +02:00
Daniel Lee b241b98196 singlestat: fix for variable
in the prefix or postfix fields and when adding a gauge.
Previously the template variable substition was only done
when not rendering the gauge.
2017-08-02 16:40:26 +02:00
Torkel Ödegaard a5d5f3d82f feat: add ad hoc filters directly from table panel cells, kibana 3 style, #8052 2017-08-02 16:15:22 +02:00
Torkel Ödegaard c17b5d1306 table: minor table options improvement 2017-08-02 12:34:36 +02:00
Torkel Ödegaard ede827f5c0 feat: Elasticsearch change to how queries without date histogram are transformed into Grafana data stucture, now it is processed into a table structure instead of json structure 2017-08-02 12:15:39 +02:00
Torkel Ödegaard 6224a25e42 feat: Elasticsearch filtering wip, moved to typescript 2017-08-02 11:16:37 +02:00
Alexander Zobnin f7ea08dba7 heatmap: fix rendering tests 2017-08-01 16:51:55 +03:00
Phil Porada 814d164e5b Typo fix (#8966) 2017-08-01 14:44:57 +01:00
Alexander Zobnin 663a3293ee heatmap: some legend fixes 2017-08-01 16:23:01 +03:00
Alexander Zobnin b01a4e6583 heatmap: use the same color for selection as for graph 2017-08-01 16:21:40 +03:00
Alexander Zobnin f64ebf538c heatmap: minor legend fixes 2017-08-01 15:25:52 +03:00
Alexander Zobnin 91a921e12d heatmap: add show legend option 2017-08-01 14:07:52 +03:00
Alexander Zobnin e72baca4a7 heatmap: fix black selection area 2017-08-01 13:54:09 +03:00
Alexander Zobnin 2aa26c98b6 heatmap: initial legend 2017-08-01 13:53:16 +03:00
Torkel Ödegaard ae3e869d70 updated download links in docs 2017-08-01 10:18:48 +02:00
Torkel Ödegaard deab5a54bf Merge branch 'master' of github.com:grafana/grafana 2017-08-01 09:49:37 +02:00
Torkel Ödegaard ecfe28d7ac packaging: added strech to publish script, closes #8737 2017-08-01 09:49:26 +02:00
Torkel Ödegaard 9fb22ef86c Update CHANGELOG.md 2017-08-01 09:44:45 +02:00
Torkel Ödegaard 5d2054323b Merge branch 'aws-instance-attribute-tags' of https://github.com/paco3346/grafana into paco3346-aws-instance-attribute-tags 2017-08-01 09:38:58 +02:00
Torkel Ödegaard 1e4b0f01d6 Merge branch 'v4.4.x' 2017-08-01 09:18:39 +02:00
Torkel Ödegaard 6d9cbdd59e updated version to v4.4.2 2017-08-01 09:14:49 +02:00
Torkel Ödegaard c4eadb576e fix: graphite bug fix introduced in recent commit 2017-07-31 22:39:56 +02:00
Torkel Ödegaard 7de1c0eaa2 Update CHANGELOG.md 2017-07-31 22:37:11 +02:00
Torkel Ödegaard 73a1a262ef Merge branch 'v4.4.x' 2017-07-31 22:33:36 +02:00
Torkel Ödegaard e9989cb690 fix: make it easier to close search by clicking outside result container, fixes #8848 2017-07-31 22:33:22 +02:00
Torkel Ödegaard 0fcc87010a fix: cloudwatch fix for templating namespace argument to metrics tempalting function, fixes #8965 2017-07-31 22:30:49 +02:00
Mitsuhiro Tanda 91a533d948 (cloudwatch) high resolution custom metrics (#8958)
* support 1 second resolution Custom Metrics

* upgrade to aws-sdk-go v1.10.18

* simplify period calculation

* add test

* fix period calculation bug
2017-07-31 21:19:19 +02:00
squain ede6d71e72 Fix typo in alert_howto.html (#8964) 2017-07-31 21:16:39 +02:00
Torkel Ödegaard 4d82a1076a Create CODE_OF_CONDUCT.md (#8960) 2017-07-31 17:31:05 +02:00
Torkel Ödegaard 44fbd3ec9f feat: calls to Graphite api /metrics/find now include panel or dashboard time ranges in some scenarios, closes #8055 2017-07-31 17:21:25 +02:00
Alexander Zobnin c79a68dcd1 heatmap: refactor, build cards before rendering 2017-07-31 18:15:03 +03:00
Alexander Zobnin 55b24be115 heatmap: refactor, directive for color legend 2017-07-31 17:45:05 +03:00
Torkel Ödegaard bf7516d9bf Update CHANGELOG.md 2017-07-31 16:06:29 +02:00
Torkel Ödegaard 81dc64d4ec Update CHANGELOG.md 2017-07-31 16:05:56 +02:00
Torkel Ödegaard c7c5730c40 Merge branch 'v4.4.x' 2017-07-31 16:04:31 +02:00
Torkel Ödegaard 34cda65998 fix: png rendering api & timeout parameter now works as it should AND default render timeout increased from 30 to 60 seconds, fixes #8710 2017-07-31 16:04:04 +02:00
Torkel Ödegaard 61d8eb1fac Merge branch 'v4.4.x' 2017-07-31 15:07:22 +02:00
Torkel Ödegaard d630f3d59e Merge branch 'external-user-mng' into v4.4.x 2017-07-31 15:07:01 +02:00
Torkel Ödegaard 06e87c151f feat: added settings to sample ini #8768 2017-07-31 15:04:47 +02:00
Torkel Ödegaard 73563d087c feat: more work on #8768 2017-07-31 14:39:33 +02:00
Torkel Ödegaard 23558c61d4 feat: wip work on #8768 2017-07-31 13:03:42 +02:00
Alexander Zobnin ef9dd014c7 heatmap: add color scale options, issue #8539 2017-07-31 14:03:03 +03:00
Torkel Ödegaard 5406481e7b Update CHANGELOG.md 2017-07-31 12:17:46 +02:00
Torkel Ödegaard 510ad001b4 Update CHANGELOG.md 2017-07-31 12:16:29 +02:00
Dave Hall 0c70d271dc Support large github organisations (#8846)
* Add new HttpGetResponse struct type
* Modify HttpGet() return to use HttpGetResponse
* Look up _all_ the teams the user is a member of
2017-07-31 12:13:29 +02:00
Cedric Cellier 417c5163dd Fix typos (#8954)
Some being user visible.
2017-07-31 12:12:28 +02:00
Fredrik Wendt 5542309170 fixed incorrect header text (#8952)
Status code now replaced with Query parameters
2017-07-29 15:34:22 +01:00
Fredrik Wendt 6b344d0158 removed incorrect HTTP response data (#8949)
the example response body contained incorrect out-of-place data, presumably from a copy-paste operation
2017-07-28 09:25:30 +02:00
Daniel Lee 22758d5112 Merge branch 'v4.4.x' 2017-07-27 14:40:33 +02:00
Daniel Lee 7b768bca3f singlestat: change threshold check in flot gauge
Fixes #5515. Flot gauge has its own threshold check that is different
from the threshold check in singlestat. This changes the flot check to
be exclusive (same as the singlestat check). E.g. if the threshold is
10, then the value 10 is over the threshold.
2017-07-27 14:34:29 +02:00
amitkumar912 c4683f1ae8 Opentsdb datasource labeling fix (#8929)
* Fix Labeling issue when hiding Queries.

Issue #8928

* Fix spacing.

* Replacing tabs with spaces.

* Fix for jshint
2017-07-26 21:27:42 +02:00
Alexander Zobnin cb8ecb2d5f Heatmap fixes (adapted for v4.4.x branch) (#8920)
* heatmap: fix converting error when series contains 0 and log scale is selected, issue #8884

* heatmap: fix app crash when Y min set to 0 with log scale

* heatmap: fix tooltip for 'zero' buckets in log scale

* heatmap: fix tooltip histogram for log scales

* heatmap: fix flicker of the highlighted element

this was caused by too often fired mouseenter/mouseleave events

* heatmap: fix missing X axis option for log scales

* heatmap: fix missing zero bucket in tooltip histogram
2017-07-25 16:28:29 +02:00
Torkel Ödegaard ce4939bd56 Update CHANGELOG.md 2017-07-24 12:40:35 +02:00
Torkel Ödegaard d46fd890a5 Merge branch 'v4.4.x' 2017-07-24 12:38:39 +02:00
Torkel Ödegaard 8ca08d65e7 docs: updated configuration docs with new defaults, #8743 2017-07-24 12:37:58 +02:00
Torkel Ödegaard f5ed5c6529 settings(change): changed default value for allow sign up to false, closes #8743, and changed default option allow_org_create to false 2017-07-24 12:36:42 +02:00
Torkel Ödegaard 9825cd1ebb Update CHANGELOG.md 2017-07-24 12:32:22 +02:00
Torkel Ödegaard 0f33ac9e10 Merge branch 'master' of github.com:grafana/grafana 2017-07-24 12:30:43 +02:00
Torkel Ödegaard 24a79a6bea Merge branch 'v4.4.x' 2017-07-24 12:30:28 +02:00
Torkel Ödegaard 723f5bc9e8 fix: dsahboard_version data column type changed to MEDIUMTEXT, fixes #8813 2017-07-24 12:30:13 +02:00
Torkel Ödegaard 287c222fc7 Update CHANGELOG.md 2017-07-24 12:25:49 +02:00
Torkel Ödegaard 6956110497 Merge branch 'master' of github.com:grafana/grafana 2017-07-24 12:23:33 +02:00
Torkel Ödegaard f500dfd1e5 Update CHANGELOG.md 2017-07-24 12:23:07 +02:00
Torkel Ödegaard cd0e1a8978 Merge branch 'v4.4.x' 2017-07-24 12:21:43 +02:00
Torkel Ödegaard 2d2800e710 fix: url did not update correctly when closing settings view by using ESC key, fixes #8869 2017-07-24 12:21:30 +02:00
Daniel Lee 4a678c2884 influxdb: fix for adding math query part
Fixes #8870. Fixes out of bound exception on adding a math query part
when there is no group by interval (or only one query part).
2017-07-22 01:31:26 +02:00
Nicholas Nadeau 1a25b78ef2 homogenized docker run command (#8907)
There are three locations where the `docker run` command is referenced:
- 2x http://docs.grafana.org/installation/docker/
- 1x https://grafana.com/grafana/download?platform=docker

The fix syncs the given `docker run` command arguments with the other two.
2017-07-21 21:46:54 +02:00
Kakuya Ando bbfdfc012f fix(prometheus) when tag value duplicate, tags not working. (#8040) 2017-07-21 09:51:25 +02:00
Mitsuhiro Tanda b16b649c9b (cloudwatch) add new elb metrics (#8894) 2017-07-20 14:12:56 +02:00
Mitsuhiro Tanda 9d50ab8fb5 (cloudwatch) check auth type before assume role (#8895) 2017-07-20 14:11:51 +02:00
Alexander Zobnin af56cc4c28 Panel Alertlist: use dashboard timezone (#8880)
* panel-alertlist: use dashboard timezone, fixes #8874

* alert state history: use dashboard timezone, issue #8874

* alert state history: minor refactor
2017-07-19 20:45:57 +02:00
Mitsuhiro Tanda e8157f01ec add new dashboard shortcut 2017-07-19 17:54:34 +09:00
Mitsuhiro Tanda aecc6860e3 set focus on text field when opening panel/query editor (#8879)
* (prometheus) set focus to top expression when opening editor

* (text panel) set focus to top expression when opening editor
2017-07-19 10:33:04 +02:00
Alexander Zobnin 9bbc942534 table-panel: clickable cell link - draft (#8738)
* table-panel: clickable cell link - draft

* table-panel: clickable cell link - fix link target option

* table-panel: fix undefined columnStyle.link

* table-panel: option to highlight cell with link

* table-panel: render variables for all cells in row

* table-panel: remove cell highlighting

* table-panel: add help for URL field

* linkPopover directive for link info in table panel

* table-panel: add link info popover to cells

* table-panel: use native popover instead directive

* table-panel: link drop refactor, remove unused code

* table-panel: fix unclickable link when drop is opened

* refactoring: minor refactoring to #8738, do not think we need a full blown popover for the links, simple tooltip is enough and more efficient, sadly we do not have a modern tooltip framework, still using old bootstrap 2.3 tooltip

* table-panel: add tests for link rendering
2017-07-18 20:59:34 +02:00
Torkel Ödegaard 13c966c178 Update CHANGELOG.md 2017-07-18 20:59:16 +02:00
Alexander Gängel 4073949af0 add templating for prometheus monitoring other promethues (#8845) 2017-07-18 19:52:29 +02:00
Mitsuhiro Tanda a6920eb2ff (prometheus) replace each by for (#8881) 2017-07-18 19:50:44 +02:00
Mitsuhiro Tanda 32f9a42d5e Fix performance degradation by always setting fill = 0.001 (#8868)
* add benchmark

* fix, prevent plotLineArea() call if fill == 0

* remove benchmark
2017-07-17 20:50:58 +02:00
Daniel Koehler c5f6cf0809 fix for wrong locale and text issues #8840 (#8854)
fixes https://github.com/grafana/grafana/issues/8840
by setting a default locale. Also uses fromNow(true) to work arround the replace.
2017-07-14 21:58:27 +02:00
Matt Toback a045f175b6 Fixed typo 2017-07-14 12:20:04 -04:00
Adam Johnson 17d57ab074 docs(testdata): add missing word (#8856) 2017-07-13 19:52:59 +02:00
Torkel Ödegaard 74984f8da6 Update latest.json 2017-07-12 10:19:02 +02:00
Torkel Ödegaard e4950c2dc1 fix: elasticsearch with template variable with terms agg on IP field, fixes #8662 2017-07-12 07:43:30 +02:00
bergquist 4844bf9be3 docs(prometheus): updates invalid template example 2017-07-12 07:37:44 +02:00
ajrnz 43974898c1 Interpolate the field property in elastic search term queries (#8663)
* Interpolate the field property in elastic search term queries

* more defensive interpolation of query.field in ES templates
2017-07-12 07:25:56 +02:00
Torkel Ödegaard bb3bcbe6a1 fix: for issue in graph panel axes labels when iframe embedding, fixes #8827 2017-07-12 07:12:05 +02:00
gomlgs 228c210379 Cloudwatch: Fix bug with obtaining IAM roles within ECS containers. (#8766)
Fixes #8750.
2017-07-12 06:55:59 +02:00
Alexander Gängel 92937c591f upgrade grunt-sass to 2.0.0 (#8808) 2017-07-12 06:55:15 +02:00
Denis Doria 89822acf38 More precise detection for self reference variable on templates (#8814)
This should close the bug #8773
2017-07-12 06:54:32 +02:00
Moody Saada 2d99518f90 Update annotations.md typo (#8830) 2017-07-12 06:53:28 +02:00
Alin Sinpalean 5bffdfe9a4 When converting Prometheus results to table, handle the case where the returned series have non-uniform sets of labels. (#8826) 2017-07-12 06:52:59 +02:00
Liang Jiameng f8d22385ce add a placeholder to DingTalk Url (#8820) 2017-07-10 16:51:03 +02:00
Daniel Lee 1dedc886f2 docs: DingDing notifier 2017-07-10 12:22:21 +02:00
Daniel Lee 1ccfca109f docs: instructions for DingDing notifier 2017-07-10 12:16:40 +02:00
Daniel Lee 68e7219135 docs: add missing parameter api call 2017-07-09 02:00:50 +02:00
Daniel Lee 3a075be7e9 cloudwatch: make dimension text in alias popover clearer 2017-07-07 18:17:05 +02:00
Daniel Lee fc82de1543 docs: style fix 2017-07-07 13:00:13 +02:00
Daniel Lee c296e73b83 docs: x-axis mode for graph panel 2017-07-07 12:25:42 +02:00
0x6875790d0a a622c55b1b (feat) Add image to LINE notify (#8771) 2017-07-07 11:20:27 +02:00
Daniel Lee e6f9546a7c api: add no cache headers for IE11
Adds pragma and expires headers for API calls so that IE11 does not
cache GET calls. Ref #5356
2017-07-06 18:56:22 +02:00
Daniel Lee fe3bcd3678 Merge branch 'v4.4.x' 2017-07-06 10:11:07 +02:00
Torkel Ödegaard cff1c37064 fix: InfluxDB direct access with normal inflxudb credentials was not sent correctly, fixes #8789 2017-07-06 09:46:31 +02:00
Torkel Ödegaard e5b499a958 fix: Text area css issue prevented scrolling, fixes #8797 2017-07-06 09:36:57 +02:00
Torkel Ödegaard 1994b767d3 fix: InfluxDB direct access with normal inflxudb credentials was not sent correctly, fixes #8789 2017-07-05 22:15:28 +02:00
Daniel Lee eca11e862e docs: update for panel sharing options 2017-07-05 22:14:04 +02:00
Min-Zhong "John" Lu fbff905c57 Fix broken table row in prometheus.md (#8779)
"Metric Lookup" row in Query editor was broken :(
2017-07-05 22:14:03 +02:00
Daniel Lee a4266319ad packaging: v4.4.1 2017-07-05 22:14:03 +02:00
Daniel Lee 49113c1ccb Add v4.4.1 patch release 2017-07-05 22:14:03 +02:00
Daniel Lee 6d4c29ea9b migrations: dashboard version migration handles nulls
If a dashboard has a null value for updated_by then the migration
for the dashboard version table fails. This change uses coalesce to
set -1 instead of null when inserting into the created_by column
which has a non-null constraint. Fixes #8783.
2017-07-05 22:14:03 +02:00
Daniel Lee ab53b05c39 docs: fixes #8785 2017-07-05 22:14:03 +02:00
Daniel Lee ba1c79b7a8 package.json to v5.0.0-pre1 2017-07-05 22:14:03 +02:00
Daniel Lee de9ebc9a74 packaging: updates for v4.4.0 2017-07-05 22:12:51 +02:00
Daniel Lee 9341412acc release: v4.4.1 2017-07-05 22:06:00 +02:00
Daniel Lee 16cda723d3 migrations: dashboard version migration handles nulls
If a dashboard has a null value for updated_by then the migration
for the dashboard version table fails. This change uses coalesce to
set -1 instead of null when inserting into the created_by column
which has a non-null constraint. Fixes #8783.
2017-07-05 22:06:00 +02:00
Daniel Lee 36a1ab48c5 packaging: updates for v4.4.0 2017-07-05 22:04:27 +02:00
Daniel Lee 3583057155 release: v4.4.0 2017-07-04 23:42:22 +02:00
Jesse White 1940b33dc1 fix: handling of http errors without any data (#8777) 2017-07-04 22:55:13 +02:00
Daniel Lee d20455ab5f changelog: note for histogram fix 2017-07-04 22:45:33 +02:00
Alexander Zobnin 934c0fea6f histogram: improved ticks rendering 2017-07-04 21:49:57 +02:00
Alexander Zobnin c1c1bcb874 histogram: don't cut negative values, issue #8628 2017-07-04 21:49:09 +02:00
Daniel Lee 1da98f5e1e Revert "Histogram fix (#8727)"
This reverts commit 8634c9d457.
2017-07-04 21:48:39 +02:00
Daniel Lee 74093c700f api: adds no-cache header for GET requests
Fixes #5356. Internet Explorer aggressively caches GET requests which
means that all API calls fetching data are cached. This fix adds a
Cache-Control header with the value no-cache to all GET requests to
the API.
2017-07-04 21:26:05 +02:00
Daniel Lee f773a9b4c3 docs: small change 2017-07-04 21:17:43 +02:00
Daniel Lee 205be91a84 changelog: note for DingDing notifier 2017-07-04 15:25:44 +02:00
Liang Jiameng 109fd998ed Add a new notifier : DingTalk (#8473)
* add alerting notifier: DingDing

* add alerting notifier: DingDing

* add dingding unit test

* add dingding unit test

* delete debug code & format code style.

* fix build failed: dingding_test.go
2017-07-04 15:16:32 +02:00
Daniel Lee a5afd8152d docs: small update 2017-07-03 21:32:12 +02:00
Daniel Lee 3ae5f7c632 docs: built-in variables, $__interval
Fixes #8344. Documents the $__interval, $__interval_ms and $timeFilter
variables.
2017-07-03 20:44:19 +02:00
Daniel Lee a71423481b changelog: update 2017-07-03 18:07:51 +02:00
Daniel Lee 20a2334c87 docs: spelling 2017-07-03 14:47:54 +02:00
Ben Tranter 6f4c7a4d65 Add dashboard version history documentation (#8741)
Adds docs for the new API endpoints, and for the dashboard history feature.
2017-07-03 14:29:30 +02:00
Torkel Ödegaard e269b3b2a0 Merge branch 'refactor-basic-diff' of https://github.com/walmartlabs/grafana into walmartlabs-refactor-basic-diff 2017-07-03 09:49:53 +02:00
Alexander Zobnin 1499c2bf74 Fix User/Org default timezone bug (#8748)
* dashboard: don't override timezone if default selected, issue #8503

* dashboard: hide UTC icon immediately after timezone changing
2017-07-03 09:20:55 +02:00
Daniel Lee b8aa203707 signup: fix email sent logic for tempuser
Fixes #8656 and properly sets the email_sent and email_sent_on fields
for a tempuser (signup user).
2017-06-30 20:21:08 +02:00
Ben Tranter 1fd7b60efe Add more information to basic diff logic 2017-06-29 14:38:48 -04:00
Daniel Lee fb99ddf295 influxdb: tweak to help text 2017-06-29 13:58:54 +02:00
Daniel Lee 8683aff3e9 appveyor: build fix for go tests 2017-06-29 12:19:57 +02:00
Daniel Lee 7ea5930a90 alerting: minor fix 2017-06-29 12:18:10 +02:00
Alexander Zobnin 97a7081b57 Fix 8706 (#8734)
* heatmap: fix incorrect time for UTC timezone, fixes #8706

* heatmap: fix tests for time format
2017-06-29 10:40:28 +02:00
Alexander Zobnin 8634c9d457 Histogram fix (#8727)
* histogram: don't cut negative values, issue #8628

* histogram: add percent/count option

* histogram: add tests for values normalizing

* histogram: improved ticks rendering

* histogram: fix default value in axes editor
2017-06-28 17:12:55 +02:00
Daniel Lee 3ac306a72e playlist: fixes #6727. Remember Kiosk mode 2017-06-28 16:29:46 +02:00
Daniel Lee 91ad260517 build: on windows, ignore linux packaging 2017-06-28 09:35:33 +02:00
Daniel Lee 8973b48f96 setting: add tests for windows 2017-06-28 09:35:33 +02:00
Daniel Lee 1a61d2814c docs: updates to build from source 2017-06-28 09:35:33 +02:00
Daniel Lee b674b9dba2 heatmap: small fix for tooltip auto decimals
Closes #8717
2017-06-27 22:25:04 +02:00
Alexander Zobnin 83fbace6b9 heatmap: fix tooltip decimals calculation 2017-06-27 22:24:27 +02:00
Alexander Zobnin 12644372c4 heatmap: fix scaledDecimals calculation (use the same method as in flot.js) 2017-06-27 22:24:27 +02:00
Alexander Zobnin c12a7d7f59 heatmap: adjust tests for fixed decimals calc 2017-06-27 22:24:27 +02:00
Alexander Zobnin 7c840cdf38 heatmap: fix tooltip decimals 2017-06-27 22:24:27 +02:00
Alexander Zobnin b63d2b3279 heatmap: fix Y axis decimals with log scale 2017-06-27 22:24:27 +02:00
Alexander Zobnin 8e5672aee6 heatmap: fix Y axis value rounding with linear scale 2017-06-27 22:24:27 +02:00
Daniel Lee 53ea9cfbcf docs: update ha_setup with alerting deduping 2017-06-27 16:59:40 +02:00
Alexander Zobnin 1deeef9e91 Table panel: add option for preserving text formatting (#8708)
* table_panel: add option for preserving text formatting

* table_panel: fix undefined style error

* table_panel: fix class adding (add space before 'class')

* table_panel: aligin Type options labels
2017-06-27 06:38:49 -04:00
Daniel Lee 10127e8ac9 docs: small updates 2017-06-26 17:42:50 +02:00
Louis Law 8c8b1dde8a [fix] fix minor issue in gitignore file. (#8694) 2017-06-25 11:34:23 -04:00
Denis Doria e8d01218d8 Fix label showing up when Axes are configured to not be displayed (#8697)
This should close the issue #8695
2017-06-25 14:23:37 +02:00
Denis Doria 5aac2d2078 Include user Id on the lookup api (#8698)
Implements feature request #8682
2017-06-25 14:23:03 +02:00
Torkel Ödegaard 60da730c95 mysql: fix for TIME columns, fixes #8534 2017-06-23 12:55:40 -04:00
Torkel Ödegaard 73fcc919cd change: made dashboard save message optional 2017-06-23 11:49:32 -04:00
Torkel Ödegaard be29357d22 fix: added missing url route for annotation state history delete, fixes #8660 2017-06-23 11:48:58 -04:00
Torkel Ödegaard 86a73c359b fix: data source selector did not show, fixes #8692 2017-06-23 11:32:17 -04:00
Ben Tranter a3d22ae9c7 Document logic behind basic diff 2017-06-22 18:23:31 -04:00
Ben Tranter b54b43a42e Add tests for diff formatters 2017-06-22 18:08:37 -04:00
Haidara Mohamed El Mouctar bc6a57ce32 [Docs] Add documentation for max_idle_conn and max_open_conn (#8675) 2017-06-21 10:41:56 -04:00
Daniel Lee 2479e51a6b mysql: Null value should not be considered as previous value
fixes #8655
2017-06-20 02:02:05 +02:00
Torkel Ödegaard 2a93bed453 ux: aligned tabbed view body with header title 2017-06-19 19:22:44 -04:00
Denis Doria eaba985f25 Fix issue with kilovolt-ampere reactive (kvar) #8596 (#8650)
This changes the css to handle overflow of the string on the input fields.
If an overflow happends an ellipsis is used.
2017-06-19 16:23:12 -04:00
Torkel Ödegaard 77136d7a70 Merge branch 'master' of github.com:grafana/grafana 2017-06-19 16:02:31 -04:00
Torkel Ödegaard 8440d2d0a2 fix: fixed search issues with in active mode and keyboard nav 2017-06-19 16:02:16 -04:00
Denis Doria 41d300f69d Fix timeInterval for mysql datasource (#8651)
* Fix timeInterval for mysql datasource

This changes the > to >= and the < to <=, so the intervals are inclusive.
This should fix the #8635

* Fix validation
2017-06-19 08:58:22 -04:00
Alexander Zobnin 9a7e460865 fix heatmap count values bug introduced by #8632 2017-06-18 21:47:08 +03:00
Alexander Zobnin 8626bdfed8 Merge remote-tracking branch 'upstream/master' 2017-06-18 20:59:05 +03:00
Alexander Zobnin 1f4140057b heatmap-tooltip: normalize histogram Y axis 2017-06-18 20:58:13 +03:00
Daniel Lee 0eb297822c httpserver: fixes #8641
Changes to the http_server class meant that the TLS settings were not
getting applied anymore. This fixes so that the minimum TLS version is
1.2 again.
2017-06-17 23:10:12 +02:00
Daniel Lee ad080af38f docs: add tutorial for using API 2017-06-17 20:59:19 +02:00
Salman Jalali 49fdbb3843 Update kbn.js 2017-06-17 06:08:10 +02:00
Torkel Ödegaard 724368d0cd fix: data source dropdown select 2017-06-16 11:43:37 -04:00
Torkel Ödegaard 25f88e9b3a Merge branch 'master' of github.com:grafana/grafana 2017-06-16 10:47:53 -04:00
Torkel Ödegaard 39ffb04be1 Merge branch 'revert-dashboard-search-nav' 2017-06-16 10:47:28 -04:00
Torkel Ödegaard 056c57d551 ux: temporary remove search 2017-06-16 10:47:17 -04:00
Brandon Arp 5d63ad21c1 allow heatmap parsing of scaled datapoints (#8632) 2017-06-16 10:45:52 -04:00
Torkel Ödegaard a49e82e447 ux: revert dashboard search nav change, this is a tempoary change until we redesign the sidenav 2017-06-16 09:47:21 -04:00
Torkel Ödegaard e9c8881d54 Merge branch 'metric-segment-remake' 2017-06-15 15:56:41 -04:00
Torkel Ödegaard 840099bec0 refactor: metric segment remake 2017-06-15 15:56:24 -04:00
Torkel Ödegaard 76c4bfe268 ux: new metric segment is starting to work 2017-06-15 14:03:26 -04:00
Torkel Ödegaard 5f3b5fdcb2 updated 2017-06-15 12:21:12 -04:00
Torkel Ödegaard 6a95df403a refacoring: more work on metric segment replacement 2017-06-14 19:42:45 -04:00
Torkel Ödegaard 380e7e7f04 Merge branch 'master' into metric-segment-remake 2017-06-14 16:17:13 -04:00
Torkel Ödegaard 581b977787 Merge branch 'master' of github.com:grafana/grafana 2017-06-13 18:32:38 -04:00
Torkel Ödegaard c771dd4bd2 ux: metrics tab add query feature 2017-06-13 18:31:43 -04:00
Daniel Lee cb720d8eaf docs: add body options for snapshot api 2017-06-13 23:17:14 +02:00
Torkel Ödegaard 9ff4ab1236 Merge branch 'master' into query_troubleshooting 2017-06-13 16:47:04 -04:00
Daniel Lee 1f92e589e8 exporter: query template var keeps refresh value..
on export if the value is not set to never. Otherwise the template
variable will not be populated with any values.""
2017-06-13 22:42:58 +02:00
Torkel Ödegaard 812ac5cb8e Merge branch 'master' of github.com:grafana/grafana 2017-06-13 13:22:08 -04:00
Torkel Ödegaard 7d642546b3 fix: restore dashboard history version did not reload route correctly when slug did not change 2017-06-13 13:21:22 -04:00
Trent White 192c447c2c create new auth icon for grafana.com so it doesn't share the same file as the main logo (#8581) 2017-06-12 17:17:00 +02:00
Martin Molnar d10d897d65 fix: component name of plugin page contains 'undefined' (#8590) 2017-06-12 15:11:00 +02:00
Daniel Lee 6992b484bc docs: improvements to building the docs readme
Explains that you need to clone the grafana repo if you have not done that already.
2017-06-09 14:27:27 +02:00
Torkel Ödegaard cdd5ba6198 fix: influxdb test data source error handling now works better, fixes #8577 2017-06-08 21:41:58 +02:00
Torkel Ödegaard 6c04057285 Merge branch 'master' of github.com:grafana/grafana 2017-06-08 14:39:39 +02:00
Torkel Ödegaard 217c746445 ux: close edit views when opening panel in edit mode 2017-06-08 14:23:51 +02:00
Torkel Ödegaard 95c8a76aa6 ux: minor search style improvements 2017-06-08 13:56:51 +02:00
Daniel Lee a8e9700334 docs: add whitelist option for auth.proxy 2017-06-08 13:38:18 +02:00
Torkel Ödegaard 50b09f4f10 Merge branch 'master' of github.com:grafana/grafana 2017-06-08 11:54:11 +02:00
Torkel Ödegaard 2c75593c1a refactoring: elasticsearch raw doc size limit option PR, #8527 2017-06-08 11:53:12 +02:00
Torkel Ödegaard 3c41d0477a Merge branch 'master' of https://github.com/mk-dhia/grafana into mk-dhia-master 2017-06-08 11:22:48 +02:00
Daniel Lee f7c48c5a5f singlestat: fix ignoring zero value for table data
When table data returns a column with the value 0, it should not ignore
it. This change checks for undefined instead of if the value is truthy.

Fixes #8531
2017-06-08 11:06:37 +02:00
Daniel Lee c5d5d7ac5a docs: instruction on creating dummy awsconfig
To be able to build the docs an awsconfig file must exist for the Dockerfile to copy. This adds an instruction to create an empty, dummy file so that the build will work.
2017-06-08 10:32:57 +02:00
Torkel Ödegaard 71b62f5cf9 Create README.md 2017-06-08 09:15:10 +02:00
Mitsuhiro Tanda 922073a357 (cloudwatch) add new metrics (#8569) 2017-06-08 07:01:33 +02:00
Michael Ambrose aa3a737fea Updated cloudwatch doc to be more clear on ec2_instance_attribute usage and added Tag selection example 2017-06-07 16:58:01 -04:00
Michael Ambrose f0169656ba Added test to for Cloudwatch EC2 tag selection 2017-06-07 16:53:49 -04:00
Michael Ambrose 525da95f49 Updated cloudwatch plugin to allow specific tag selection
Tags come back from AWS as a key value pair inside an array
This array is now converted to an object
Tags can be selected when using the 'ec2_instance_attribute' query
Example: `ec2_instance_attribute(us-east-1, Tags.Name, { "tag:Grafana": [ "true" ] })`
2017-06-07 16:53:49 -04:00
Torkel Ödegaard 01ff3bbe0a ux: mini css position fix 2017-06-07 22:03:10 +02:00
Torkel Ödegaard 61bdc91272 ux: css fix to search position when sidemenu is pinned 2017-06-07 21:54:55 +02:00
Torkel Ödegaard 08b37186a5 fix: fixed failing sql unit test 2017-06-07 15:42:48 +02:00
Torkel Ödegaard 5225e4283f Update CHANGELOG.md 2017-06-07 14:39:44 +02:00
Torkel Ödegaard e7e675e471 Merge branch 'walmartlabs-master' (Dashboard History Feature, #8472) 2017-06-07 14:30:03 +02:00
Torkel Ödegaard 391dc1e225 dasboard_history: fixed sql integration test 2017-06-07 14:25:46 +02:00
Torkel Ödegaard 46412c8475 dasboard_history: security fix, added orgId filter to dashboard version lookup 2017-06-07 14:21:40 +02:00
Torkel Ödegaard 3ba8aeb9a7 dashboard_history: fix for scenario where reverted dashbord has different title and url must change not just route reload 2017-06-07 14:02:45 +02:00
Torkel Ödegaard 64d620c987 dasboard_history: minor style fix change 2017-06-07 13:50:59 +02:00
Peter Mounce f4debbf501 typo (#8565) 2017-06-07 13:47:08 +02:00
Torkel Ödegaard 56b3c4a3a0 dasboard_history: fixed disabled attribute so it works both by disabling and fixing style, no need for disabled class and disabled attribute 2017-06-07 13:46:36 +02:00
Torkel Ödegaard 577dfee086 dasboard_history: fixed json diff so only dashbord is compared and not the whole dashboard revision object (message and restoreFrom etc was showing up in json diff) 2017-06-07 13:36:03 +02:00
Torkel Ödegaard 8f6c9c5946 dasboard_history: some polish around styles & diff colors, and minor fixes 2017-06-07 12:39:06 +02:00
Torkel Ödegaard ef1dfed0d8 dasboard_history: big refactoring of how the compare api looked, now a POST with a model for new & base version, refactored a simplified UI code as well, this was done to lay foundation to make it possible to do diff against current in browser unsaved version 2017-06-07 11:50:09 +02:00
Torkel Ödegaard 948e5ae74d dashboard_history: further css & markup fixes, removing style overrides & resuing existing styles and markup components 2017-06-06 23:04:14 +02:00
Torkel Ödegaard c4e872b9da dashboard_history: minor changes and fixes 2017-06-06 16:27:28 +02:00
Torkel Ödegaard 7b5f7ed553 dashboard_history: SQL did not work when using MySQL, fixes to dashboard version numbering, so inserts start at 1, added migration to fix old dashboards with version 0 2017-06-06 15:40:10 +02:00
Torkel Ödegaard 5409f4c0eb dashboard_history: fixed issue with save as & overwrite 2017-06-06 14:39:57 +02:00
Torkel Ödegaard 9b629cd5a6 dashboard_history: fixed history srv unit tests 2017-06-06 14:28:21 +02:00
Torkel Ödegaard 546d489dd3 dashboard_history: restored unsaved changes modal to simple cancel, discard, save 2017-06-06 14:27:30 +02:00
Torkel Ödegaard 88da3a99e1 refactoring: trying to remove all the css overrides in history tab and make the styles more more inline with best practice css, and if needed use modifier overrides instead 2017-06-06 11:03:56 +02:00
Torkel Ödegaard 689e366f59 refactoring: updated api url routes so they do not conflict with slug route 2017-06-06 09:51:14 +02:00
Torkel Ödegaard e2061312f5 refactoring: moved compare dashboard version command out of sqlstore, the code in this command did not use any sql operations and was more high level, could be moved out and use existing queries to get the versions 2017-06-06 00:15:40 +02:00
Torkel Ödegaard e43d09e15b fix: fixed failing frontend test 2017-06-05 23:31:45 +02:00
Torkel Ödegaard 746d6cdc88 refactoring: changed name on compare command to make properties more explainatory 2017-06-05 23:29:25 +02:00
Torkel Ödegaard 9c1401849e fix: always show dashboard history for now, need a way to make dropdown more dynamic 2017-06-05 23:14:07 +02:00
Torkel Ödegaard 2a52e25d5b refactoring: removed double error alert, backendSrv is already showing an error alert 2017-06-05 23:06:31 +02:00
Torkel Ödegaard cabbfe9adc refactoring: moved dashboard history item formating (message) and fixed dashboard history migration issue, and removed from frontend tests that where no longer needed 2017-06-05 22:59:04 +02:00
Torkel Ödegaard f18ebea03e fix: dashboard save modals had double submit on enter after my refactoring this morning 2017-06-05 18:01:16 +02:00
Torkel Ödegaard 82d4d54dc5 refactoring: fixed broken unit test in last commit 2017-06-05 17:51:51 +02:00
Torkel Ödegaard c87418d060 refactoring: Dashboard history restore operation is now reusing existing
operations instead of duplicating a bunch of get & save logic.
2017-06-05 17:45:27 +02:00
Daniel Lee 12219cffe0 Merge pull request #8538 from yackushevas/master
misspell: Corrected some misspelled words
2017-06-05 17:21:42 +02:00
Torkel Ödegaard c296ae1178 refactoring: fixing unit tests broken in last commit 2017-06-05 16:52:36 +02:00
Torkel Ödegaard e18007153d refactoring: Renamed dashboard version queries that wrongly had Command suffix, added missing OrgId to dashboard history commands and queries 2017-06-05 16:34:32 +02:00
Daniel Lee 1b79e17970 graph: better generation of y-axis ticks for log-scale
If there are too many ticks generated for the y-axis (which can occur
for log scale 2, with a small y-min and a large max), then the ticks
will be regenerated using larger jumps between the ticks.

This also handles the case when y-min is set to 0. Previously, y-min of
0 was ignored as zero is not a valid value for log scale. Now the tick
generator approximates zero by setting min to 0.1.

Ref #8244

Ref #8516
2017-06-05 15:06:22 +02:00
Torkel Ödegaard fdfcd5cbf0 refactoring:: dashboard save modal and save as modal needed an update 2017-06-05 14:56:11 +02:00
Anton Yackushev bab21c9069 misspell: Corrected some misspelled words 2017-06-05 15:20:34 +03:00
Torkel Ödegaard f3980504e2 Merge branch 'master' into walmartlabs-master 2017-06-05 13:43:00 +02:00
Eirik Nygaard 1efdd92ae8 Update oauth2 lib (#8524)
* Update to latest oauth2 library using govendor

* Follow API changes
2017-06-05 10:09:27 +02:00
Dhia MOAKHAR 7c1dc2444d change size in raw_document from text to number
update query builder and specs
2017-06-04 13:20:58 +00:00
Dan Cech f224fd8310 reduce length of dashboard columns used in compound indexes (#8507) 2017-06-04 14:28:03 +02:00
Tom Gardiner 4fe9935321 Add support for AWS/VPN metrics (#8528) 2017-06-04 14:24:04 +02:00
aykim17 d996275f8f Updated the graphTooltip description (#8532)
I added in a description since there was just TODO there originally.
2017-06-04 14:23:52 +02:00
Torkel Ödegaard d2eca2faa1 ux: new navbar fixes, restored delete option in dashboard dropdown, fixes #8521 2017-06-04 14:18:25 +02:00
Dhia MOAKHAR 045f5e11fc [elasticsearch] Fix bug when switching from "Raw Document" metric type
when switch to "raw Document" metric type we do free all "Group by"
however when we switch back to another type we do not reset the default aggregation (date histogram)
Thus all modification will through exception as no "Group by" is defined and panel should be recreated
the fix will reintialize the "Group by" by setting default value
2017-06-03 02:55:26 +00:00
Dhia MOAKHAR d55cc4e2a3 [elasticsearch] Fix add metric that was not working properly
when selecting Raw Documet metric type, the $scope.target.metrics was replaced by [$scope.agg],
 however the pointer to this variables is shared with metricAggs.
 Instead we free the array and add $scope.agg
2017-06-03 02:50:10 +00:00
Dhia MOAKHAR 966c2912fc [elasticsearch] Add option for result set size in raw_dcument
it allows to specify the result set size in raw_document.
 Example: table  panel could show more (or less) than 500 line if needed.
 Added test to spec
2017-06-02 23:56:48 +00:00
Torkel Ödegaard d47c47853a ux: added css annimations for dash edit views 2017-06-02 15:29:25 +02:00
Torkel Ödegaard 3bea304bab ux: made new search more responsive 2017-06-02 14:19:39 +02:00
Torkel Ödegaard e9d5e037e8 ux: merge branch navbarv2, new navbar with dashboard search available on all pages, closes #6475 2017-06-02 14:00:42 +02:00
sanchitraizada 77c046aac6 Implement review feedback 2017-06-01 17:57:09 -04:00
Torkel Ödegaard 1bdf82dca3 Update CHANGELOG.md 2017-05-31 14:04:19 +02:00
Torkel Ödegaard 6783d1000c Update CHANGELOG.md 2017-05-31 14:04:02 +02:00
Torkel Ödegaard 95a4ec8bf2 Merge branch 'v4.3.x' 2017-05-31 10:55:06 +02:00
Torkel Ödegaard ed4d170bcc build: updated version to v4.3.2 2017-05-31 10:48:16 +02:00
Torkel Ödegaard 812958162a revert: removed lazy loading feature, closes #8500 2017-05-31 10:47:04 +02:00
Torkel Ödegaard cd3807055e chrome: an attempt to fix scroll issue with chrome, but this did not fix the problem as it seems to be caused by some interaction between graph rendering and scrolling, #8494 2017-05-30 13:50:38 +02:00
Pranay Kanwar 26ec874fb1 Frontend query changes corresponding #8336 (#8489) 2017-05-30 09:53:11 +02:00
Dan Cech e4cb103966 remove X-Forwarded-* headers added by nginx when proxying data source & plugin requests (#8418)
* remove X-Forwarded-* headers added by nginx when proxying data source & plugin requests

* properly handle X-Forwarded-For
2017-05-29 13:09:15 +02:00
Torkel Ödegaard 5c1833de1f Merge branch 'master' of github.com:grafana/grafana 2017-05-29 12:21:21 +02:00
Torkel Ödegaard f16e3e38ee Merge branch 'v4.3.x' 2017-05-29 12:20:34 +02:00
Daniel Lee d318c9093f graph: Handle data with zeroes for log scale
fixes #8446. Data with all values equal to zero, creates a max with the
value of Infinite. The for loop for creating ticks then gets stuck in an
infinite loop. This fix resets min and max and creates some fake ticks
for the y-axis if the min and max are not finite numbers.
2017-05-29 12:18:54 +02:00
Dan Cech c95162e067 tweak column lengths for utf8mb4 support on older mysql (#8483) 2017-05-29 12:18:27 +02:00
Torkel Ödegaard 0d865a83bc fix: fixed test data fake metric query, fixes #8474 2017-05-29 12:17:51 +02:00
Victor Azevedo 980b9b5ca0 use fielddata_fields in elasticsearch 2.x queries
Resolves issue #8467
2017-05-29 12:15:51 +02:00
Daniel Lee 371625aeec Merge branch 'v4.3.x' 2017-05-29 11:13:14 +02:00
Daniel Lee beced6f3a6 graph: Handle data with zeroes for log scale
fixes #8446. Data with all values equal to zero, creates a max with the
value of Infinite. The for loop for creating ticks then gets stuck in an
infinite loop. This fix resets min and max and creates some fake ticks
for the y-axis if the min and max are not finite numbers.
2017-05-29 11:12:08 +02:00
Torkel Ödegaard 5e0b03928e Merge branch 'v4.3.x' 2017-05-29 10:49:02 +02:00
Torkel Ödegaard 0d39852ef4 fix: fixed test data fake metric query, fixes #8474 2017-05-29 10:48:38 +02:00
Torkel Ödegaard ab44c7d63e Merge branch 'master' of github.com:grafana/grafana 2017-05-29 08:52:07 +02:00
Torkel Ödegaard ed2092e287 docs: updated alerting docs to make query conditions easier to understand, fixes #8486 2017-05-29 08:51:56 +02:00
Dan Cech c0d5b61403 tweak column lengths for utf8mb4 support on older mysql (#8483) 2017-05-29 08:31:36 +02:00
Dan Cech 7004a84c30 tweak column lengths for utf8mb4 support on older mysql 2017-05-29 08:19:51 +02:00
Anton Yackushev c2885430bd fix "no formatting directive in Fatalf call" (vet) (#8487) 2017-05-29 08:12:54 +02:00
Daniel Lee e65f86147f changelog: note for #8058 2017-05-26 15:56:44 +02:00
Daniel Lee c17d02e496 csv: remove sep metadata as only works for excel 2017-05-26 15:43:09 +02:00
Cédric Reginster ee0d0155a5 Refactor to component based style 2017-05-26 15:43:09 +02:00
Cédric Reginster f484b4c347 Make csv export date time format configurable
- Move export csv options to modal dialog
2017-05-26 15:43:09 +02:00
Daniel Lee 3292a48381 graph: dashes with linewidth fix. Fixes #8469
Adds series override options for dash spaces and dash length.
2017-05-26 15:09:05 +02:00
Dan Cech 8422697199 centralize oauth http calls, validate response status (#8470) 2017-05-26 14:35:32 +02:00
Ricky Moorhouse 665caa8e08 Include triggering metrics to pagerduty alerts
Assist the person receiving the alert in identifying the cause

Based on the slack notifier fields this will include upto 4 triggering
metrics in the custom details section in the pagerduty incident

Fixes #8479
2017-05-26 12:30:56 +01:00
Ben Tranter a927b893ae Use DBSession for getMaxVersion 2017-05-25 23:04:00 -04:00
sanchitraizada e6616cc551 Merge pull request #10 from walmartlabs/version-control
History and Version Control for Dashboard Updates
2017-05-25 14:50:47 -07:00
Torkel Ödegaard 60d5d5fb15 docs: updated changelog 2017-05-25 20:37:01 +02:00
Torkel Ödegaard 68397d342b Merge branch 'patch-1' of https://github.com/goldeelox/grafana into goldeelox-patch-1 2017-05-25 20:34:38 +02:00
Torkel Ödegaard 09267bbfe8 docs: elasticsearch, added info about size property in templating query 2017-05-25 20:11:53 +02:00
Victor Azevedo 0a1c2a7024 use fielddata_fields in elasticsearch 2.x queries
Resolves issue #8467
2017-05-25 11:43:29 -04:00
Ben Tranter b6e46c9eb8 History and Version Control for Dashboard Updates
A simple version control system for dashboards. Closes #1504.

Goals

1. To create a new dashboard version every time a dashboard is saved.
2. To allow users to view all versions of a given dashboard.
3. To allow users to rollback to a previous version of a dashboard.
4. To allow users to compare two versions of a dashboard.

Usage

Navigate to a dashboard, and click the settings cog. From there, click
the "Changelog" button to be brought to the Changelog view. In this
view, a table containing each version of a dashboard can be seen. Each
entry in the table represents a dashboard version. A selectable
checkbox, the version number, date created, name of the user who created
that version, and commit message is shown in the table, along with a
button that allows a user to restore to a previous version of that
dashboard. If a user wants to restore to a previous version of their
dashboard, they can do so by clicking the previously mentioned button.
If a user wants to compare two different versions of a dashboard, they
can do so by clicking the checkbox of two different dashboard versions,
then clicking the "Compare versions" button located below the dashboard.
From there, the user is brought to a view showing a summary of the
dashboard differences. Each summarized change contains a link that can
be clicked to take the user a JSON diff highlighting the changes line by
line.

Overview of Changes

Backend Changes

- A `dashboard_version` table was created to store each dashboard
  version, along with a dashboard version model and structs to represent
  the queries and commands necessary for the dashboard version API
  methods.
- API endpoints were created to support working with dashboard
  versions.
- Methods were added to create, update, read, and destroy dashboard
  versions in the database.
  - Logic was added to compute the diff between two versions, and
  display it to the user.
  - The dashboard migration logic was updated to save a "Version
  1" of each existing dashboard in the database.

Frontend Changes

- New views
- Methods to pull JSON and HTML from endpoints

New API Endpoints

Each endpoint requires the authorization header to be sent in
the format,

```
Authorization: Bearer <jwt>
```

where `<jwt>` is a JSON web token obtained from the Grafana
admin panel.

`GET "/api/dashboards/db/:dashboardId/versions?orderBy=<string>&limit=<int>&start=<int>"`

Get all dashboard versions for the given dashboard ID. Accepts
three URL parameters:

- `orderBy` String to order the results by. Possible values
  are `version`, `created`, `created_by`, `message`. Default
  is `versions`. Ordering is always in descending order.
- `limit` Maximum number of results to return
- `start` Position in results to start from

`GET "/api/dashboards/db/:dashboardId/versions/:id"`

Get an individual dashboard version by ID, for the given
dashboard ID.

`POST "/api/dashboards/db/:dashboardId/restore"`

Restore to the given dashboard version. Post body is of
content-type `application/json`, and must contain.

```json
{
  "dashboardId": <int>,
  "version": <int>
}
```

`GET "/api/dashboards/db/:dashboardId/compare/:versionA...:versionB"`

Compare two dashboard versions by ID for the given
dashboard ID, returning a JSON delta formatted
representation of the diff. The URL format follows
what GitHub does. For example, visiting
[/api/dashboards/db/18/compare/22...33](http://ec2-54-80-139-44.compute-1.amazonaws.com:3000/api/dashboards/db/18/compare/22...33)
will return the diff between versions 22 and 33 for
the dashboard ID 18.

Dependencies Added

- The Go package [gojsondiff](https://github.com/yudai/gojsondiff)
  was added and vendored.
2017-05-24 19:14:39 -04:00
Torkel Ödegaard d1d47b5697 docs: updated changelog with fix for InfluxDB query issue, #8459 2017-05-24 16:49:30 +02:00
Torkel Ödegaard 90871ca12e Merge branch 'v4.3.x' 2017-05-24 16:48:05 +02:00
Torkel Ödegaard 896f849b84 fix: influxdb query editor did no show alias by input field when in text editor mode, fixes #8459 2017-05-24 16:47:38 +02:00
Dhia ac28c4b233 add Referer header to logs. This is useful to link datasource requests to dashboard that originated it (#8399) 2017-05-24 13:47:29 +02:00
Torkel Ödegaard 8b7a0100b1 docs: updated changelog with info on merged PR #8405 2017-05-24 13:46:33 +02:00
Torkel Ödegaard dcf7385cc1 sensu: added input tooltip to source property 2017-05-24 13:44:38 +02:00
joe miller 090594a0bc support setting the source and handler attribute in sensu notifications (#8405)
* support setting the handler attribute in sensu alert notifications

* allow the user to set the source attribute of Sensu notifications
2017-05-24 13:42:24 +02:00
Dan Cech 007c08f2a8 remove X-Forwarded-* headers added by nginx when proxying data source & plugin requests (#8418)
* remove X-Forwarded-* headers added by nginx when proxying data source & plugin requests

* properly handle X-Forwarded-For
2017-05-24 13:39:40 +02:00
Daniel Parks 2d29d7b3d6 Add support for AWS DMS CloudWatch metric (#8458) 2017-05-24 13:24:24 +02:00
Torkel Ödegaard 3133721422 docs: update changelog 2017-05-24 13:23:11 +02:00
Torkel Ödegaard 28bff0c1f3 Merge branch 'v4.3.x' 2017-05-24 13:22:09 +02:00
Torkel Ödegaard b17a1ed557 playlist: fixed dashboard play ordering, fixes #7688 2017-05-24 13:21:43 +02:00
Torkel Ödegaard e6d79dfedf docs: updated changelog 2017-05-24 11:23:41 +02:00
Torkel Ödegaard 5740702cb5 Merge branch 'master' of github.com:grafana/grafana 2017-05-24 11:21:17 +02:00
Torkel Ödegaard a5318def66 Merge branch 'v4.3.x' 2017-05-24 11:20:35 +02:00
Torkel Ödegaard 634ee0f9fa fix: graphg panel logarithmic scale goes blow x-axis, fixes #8244 2017-05-24 11:20:07 +02:00
Prasanna Gautam 6541ffe045 minor change: more accurate variable name (#8449) 2017-05-24 08:38:13 +02:00
Torkel Ödegaard 12c8bf9b18 Update CHANGELOG.md 2017-05-23 16:45:15 +02:00
Torkel Ödegaard d4048e1423 docs: updated download links 2017-05-23 16:18:37 +02:00
Torkel Ödegaard 6257fbced6 docs: updated changelog 2017-05-23 15:54:44 +02:00
Torkel Ödegaard 330cb92b24 Merge branch 'v4.3.x' 2017-05-23 15:52:24 +02:00
Torkel Ödegaard befc15c5a1 fix: s3 image uploads to us-east-1 (us standard) did not return correct image urls so images shared to slack and other services was not correct, fixes #8444 2017-05-23 15:50:22 +02:00
Torkel Ödegaard 3695337980 refactoring: Elasticearch filter label PR #8420 2017-05-23 15:14:23 +02:00
Torkel Ödegaard 648e8a9547 Merge branch 'master' of https://github.com/limefamily/grafana into limefamily-master 2017-05-23 14:48:14 +02:00
Torkel Ödegaard 1e3a42ca68 packaging: added rpm fonts to rpm package dependencies (#8442) 2017-05-23 13:53:03 +02:00
Torkel Ödegaard 21e61319f1 Merge branch 'master' of github.com:grafana/grafana 2017-05-23 13:52:24 +02:00
Torkel Ödegaard 48fdfe721e build: updated master version to 4.4.0-pre1 2017-05-23 13:52:07 +02:00
Torkel Ödegaard 423ad4d36e docs: updated docs 2017-05-23 12:45:15 +02:00
Torkel Ödegaard bd8a0be3aa Update CHANGELOG.md 2017-05-23 12:26:30 +02:00
Torkel Ödegaard d9c6f7a141 release: bumped version to 4.3.0 2017-05-23 11:14:53 +02:00
Torkel Ödegaard 044668a395 login: minor fix to login page 2017-05-23 11:10:16 +02:00
Torkel Ödegaard 90dbd4978b Merge branch 'master' of github.com:grafana/grafana 2017-05-23 10:56:37 +02:00
Torkel Ödegaard 359421b5e8 refactor: sqlstore inTransaction consolidated to one version, fixes #8376 2017-05-23 10:56:23 +02:00
Daniel Lee 73cb035231 mysql: annotation support. Fixes #8382
Simple query editor - a text area with a Show Help section.
Validation for empty query and if the time_sec column is missing.
2017-05-23 09:53:20 +02:00
Matt Toback d47078e27f 2017! 2017-05-22 17:29:24 -04:00
Torkel Ödegaard 5e33b5fcfa docs: updated changelog 2017-05-22 15:39:46 +02:00
Torkel Ödegaard c34db77f04 grafana_com: changed name of oauth grafana_net integration (old settings names still work), and updated login button look, closes #8415 2017-05-22 14:56:50 +02:00
Torkel Ödegaard 7c50563f0f fix: fixed crash when gzip was enabled 2017-05-22 14:09:54 +02:00
Torkel Ödegaard a64c06d02c mysql: add user permission notice mysql config view, closes #8359 2017-05-22 13:53:43 +02:00
Torkel Ödegaard 966cefc8d0 docs: updated changelog 2017-05-22 13:04:59 +02:00
Torkel Ödegaard a0b9dcad4d alert: alerting annotation improvements, fixes #8421 2017-05-22 13:02:49 +02:00
Torkel Ödegaard 370db82238 docs: updated changelog 2017-05-22 10:55:22 +02:00
Torkel Ödegaard 20e631a22d fix: All alert annotations showed up in unsaved/new dashboards graph panels with alert, fixes #8361 2017-05-22 10:49:26 +02:00
Junliang Huang 6d3246e39e docs(readme): remove dev.ini reference (#8419)
remove dev.ini reference as it seems not working anymore.
2017-05-21 10:07:21 +02:00
Joe Handzik d4264cbfc2 Make location for plugins consistent (#8429)
Please let me know if this changed in a more recent version of Grafana, but when using 4.2.0 the manual install directions were off a little (there was no `data/plugins` directory, only a `plugins` directory).

Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-05-21 10:03:57 +02:00
Dave Scott f7215608e9 Update VictorOps notifier w/ auto resolve and image URL (#8431)
* Fixed newline JSON buy in VictorOps integration

* Fixed payload sent to VictorOps so that link displays correctly

* Fixed formatted to resolve go error

* Add auto resolve incidents and image URL to VictorOps notifier
2017-05-21 10:02:48 +02:00
Torkel Ödegaard 7cb6466251 feat: query troubleshooter, improving json explorer 2017-05-20 23:43:59 +02:00
Torkel Ödegaard d840645dd7 feat: metrics tab, minor change 2017-05-20 23:03:04 +02:00
Torkel Ödegaard a8673a2e33 feat: metrics tab 2017-05-20 22:41:34 +02:00
Torkel Ödegaard 4a2c405ac0 feat: metris tab, moved data source selector 2017-05-20 18:35:34 +02:00
Torkel Ödegaard 499e01d832 feat: metrics tab reworking 2017-05-20 18:21:41 +02:00
Torkel Ödegaard 5e090b84ec feat: Copy to clipboard now works in query troubleshooter 2017-05-20 14:52:33 +02:00
Torkel Ödegaard b8aa6a8e47 query: more work on metrics tab changes 2017-05-20 10:48:47 +02:00
Torkel Ödegaard 912301fe24 query: more work on metrics tab changes 2017-05-20 10:14:41 +02:00
Torkel Ödegaard 5909f9ef92 feat: more work on metrics tab reworkings 2017-05-19 21:32:23 +02:00
Torkel Ödegaard 5fcb966297 feat: query troubleshooter progress 2017-05-19 17:35:36 +02:00
Torkel Ödegaard 6ad1a396a5 feat: query troubleshooter 2017-05-19 16:00:01 +02:00
Torkel Ödegaard 5513d3c9d1 feat: moved json-formatter-js into core grafana to be able to make changes 2017-05-19 13:16:05 +02:00
Torkel Ödegaard 878121bb46 fix: templating variable name validation detecting global variable naming wrongly, fixes #8423 2017-05-19 11:14:11 +02:00
Torkel Ödegaard 9045be5689 fix: Prometheus & hidden queries caused no metric query to be issued, fixes #8413 2017-05-19 10:24:47 +02:00
田子宽 9c35d3f87c Add kibana like readable label to elasticsearch query builder 2017-05-19 11:38:28 +08:00
Torkel Ödegaard f7a6c9a1e6 ux: minor change 2017-05-18 17:05:15 +02:00
Torkel Ödegaard f65878c21d ux: working on query troubleshooting 2017-05-18 17:04:31 +02:00
Torkel Ödegaard 78dbb4dc13 config: removed trace level from config comment 2017-05-18 14:19:39 +02:00
Torkel Ödegaard d5481fa0f1 Merge branch 'master' into query_troubleshooting 2017-05-18 14:14:33 +02:00
Torkel Ödegaard 59f3cca135 docs: updated changelog 2017-05-18 14:13:05 +02:00
Torkel Ödegaard 8918922179 alerting: fixed issue with included alerting error & no data reasons, fixes #8412 2017-05-18 14:10:12 +02:00
Torkel Ödegaard 43d5525aaa Merge branch 'master' into alert_state 2017-05-18 13:38:34 +02:00
Torkel Ödegaard fbc3e0371d Merge branch 'master' into query_troubleshooting 2017-05-18 13:38:11 +02:00
Torkel Ödegaard 86ce3d5e45 feat: in app query request & response troubleshooting 2017-05-17 17:02:50 +02:00
Daniel Lee 4182acda58 Merge pull request #8332 from sliceratwork/master
upgrade to Font Awesome 4.7.0
2017-05-17 14:58:14 +02:00
Daniel Lee 16fb7a2e4a Merge pull request #8394 from berghauz/master
Proxy support added to webdav uploader, fixes #7922
2017-05-17 14:49:22 +02:00
Daniel Lee f5118ced4d Merge pull request #8400 from haidaraM/docs-admin
docs: Added requests body for 'Password for User' and 'Permissions'
2017-05-17 14:42:14 +02:00
A78677 ab874cd037 docs: Added requests body for 'Password for User' and 'Permissions' in the admin api documentation 2017-05-17 14:26:27 +02:00
Daniel Lee 540ee35393 timerange: new quick ranges, month and year so far
The new time ranges can also be used for time range overrides in the
override relative time field. E.g. now/M or now/y.
2017-05-17 13:52:39 +02:00
Daniel Lee e61b392916 core: fix linting errors in specs files 2017-05-17 13:47:44 +02:00
Torkel Ödegaard 87f5222907 typescript: fixed issue with tslint in testsW 2017-05-17 13:43:17 +02:00
Torkel Ödegaard d261f33c3d influxdb: influxdb query editor changes 2017-05-17 13:27:56 +02:00
Torkel Ödegaard 972be88569 fix: singlestat gauge sizing issue when panel is very wide, fixes #7773 2017-05-17 11:56:40 +02:00
Torkel Ödegaard fc146fe54e Merge branch 'master' of github.com:grafana/grafana 2017-05-17 11:33:24 +02:00
Torkel Ödegaard 8e03f321eb fix: Elasticsearch table aggregation and support for many aggregations of same type, now uses field name if more than 1 aggregation of same type, fixes #4709 2017-05-17 11:33:08 +02:00
Dan Cech 9dc220b8e2 include error message in email notification (#8392) 2017-05-17 09:51:51 +02:00
berghauz 48cf58e739 Indenting fix 2017-05-17 03:58:18 +03:00
berghauz c713bd9a9a Proxy support added, fixes #7922
Well, i'm really want to see it working in 4.3.0
2017-05-17 02:50:56 +03:00
Torkel Ödegaard 820671d6cc Merge branch 'master' of github.com:grafana/grafana 2017-05-16 16:29:27 +02:00
Torkel Ödegaard 02c79a6389 influxdb: improvements to influxdb query editor, SLIMIT, LIMIT and ORDER BY now added on demand by plus button 2017-05-16 16:28:58 +02:00
Daniel Lee e8b798914d mysql: adds mapping for int/long 2017-05-16 16:07:42 +02:00
Torkel Ödegaard 8b11712f5e fix: Graphite issue with toggle edit mode in query editor, fixes #8377 2017-05-16 14:29:30 +02:00
Torkel Ödegaard f84dc24fcb alerting: improving and fixing alert history, #7257 2017-05-15 16:17:05 +02:00
Torkel Ödegaard f697f81950 sqlite: fixed database table looked handling, now retries up to 5 times, fixes #7992 2017-05-15 12:19:19 +02:00
Torkel Ödegaard fd969bf659 Merge branch 'master' of github.com:grafana/grafana 2017-05-15 10:33:43 +02:00
Konstantin Koniev 9566197620 Internationalise keybindings. (#8311) 2017-05-12 14:59:56 +02:00
Daniel Lee fd5fc0b7ab docs: metadata change for guide post 2017-05-12 14:19:46 +02:00
Daniel Lee fcbe306628 release: version bump for package cloud script 2017-05-12 13:36:42 +02:00
Daniel Lee 88d4fde815 docs: v4.3.0-beta1 updates 2017-05-12 13:36:42 +02:00
Daniel Lee a73f664d54 Update CHANGELOG.md 2017-05-12 13:26:34 +02:00
Daniel Lee 3a892727b3 release version bump 4.3.0-beta1 2017-05-12 11:45:26 +02:00
Daniel Lee a9c535e551 mysql: add some more type mapping
Decimals mapped to floats for now. No mapping for bit or
any of the blob types. Tinyint not mapped to bool.
2017-05-12 11:37:51 +02:00
Torkel Ödegaard 375e60750e docs: updated heatmap docs 2017-05-12 11:14:11 +02:00
Torkel Ödegaard 17198807c9 docs: updated mysql docs 2017-05-12 11:04:54 +02:00
Torkel Ödegaard 910e54d75e Merge branch 'master' of github.com:grafana/grafana 2017-05-11 16:31:31 +02:00
Torkel Ödegaard 5076460254 docs: updated heatmap docs 2017-05-11 16:30:50 +02:00
Torkel Ödegaard 2e7ac8f2da heatmap: fix for unit options width 2017-05-11 15:20:13 +02:00
Mitsuhiro Tanda 5e85558e9e (prometheus) fix graph link (#8349) 2017-05-11 14:24:13 +02:00
Torkel Ödegaard 88672389f3 docs: minor docs fix 2017-05-11 14:16:05 +02:00
Torkel Ödegaard 2c3f3dffa3 docs: updated heatmap panel docs menu name 2017-05-11 13:02:10 +02:00
Torkel Ödegaard 2c5563442f docs: added initial mysql docs 2017-05-11 12:59:49 +02:00
Torkel Ödegaard f976e465c4 mysql: minor improvement for table panel 2017-05-11 11:06:13 +02:00
Torkel Ödegaard 4ce0bf4d16 mysql: improved mysql data source, added test feature when adding data source, fixed cache issue 2017-05-11 10:50:24 +02:00
Torkel Ödegaard ab6740c685 heatmap: Docs and heatmap fixes 2017-05-11 10:19:47 +02:00
Torkel Ödegaard 30b6c3b54a build: fixed heatmap test 2017-05-11 08:56:32 +02:00
Tiantian Gao b2c14b858e Fix http logging time_ms unit is wrong (#8342)
In fact, the unit of `time_ms` int http logging is not "ms", this patch fix it.
2017-05-11 08:53:40 +02:00
Suzana Pescador 8c9cc4fae1 [Bug] Coloring Background on siglestat panel #7242 (#8334)
The bug was happening because the background color was being based on
the rounded value (accounting the user defined decimals). Changed it to
use the pure value (not the rounded) to follow whats being done in the
value color, and also in the table thresholds (they don't consider the
decimals when comparing to thresholds).
2017-05-10 20:02:35 +02:00
Torkel Ödegaard 1d4338ba54 Merge branch 'master' of github.com:grafana/grafana 2017-05-10 17:19:03 +02:00
Torkel Ödegaard 0a68dabb89 heatmap: Fixes & progress on heatmap docs 2017-05-10 17:17:51 +02:00
Suzana Pescador d6eefcb5ce Can't remove default avg column in table #4515 (#8335)
Avg column was being added at every rendering, if the table was empty.
Now the column will be added once as an initialization when selecting a
'timeseries_aggregations' transform.
2017-05-10 15:51:34 +02:00
Pranay Kanwar ee8799de88 Fix dropcounter option, is called dropResets (#8336) 2017-05-10 15:46:19 +02:00
Daniel Lee 4a35126bf6 api: health check returns 503 if db is failing
ref #3302
2017-05-10 15:23:59 +02:00
Daniel Lee f350ae242b Update CHANGELOG.md
ref #7934 
ref #7968
ref #3164
2017-05-10 14:32:18 +02:00
Daniel Lee c21f86f6b4 Update CHANGELOG.md
ref #8277, ref #8250, ref #8262, ref #8165, ref #8093, ref #8056, ref #8043, ref #7970, ref #7914, ref #7864, ref #7750, ref #7740, ref #7697, ref #7619, ref #5619, ref #4030, ref #5278, ref #3302, ref #2524
2017-05-10 13:29:36 +02:00
Torkel Ödegaard d791f902e9 heatmap: more refactoring 2017-05-10 13:05:26 +02:00
Andrei Stefan b054b1faac upgrade to Font Awesome 4.7.0 2017-05-10 09:28:00 +03:00
Torkel Ödegaard acff78d421 Merge branch 'master' into heatmap-refactoring2 2017-05-09 12:41:11 +02:00
Torkel Ödegaard 8bbff2c44e table: refactoring table options, now column styles are in a seperate tab 2017-05-09 12:35:44 +02:00
Torkel Ödegaard e218052a90 fix: fixed slow down issue in table panel by removing the fillter null values feature (#7602), not sure the filter null values is a good table option, should be done in metric query, fixes #8234 2017-05-09 12:07:06 +02:00
Torkel Ödegaard 84141eb14a docs: updated changelog 2017-05-09 08:45:47 +02:00
Torkel Ödegaard 79120a0b1f Merge branch 'master' of github.com:grafana/grafana 2017-05-09 08:33:43 +02:00
Torkel Ödegaard 8d072de556 elasticsearch: changed default terms min_doc_count to 1 and order by to desc, closes #8231 2017-05-09 08:33:37 +02:00
Anton Yackushev fdc97010b4 Rename fielddata_fields to docvalue_fields (#8317)
The parameter fielddata_fields is deprecated and removed in 5.0 https://github.com/elastic/elasticsearch/issues/19027
2017-05-09 07:16:48 +02:00
Torkel Ödegaard 25a267a7ab fix: segment used influxdb naming for variable in options callback, should be more generic 2017-05-08 16:08:53 +02:00
Torkel Ödegaard f168c9e53d table: minor ux options update 2017-05-08 15:57:15 +02:00
Torkel Ödegaard 076a94560b Merge branch 'table-options' 2017-05-08 15:31:29 +02:00
Torkel Ödegaard be284adacc table: more table options refactoring 2017-05-08 15:26:05 +02:00
Torkel Ödegaard 556829eda9 table: began table options redesign 2017-05-08 11:17:29 +02:00
Torkel Ödegaard 823b40a360 docs: added bash and http syntax highlighting 2017-05-08 08:02:08 +02:00
Torkel Ödegaard e2f0b42d90 docs: updated cloudwatch docs, closes #8315 2017-05-08 06:49:55 +02:00
lpavlovi c323d2fc4c Removed panelElemName - appears to not be used anywhere (#8313) 2017-05-07 08:19:08 +02:00
Dan Cech e8fbfce59a remove unneeded import, update docs text 2017-05-05 13:11:44 -04:00
Dan Cech 0f24b45c1a Merge branch 'master' into table-col-alias 2017-05-05 12:41:35 -04:00
Dan Cech 29653d2bec refactor and add column alias tests 2017-05-05 12:40:49 -04:00
Torkel Ödegaard fbf39598b8 heatmp: removed series stats option, lacked tests 2017-05-05 17:33:54 +02:00
Torkel Ödegaard ece21b2d95 heatmap: more refactoring 2017-05-05 17:28:33 +02:00
Torkel Ödegaard dd5a426911 heatmap: refactoring heatmap 2017-05-05 16:15:08 +02:00
Torkel Ödegaard 43c6f74904 heatmap: removed fill background, and highlight card options 2017-05-05 12:33:04 +02:00
Torkel Ödegaard 4412e41738 ux: updated heatmap and alertlist icons 2017-05-05 11:43:42 +02:00
Torkel Ödegaard 5c9810fba4 docs: added in app docs & links to annotation docs 2017-05-05 11:30:44 +02:00
Torkel Ödegaard 2479ad262e ux: updated look of info box 2017-05-05 09:16:28 +02:00
Torkel Ödegaard e75bc5d39a docs: added templating docs link to app 2017-05-05 08:56:19 +02:00
Torkel Ödegaard 6ee11f1172 heatmap: minor update 2017-05-05 07:05:11 +02:00
Torkel Ödegaard f167d459fe Merge branch 'heatmap-refactor' 2017-05-04 19:56:29 +02:00
Torkel Ödegaard 5acabc6ccb heatmap: refactoring 2017-05-04 19:56:20 +02:00
Trent White b4a8678cae remove duplicate paragraph, couple word tweaks 2017-05-04 10:34:19 -04:00
Torkel Ödegaard 61b51c0cbf heatmap: refactoring 2017-05-04 16:03:47 +02:00
Torkel Ödegaard 0390a7c17b docs: fixed docs intro 2017-05-04 12:36:34 +02:00
Torkel Ödegaard 11959f0c4c Merge branch 'master' of github.com:grafana/grafana 2017-05-04 12:13:43 +02:00
Torkel Ödegaard dbcd19bbce docs: minor update to OpenTSDB docs 2017-05-04 12:12:55 +02:00
柯豪 b7a1ff753a update name for AWS credentials (#8287) 2017-05-04 11:44:36 +02:00
Torkel Ödegaard 0bab1fd088 Merge branch 'templating-docs', closes #8243 2017-05-04 11:17:39 +02:00
Torkel Ödegaard cbba692962 docs: influxdb docs update 2017-05-04 11:15:48 +02:00
Torkel Ödegaard e80e0c044b docs: updated elasticsearch docs 2017-05-04 10:19:00 +02:00
Daniel Lee e08188929d docs: update to alert notifications 2017-05-03 22:27:10 +02:00
Daniel Lee b61de0cddc docs: fix API alerting docs 2017-05-03 17:24:27 +02:00
Torkel Ödegaard 287cd83e76 docs: grammarly fixes 2017-05-03 16:34:51 +02:00
Torkel Ödegaard 59fdda6559 docs: minor update to prometheus docs 2017-05-03 15:53:31 +02:00
Torkel Ödegaard ed8d284715 docs: updated prometheus docs 2017-05-03 15:50:38 +02:00
Torkel Ödegaard e6c29391c6 docs: improved Graphite templating docs 2017-05-03 14:20:59 +02:00
Torkel Ödegaard 2304a710bf docs: templating doc wip 2017-05-03 14:09:04 +02:00
Daniel Lee 186a5e9d6f Merge pull request #8274 from sliceratwork/master
Update style guide
2017-05-03 11:04:52 +02:00
Andrei Stefan c57ec23a66 fix broken layout for styleguide icons tab 2017-05-03 11:46:08 +03:00
Torkel Ödegaard b042c53980 ux: updated heatmap icon 2017-05-03 08:56:51 +02:00
Vladimir Gordiychuk deab4a378a bug: MetricSegment lost information about type (#8278)
Fixed #8277
2017-05-03 08:22:30 +02:00
Daniel Lee 44f76fdabc Merge pull request #8275 from jonfreedman/patch-1
chore: add comment to clarify that org_id usage
2017-05-02 17:07:36 +02:00
Jon Freedman 6ebb31bed4 chore: add comment to clarify that org_id usage
As described here: https://community.grafana.com/t/many-to-many-group-dn-org-role-mapping-in-ldap-config/729/2 org_id can be used to allow multiple group_dn's to map to the same org_role provided the org_id differs.
2017-05-02 15:45:48 +01:00
Torkel Ödegaard c1de972eb5 docs: wip templating docs 2017-05-02 16:22:31 +02:00
Andrei Stefan 53ccc6f48f fix theme switching in style guide 2017-05-02 16:45:34 +03:00
Andrei Stefan f43c749422 add plugin authoring tab in style guide 2017-05-02 16:15:28 +03:00
Andrei Stefan ad3da0f47c add icon guide 2017-05-02 15:57:02 +03:00
Dan Cech 665cf55e6e make generic oauth provider flexible enough to handle bitbucket's oauth implementation (#8248) 2017-05-02 14:37:56 +02:00
Daniel Lee b4cfb225cf tech: updates log15 vendor packages
Fixes #8262
2017-05-02 12:47:32 +02:00
Daniel Lee ac6c93b3da docs: add publish bash script 2017-05-02 10:20:09 +02:00
Torkel Ödegaard 0fd96b951a wip: heatmap refactor 2017-05-02 09:55:18 +02:00
Daniel Lee 83c138f575 docs: fix mistake in api docs 2017-05-02 09:39:50 +02:00
rogerswingle 02455753b5 Specify region for s3 (#8251) 2017-05-01 19:22:20 +02:00
Torkel Ödegaard 88dd8af4ce docs: Updates to screencasts & sharing docs 2017-04-28 13:43:00 +02:00
Torkel Ödegaard 4f9f186575 docs: overhauled annotation docs and moved some of the data source specific annotation docs to the respective data source doc pages, closes #1111 2017-04-28 12:51:21 +02:00
Torkel Ödegaard c46b73538c docs: minor update to troubleshooting guide, closes #8242 2017-04-28 11:16:05 +02:00
Torkel Ödegaard 0ac9ec8f7e docs: added restore instructions to backup section in upgrading doc article, closes #5680 2017-04-28 11:05:14 +02:00
Daniel Lee c6d5259c6d changelog: add note for #6564 2017-04-28 11:01:54 +02:00
Torkel Ödegaard 26f4a8e5a4 docs: added links to upgrading article 2017-04-28 10:58:26 +02:00
Torkel Ödegaard a93fa0acde docs: Added general upgrading docs / guide, closes #5905 2017-04-28 10:52:50 +02:00
Torkel Ödegaard b14c3d63e4 docs: added missing white space to config docs, #7073 2017-04-28 09:21:47 +02:00
Dan Cech 2361e2ddd9 fix moment.js deprecation warning when running tests 2017-04-27 15:29:32 -04:00
Dan Cech b1691f1cd1 add support for column aliases in table panel 2017-04-27 15:23:49 -04:00
Torkel Ödegaard 24e3777894 docs: updated make file for docs to support specifying env and version 2017-04-27 12:17:22 +02:00
Torkel Ödegaard f5a6c306a6 docs: worked on supporting doc versions 2017-04-27 09:58:45 +02:00
Mitja Z c92d719a72 added support for listening on unix socket #4030 (#8221) 2017-04-27 08:54:21 +02:00
Yaron de Leeuw d4f7a2bc99 minor code style: use strings.Replace fourth argument in influxdb (#8225)
Remove 5 lines from the codebase and an unecessary function,
by calling `strings.Replace` with -1 for the fourth argument.

A better alternative to what was merged in #8037
2017-04-27 08:51:43 +02:00
Matt Toback b909cfbde4 Refactored Alert Pulse (#8227)
* Moved the animation to the pseudo element which seemed to reduce the CPU usage in an observable way.

* Removed unnecessary style
2017-04-27 08:49:03 +02:00
Torkel Ödegaard a0d8afd435 ux: minor change to styles & heatmap option names 2017-04-26 14:18:58 +02:00
Daniel Lee f23239650e changelog: adds note for #514 2017-04-26 13:25:38 +02:00
Daniel Lee 8f4c797399 docs: update graph docs images + some text changes 2017-04-26 13:19:24 +02:00
Daniel Lee 6707d77af5 graph: dashes option only used in series overrides
Removes dashes option from Display tab so that it is only available
for series overrides. Also removes options for dash space and length
in series overrides and just uses the default values of 10 for both of
them.
2017-04-26 13:19:24 +02:00
smalik 1a3bc60e69 feat(dashed lines): Implementing dashed lines
Adding support for dashed lines using jquery.flot.dashes.js
2017-04-26 13:19:24 +02:00
Torkel Ödegaard 9e13c93379 docs: fixed redirects to panel docs for old location, caused by move in bd414c1793 2017-04-26 13:01:12 +02:00
Daniel Lee dc1178acc8 Merge pull request #8211 from necrolyte2/patch-1
duplicate keys for auth.github for allow_sign_up
2017-04-25 20:26:46 +02:00
Tyghe Vallard 1edeaa5e7e duplicate keys for auth.github for allow_sign_up 2017-04-25 11:11:32 -05:00
Torkel Ödegaard d2a22e7b23 influxdb: fixed template variable interpolation of multi valued variables when using raw query editor mode, fixes #8165 2017-04-25 17:27:57 +02:00
Torkel Ödegaard 19a04b7e4a change: minor change to health check api endpoint 2017-04-25 17:24:36 +02:00
Torkel Ödegaard f6f2d85aa7 change: minor change to health check api endpoint 2017-04-25 17:24:06 +02:00
Daniel Lee 6538e86793 webdav: add tests + path.join for public url param
Fixes #7914. Fixes #7921
2017-04-25 17:22:18 +02:00
fir4 6d9e8bd147 webdav: allow specification of a different public_url than upload url 2017-04-25 17:22:18 +02:00
Torkel Ödegaard 368e847d12 feat: added api health endpoint that does not require auth and never creates sessions, returns db status as well. #3302 2017-04-25 17:17:45 +02:00
Torkel Ödegaard fe64ed424e docs: removed deprecated api #8210 2017-04-25 16:17:05 +02:00
Torkel Ödegaard b780415f25 fix: change to remember me cookie encoding 2017-04-25 15:33:15 +02:00
Daniel Lee aee4af2148 api: omit unused fields for /api/datasources
Fixes #7822
2017-04-25 15:23:36 +02:00
Torkel Ödegaard 4720216e5e tech: upgraded macaron & macaron inject, binding, session 2017-04-25 15:16:32 +02:00
Torkel Ödegaard 9f462c0519 emails: fixed position of logo in emails, fixes #8094 2017-04-25 14:50:53 +02:00
Torkel Ödegaard b08b22192b docs: updated docs with fix info for #7659 2017-04-25 14:29:05 +02:00
Torkel Ödegaard c3bad4701a fix: annotations fix for snapshots, fixes #7659 2017-04-25 14:27:41 +02:00
Torkel Ödegaard 87c978ebc9 fix: better error handling / messsage when testing email notification when stmp is not configured, fixes #8093 2017-04-25 13:16:41 +02:00
Torkel Ödegaard 8beb873db4 docs: updated changelog with #6140 2017-04-25 13:04:22 +02:00
Torkel Ödegaard 8c448d95a1 Merge branch 'master' into mtanda-prometheus_table 2017-04-25 12:59:25 +02:00
Torkel Ödegaard 6ff1144abf refactoring: prometheus PR #6140 2017-04-25 12:57:23 +02:00
Dan Cech b489e93d94 Config Array Syntax (#8204)
* refactor util encryption library so it doesn't have to import log

* add util.SplitString to handle space and/or comma-separated config lines

* go fmt
2017-04-25 09:14:29 +02:00
Torkel Ödegaard d085aaad41 fix: variable srv addVariable function, only used in tests 2017-04-24 17:06:58 +02:00
Torkel Ödegaard 787fea90b9 heatmap: changed name of heatmap data format option, #8054 2017-04-24 15:17:57 +02:00
Torkel Ödegaard ae5e004b69 mysql: time filter macro updated 2017-04-24 14:55:43 +02:00
sbhenderson c485fed744 Fix to issue 2524 by limiting number of returned measurements for display. (#8092) 2017-04-24 11:44:29 +02:00
Daniel Lee 92d723d6f5 docker: remove downloaded temp files from opendata image 2017-04-24 11:40:38 +02:00
Torkel Ödegaard 9e0acdda23 Update ROADMAP.md 2017-04-24 11:28:09 +02:00
Torkel Ödegaard ef36ffb5d0 Update ROADMAP.md 2017-04-24 11:27:59 +02:00
Torkel Ödegaard 48acffe095 Update ROADMAP.md 2017-04-24 11:27:28 +02:00
Torkel Ödegaard 09b7516d47 Update ROADMAP.md 2017-04-24 11:27:05 +02:00
Torkel Ödegaard 16d27a4a8d Update ROADMAP.md 2017-04-24 11:25:44 +02:00
Torkel Ödegaard 663f7ee239 Update ROADMAP.md 2017-04-24 11:24:19 +02:00
Torkel Ödegaard b8259d7583 Create ROADMAP.md 2017-04-24 11:18:34 +02:00
Torkel Ödegaard 2b029912aa mysql: query editor fix 2017-04-24 10:58:53 +02:00
Daniel Lee 7784e4e24b mysql: add datetime type to table data 2017-04-23 21:56:58 +02:00
Daniel Lee 413ee33d5d mysql: fix go vet error 2017-04-23 20:07:20 +02:00
Daniel Lee d1e6f90f92 Merge pull request #8194 from Alexander-N/fix-orgfilter
fix: make organisation filter case insensitive
2017-04-23 19:55:35 +02:00
Torkel Ödegaard 8f17a84f31 mysql: added basic templating support 2017-04-23 14:22:47 +02:00
Torkel Ödegaard 253b8be449 mysql: updated test data 2017-04-23 13:50:49 +02:00
Alexander-N 01fc6da3b2 fix: make organisation filter case insensitive 2017-04-23 12:30:19 +02:00
Daniel Lee fdc68a8baa docker: adds mysqldb with test data
Downloads a large open dataset from NYC Open Data.
Then converts date columns into the mysql format.
2017-04-22 02:01:29 +02:00
Torkel Ödegaard 6ea99540ec Merge branch 'master' of github.com:grafana/grafana 2017-04-21 17:30:37 +02:00
Daniel Lee 6160978019 singlestat: with table data, support string values
If the selected table column is string then show that in the singlestat
2017-04-21 16:54:56 +02:00
Daniel Lee a49ef90a1d singlestat: value mapping for table data
Adds support for value mapping for table data in the single stat panel.
2017-04-21 16:43:14 +02:00
Torkel Ödegaard b22b3e5bb9 mysql: added default query template 2017-04-21 16:28:01 +02:00
Daniel Lee 8874be4c66 singlestat: add support for table data
If data is of type Table, then will return the first row of data. The
user can select which column should be shown in the SingleStat.
2017-04-21 16:17:31 +02:00
Daniel Lee 2c51f11440 singlestat: fix variable spelling 2017-04-21 16:17:31 +02:00
Torkel Ödegaard ea53e7221e mysql: added query help 2017-04-21 15:52:42 +02:00
Torkel Ödegaard 97e2d75f51 mysql: added support for tables in mysql queries 2017-04-21 15:07:43 +02:00
Torkel Ödegaard c78c460f79 mysql: worked on mysql data soruce 2017-04-20 17:10:23 +02:00
Daniel Lee 1bbc149089 docs: document API calls for /auth/keys 2017-04-20 13:59:36 +02:00
Daniel Lee 459d195291 docs: fix link 2017-04-20 13:35:51 +02:00
Daniel Lee 6ec1d16327 fix: cli admin reset-password fixes cmd args
Fixes the homepath and config command line args. This allows the
command to be used even when the homepath is different from the
default.

Fixes #7730
2017-04-20 13:30:17 +02:00
Torkel Ödegaard 50e70cf3db build: fixed unit test 2017-04-20 13:04:42 +02:00
Torkel Ödegaard fc878bc8ad build: fixed order 2017-04-20 11:59:11 +02:00
Torkel Ödegaard 2cb2c4073e build: moved copy node modules ahead of tslint 2017-04-20 11:27:12 +02:00
Torkel Ödegaard 4368c5a896 build: moved copy node modules ahead of tslint 2017-04-20 11:26:30 +02:00
Torkel Ödegaard f1276774a0 typescript: updated tslint and fixed new warnings 2017-04-20 11:16:37 +02:00
raj dutt 98266bd95a Update alerting.md
typo in API URL
2017-04-19 13:19:01 -04:00
Torkel Ödegaard 11806dfa78 mysql: progress 2017-04-19 17:26:37 +02:00
Daniel Lee 1e29d4fcfa docs: adds note in changelog for #8110 2017-04-19 15:07:47 +02:00
Daniel Lee ee3a553800 Merge pull request #8163 from bashgeek/telegram_metrics
Add metrics/matches to Telegram notifications (proposed fix for #8110)
2017-04-19 15:03:03 +02:00
Daniel Schmitz d123b951e9 Fixed parsing error 2017-04-19 17:02:52 +08:00
Torkel Ödegaard e164eba677 mysql: began work on backend macro engine 2017-04-19 10:10:08 +02:00
Daniel Schmitz 7078d5d524 Added metrics/matches to telegram notifications; Added some HTML to beautify 2017-04-19 15:53:23 +08:00
Mitsuhiro Tanda 62d11c147b (cloudwatch) fix dimension value find query (#8159) 2017-04-19 07:12:59 +02:00
Torkel Ödegaard 456b07b766 annotations: removing wip stuff so I can merge to master 2017-04-18 17:28:39 +02:00
Torkel Ödegaard 0bae7212f6 annotations: removed category stuff, my mistake, we need tags 2017-04-18 17:15:22 +02:00
Torkel Ödegaard 73718afb79 annotations: mini fix to event manager 2017-04-18 17:09:06 +02:00
Torkel Ödegaard 809467955a Merge branch 'master' into create-annotations 2017-04-18 17:07:44 +02:00
Torkel Ödegaard db36639ffc fix: #8111 2017-04-18 16:58:34 +02:00
Torkel Ödegaard 3ee886d0fb Merge branch 'query-references' 2017-04-18 16:30:28 +02:00
Torkel Ödegaard 85baa50194 recfactor: added unit test for the new scenario, #8143 2017-04-18 16:30:20 +02:00
Torkel Ödegaard 473006e8cf build: updated grunt watch to explain best usage 2017-04-18 15:36:38 +02:00
Kevin Conaway 5dad324ab7 #8144 Only require root to start/stop grafana (#8145) 2017-04-18 13:49:04 +02:00
Alexander Zobnin 7aa992bde4 initial category types 2017-04-17 18:56:39 +03:00
Alexander Zobnin f0816b37bd rename annotation_category to category 2017-04-17 18:53:10 +03:00
Dan Cech a64e000f1a process this.target separately to fix issues with tests 2017-04-17 11:10:55 -04:00
Dan Cech 715453204e make sure graphite queries containing references are properly updated 2017-04-17 10:47:25 -04:00
Alexander Zobnin 5df82be290 create-annotations: fix missing lodash import 2017-04-17 11:37:23 +03:00
Thomas Szymanski f2dffeb543 Influxdb datasource: fix language in stacking helpful info section (#8134) 2017-04-16 11:56:29 +02:00
Torkel Ödegaard fa2a7db657 ux: create annotations 2017-04-14 23:10:56 +02:00
Torkel Ödegaard 03ef1fd758 refactoring: event / annotation handling in graph panel broken out 2017-04-14 22:56:01 +02:00
Torkel Ödegaard 60ef7d8768 Merge branch 'master' into create-annotations 2017-04-14 22:36:34 +02:00
Torkel Ödegaard aa47b9bf5c refactoring: simplified backend_srv and subUrl handling, #8122 2017-04-14 19:01:08 +02:00
Torkel Ödegaard b77991f69b refactoring: minor changes to #8122 2017-04-14 16:00:52 +02:00
Dan Cech f490c5f12c use X-Grafana-Org-Id header to ensure backend uses correct org (#8122) 2017-04-14 15:47:39 +02:00
Ivan Babrou fb163450a5 Change prometheus semantics from step to min step (#8073)
Previously `Step` parameter would set a hard value for any zoom level.

Now it's renamed to `Min step` and sets the minimal value of `step` parameter
to Prometheus query. User would usually want to set it to the scraping interval
of the target metric to avoid having shap cliffs on graphs and extra load
on Prometheus. Actual `step` value is calculated as the minimum of automatically
selected step (based on zoom level) and user provided minimal step. If user
did not provide the step, then automatic value is used as is.

Example bahavior for `60s` scrape intervals:

* `5s` automatic interval, no user specified min step:
  * Before: `step=5`
  * After: `step=5`
* `5s` automatic interval, `1m` user specified min step:
  * Before: `step=5`
  * After: `step=60`
* `5m` automatic interval, `1m` user specified min step:
  * Before: `step=60` (not really visible, too dense)
  * After: `step=300` (automatic value is picked)

See:

* https://github.com/grafana/grafana/issues/8065
* https://github.com/prometheus/prometheus/issues/2564
2017-04-14 14:51:22 +02:00
Torkel Ödegaard a151de1d37 progess on adding annotations 2017-04-14 14:43:06 +02:00
Torkel Ödegaard 0335c1f368 ux: updated styles a bit 2017-04-14 13:08:03 +02:00
Torkel Ödegaard ea92ddccb3 create annotations progress 2017-04-14 12:46:02 +02:00
Torkel Ödegaard ff426ae9a3 more work on annotations 2017-04-14 12:23:32 +02:00
Torkel Ödegaard dbe5480edc create annotations work 2017-04-14 11:41:02 +02:00
Torkel Ödegaard 2fce88ee62 ux: popover forms 2017-04-14 10:18:49 +02:00
Dan Cech 3a607f96a3 fix bug in log sprintf calls (#8124) 2017-04-14 07:45:36 +02:00
Torkel Ödegaard c68fffcd6d ux: popover forms 2017-04-13 20:28:13 +02:00
Torkel Ödegaard 2f61fc6afe ux: made progress on popover forms 2017-04-13 18:39:49 +02:00
Torkel Ödegaard dbeeb32ab6 Merge branch 'master' into popover-forms 2017-04-13 16:22:08 +02:00
Alexander Zobnin ab99a7c1c7 graph(create annotation): add initial annotation_category table 2017-04-13 16:57:22 +03:00
Torkel Ödegaard dd3e594dd7 fix: scroll issue and positioning of info-popover 2017-04-12 21:20:47 +02:00
Torkel Ödegaard 9c246ba301 docs: fixed http docs for alert notifications, fixes #8105 2017-04-12 20:57:22 +02:00
Alexander Zobnin 2142323da9 graph(create annotation): refactor, AddAnnotationModalCtrl 2017-04-12 21:07:39 +03:00
Alexander Zobnin 17d3970673 graph(create annotation): push one annotation with time from and time to 2017-04-12 21:04:18 +03:00
Alexander Zobnin ef99ff0ad7 graph(create annotation): use single description for range 2017-04-12 20:37:33 +03:00
Alexander Zobnin 8a1c35e1c2 graph(create annotation): refactor, fix two modal after range selection
bind create annotation handler directly to plotclick event, not to global graph-click
2017-04-12 20:27:32 +03:00
Torkel Ödegaard de21be30d2 ux: working on how to show form in popover 2017-04-12 17:28:32 +02:00
Alexander Zobnin eeb998d712 Merge remote-tracking branch 'upstream/create-annotations' into create-annotations 2017-04-12 17:36:40 +03:00
Torkel Ödegaard 593b2ef866 annotation: added region support to annoations 2017-04-12 16:26:34 +02:00
Torkel Ödegaard b867921b3b annotation: cleanup 2017-04-12 15:49:59 +02:00
Torkel Ödegaard 0156a94a49 annotations: you can now read annoations via manually created annoation query 2017-04-12 15:46:41 +02:00
Alexander Zobnin aff6aa081c Merge remote-tracking branch 'upstream/create-annotations' into create-annotations 2017-04-12 16:20:36 +03:00
Alexander Zobnin d2f3d7d138 graph(add annotation): get alerts for all panels 2017-04-12 16:06:48 +03:00
Torkel Ödegaard 78f4bd2de9 Merge branch 'create-annotations' of github.com:grafana/grafana into create-annotations 2017-04-12 15:01:31 +02:00
Torkel Ödegaard 752b42798a annotations: added new options hide toggle, and show option 2017-04-12 15:01:17 +02:00
Alexander Zobnin 232513bb4e graph(add annotation): refactor
pass ctrlKey and metaKey through flot events
2017-04-12 15:26:34 +03:00
Tyndie 20ac8bf83e Set .go tab size to 4 in .editorconfig (#8099)
Tab size was added as 2 in .editorconfig but a tab size of 4 is used
throughout go code base.

This can cause editors such as vscode to automatically reformat open .go
files to tab size 2 from 4.
2017-04-12 10:59:50 +02:00
Torkel Ödegaard 8eb112d119 plugins: refactoring builtIn data source concept, now means data source plugins that you do not need to add via data sources page, that is automatically added as selectable data source, #8095 2017-04-12 08:23:44 +02:00
Torkel Ödegaard e80494390a Merge branch 'always_displayed_datasources' of https://github.com/ctide/grafana into ctide-always_displayed_datasources 2017-04-12 07:44:59 +02:00
Torkel Ödegaard b3df1aa9bd org: fixed issue with orgId query param redirect handling when grafana is under subpath and reverse proxy, fixes #8089 2017-04-12 07:11:08 +02:00
Mitsuhiro Tanda d2bf2e86ed upgrade to aws-sdk-go v1.8.11 (#8091)
* upgrade to aws-sdk-go v1.8.11

* fix test
2017-04-12 06:40:44 +02:00
Torkel Ödegaard 09cec3118f docs: updated go and node version requirements for building, fixes #8097 2017-04-12 06:39:26 +02:00
Chris Burkhart d12dc2bfa7 Add alwaysDisplayed option to datasource plugins, this will allow it to show up as an option to select when adding queries to a panel without actually adding it as a datasource. 2017-04-11 13:47:53 -07:00
Torkel Ödegaard 07466b6725 security: fixed returning info on weither user exists or not in password reset call, fixes #7619 2017-04-11 16:50:16 +02:00
Torkel Ödegaard a109049de4 smpt: Added smtp docker block 2017-04-11 16:41:07 +02:00
Torkel Ödegaard 89a7c2c686 influxdb: validate database exist when saving data source, fixes #7864 2017-04-11 15:05:30 +02:00
Torkel Ödegaard 83e0f69cde Merge branch 'master' of github.com:grafana/grafana 2017-04-11 14:43:40 +02:00
Torkel Ödegaard 9099119f62 grunt: minor watch fix 2017-04-11 14:42:35 +02:00
Torkel Ödegaard 9bdcc4ec5f influxdb: holt winters edits 2017-04-11 14:40:08 +02:00
Torkel Ödegaard e0640487df Update CHANGELOG.md 2017-04-11 13:38:13 +02:00
Daniel Lee 3ca3c96226 profiling: adds profiling and tracing
If grafana-server binary is started with the -profile flag then
tracing will create a trace.out file and pprof data can be accessed
on the 6060 port.

A custom port for pprof profiling can be set with the -profile-port
flag.
2017-04-11 10:32:18 +02:00
Alexander Zobnin f42202e665 Merge branch 'master' into graph-annotations 2017-04-11 10:27:37 +03:00
Alexander Zobnin 70bca219e3 graph(add annotation): Add keybinding for CTRL key 2017-04-11 10:24:21 +03:00
Alexander Zobnin d553498a33 graph(add annotation): initial backend implementation #1286 2017-04-10 20:22:58 +03:00
Torkel Ödegaard 0384eecf5c fix: minor fix for bug when saving alert with empty message, fixes #7927 2017-04-10 15:26:05 +02:00
Daniel Lee 2877ad1a7d docs: manual installation of plugins 2017-04-10 15:01:40 +02:00
Alexander Zobnin 362860f687 graph(add annotation): able to select region (start and stop time) #1286 2017-04-10 12:45:08 +03:00
Davide Setti 997da1b266 fix a typo in the shortcut help modal (#8078)
Collapse all ros -> Collapse all rows
2017-04-10 10:10:32 +02:00
Torkel Ödegaard 337b3295bd docs: updated changelog 2017-04-10 09:45:44 +02:00
Simen Bekkhus 21ae987bcd If earlier dashboard refresh was supressed, force a new one on page becoming visible (#8076) 2017-04-10 09:43:35 +02:00
Alfred Krohmer 41171f8a5c Add a link to a graph image in Pushover notifications (#8075) 2017-04-10 09:17:37 +02:00
Alexander Zobnin 32d34aed7a graph: initial Add Annotation flow #1286 2017-04-08 19:44:40 +03:00
Torkel Ödegaard efca9e904d Merge branch 'mixed_typeahead' of https://github.com/mtanda/grafana into mtanda-mixed_typeahead 2017-04-07 12:17:19 +02:00
Torkel Ödegaard 1cd632cc43 plugins: added state property to plugins 2017-04-07 12:00:03 +02:00
Torkel Ödegaard 26804d630f Merge branch 'master' into sql-proxy 2017-04-07 10:34:51 +02:00
Torkel Ödegaard 3b47efe70e graph: minor change to histogram buckets input field 2017-04-07 10:16:57 +02:00
Torkel Ödegaard 7ec6e84fe8 adhocfilters: minor escape change 2017-04-07 10:08:16 +02:00
Alexander Zobnin 7e14797b10 graph: initial histogram support #600 (#8053)
* graph: initial histogram support #600

* graph histogram mode: add Bars number option

* graph histogram mode: fix X axis ticks calculation

* graph histogram mode: change bar style (align and width)

* refactor(graph): move histogram functions into separate module

* graph histogram mode: rename series to "count"

* graph histogram mode: fix errors if no data

* refactor(graph and heatmap): move shared code into app/core

* graph: add tests for histogram mode
2017-04-07 10:07:30 +02:00
tamayika e6cc5df9d9 Fix restoration of ad-hoc variable value issue (#8057)
* Fix restoration of ad-hoc variable value issue

* Escape delimiters in ad-hoc variable URL

* Remove unnecessary newline
2017-04-07 09:31:36 +02:00
wrp c219498aab Fix typo: "your" -> "your're" (#8064) 2017-04-07 09:29:46 +02:00
Torkel Ödegaard f5f0d94ad4 fix: temp/testing fix for hanging issue, #8033 2017-04-06 13:18:50 +02:00
Calle Pettersson a79102b42d Fix ldap ca_cert example/docs for proper syntax (#8044) 2017-04-06 09:53:11 +02:00
Alexander Zobnin 2b81bfe9bf alerting: fix $timeFilter cannot be used twice (#7969) (#8037) 2017-04-05 17:17:55 +02:00
Alexander Zobnin 308d46e4ef Fix 8013 (#8027)
* Add @ngInject to HeatmapCtrl constructor, issue #8013

* Remove unused loadPluginCss
2017-04-04 11:02:25 +02:00
Torkel Ödegaard 48c4e549f5 Revert "support panel repeat for datasource template variable (#7711)"
This reverts commit 554f972a25.
2017-04-04 09:28:33 +02:00
Torkel Ödegaard dd800fd14d fix: table panel could not show annotations due to bug introduced in 4.2, fixes #8023 2017-04-03 22:07:09 +02:00
Torkel Ödegaard 95e0010a5b fix: sqlite3 and concurrent write requests caused database locked error some times, depending on how many concurrent requests and speed of disk drive. Fixed by reducign the number of concurrent db connections to 1 for sqlite3, fixes #7992 2017-04-03 09:42:11 +02:00
Torkel Ödegaard 4a2efb1007 alerting: removed width restriction on message, fixes #8000 2017-03-31 23:07:57 +02:00
Alexander Zobnin ecd404335e heatmap: fix error with null values in ES converter (#7999) 2017-03-31 17:13:26 +02:00
Torkel Ödegaard f77f8ebfc6 heatmap: changes to color spectrum, inverted some on dark theme 2017-03-31 17:12:50 +02:00
Torkel Ödegaard 3ed1600b90 Merge branch 'master' of github.com:grafana/grafana 2017-03-31 16:09:16 +02:00
Torkel Ödegaard 39e45004cd heatmap: inverted the color schemes 2017-03-31 16:09:00 +02:00
Torkel Ödegaard 4445c9ce60 Merge branch 'heatmap-panel' of https://github.com/alexanderzobnin/grafana into alexanderzobnin-heatmap-panel 2017-03-31 14:26:52 +02:00
Torkel Ödegaard 5af81b974e mysql: graph showing 2017-03-31 13:57:10 +02:00
Torkel Ödegaard a7babfb7cf tech: updated xorm libs 2017-03-31 12:54:39 +02:00
Torkel Ödegaard bd3f825a6e updated go-sql-driver 2017-03-31 12:50:07 +02:00
Torkel Ödegaard e5a5bef200 mysql: minor update 2017-03-31 12:49:05 +02:00
Alexander Zobnin b18ed0b98f heatmap: calculate bucket size automatically for ES histogram 2017-03-31 12:51:43 +03:00
Torkel Ödegaard d6d2080f11 mysql: minor progress on response processing 2017-03-31 11:45:25 +02:00
Alexander Zobnin cb136c07b8 heatmap: add function for bucket size calculation 2017-03-31 11:44:44 +03:00
Torkel Ödegaard af0ecd440f Update CHANGELOG.md 2017-03-31 07:32:44 +02:00
Mitsuhiro Tanda 554f972a25 support panel repeat for datasource template variable (#7711)
* support panel repeat for datasource template variable

* support All option
2017-03-31 07:31:15 +02:00
Alexander Zobnin 9ddfeaa9c2 heatmap: initial ES histogram support 2017-03-30 21:36:36 +03:00
Torkel Ödegaard bd4f073425 mysql: minor update 2017-03-30 20:23:40 +02:00
Torkel Ödegaard 998f04e1e8 mysql: testdata 2017-03-30 20:01:04 +02:00
Alexander Zobnin 3170f0d84a heatmap: add ES histogram converter 2017-03-30 20:55:10 +03:00
Torkel Ödegaard 34d92b0e79 mysql: starting work on test data 2017-03-30 18:03:50 +02:00
Alexander Zobnin 114431beed heatmap: add tests for heatmap_data_converter 2017-03-30 18:21:22 +03:00
timolehto 6e304e6e42 comments: Typos in defaults.ini (#7988) 2017-03-30 17:12:00 +02:00
Torkel Ödegaard 080d2a2054 mysql: reading arbitrary SQL data in go is really strange, data is only in strings? 2017-03-30 13:46:46 +02:00
Kazumasa Kohtaka aada5181fa docs: fix typo in a section describing search API (#7984) 2017-03-30 08:54:32 +02:00
Torkel Ödegaard 00fcaaf171 mysql: commented out old code from old PR 2017-03-29 22:55:37 +02:00
Torkel Ödegaard 8f90c6115d mysql: progress on mysql data source 2017-03-29 22:54:18 +02:00
Torkel Ödegaard 1ecdf34938 sql: wip mysql stuff 2017-03-29 20:43:20 +02:00
Torkel Ödegaard c33fa27ed8 Update latest.json 2017-03-29 17:28:52 +02:00
Torkel Ödegaard 6965064ea9 Merge branch 'master' into sql-proxy 2017-03-29 16:40:14 +02:00
Torkel Ödegaard 91c184d3e0 elasticseach: fixed broken unit test 2017-03-29 16:33:44 +02:00
Torkel Ödegaard 3b235612fd elasticsearch: improve validation and error message when adding/testing elasticsearch ds, #7836 2017-03-29 16:03:28 +02:00
Daniel Lee 5702c57452 panel: remove unneeded options for tooltip 2017-03-29 16:01:27 +02:00
Alexander Zobnin 84b15fc74c Merge branch 'master' into heatmap-panel 2017-03-29 15:46:04 +03:00
Torkel Ödegaard 085c4c56b8 elasticearch: added support for histogram aggregations, closes #3164 2017-03-29 13:44:50 +02:00
Alexander Zobnin 65a829b64d heatmap tests: fix timezone-dependent test error 2017-03-29 13:41:19 +03:00
Alexander Zobnin 7c5b9f8c5b heatmap tooltip: change "values" label to "count" 2017-03-29 12:41:34 +03:00
Seuf 319b8d8fca Configurable signout menu activation (#7968) 2017-03-29 11:33:28 +02:00
Daniel Lee ac39ed4218 panel: fixes #7970. Description tooltip overflow.
This seems to work for the three use cases:

- Overflow on the left
- Overflow on the right
- Elements that are out of view on page load
2017-03-29 11:16:16 +02:00
Alexander Zobnin 7770c38e30 heatmap: test for Y axis rendering 2017-03-29 11:30:30 +03:00
Alexander Zobnin 72e313a3dd heatmap: fix type error on buckets object 2017-03-29 11:29:58 +03:00
Torkel Ödegaard 98554e9fbe docs: added config entry for ldap allow_sign_up option, #7972 2017-03-29 08:42:10 +02:00
Alexander Zobnin ac347fa06a heatmap: fix error while loading panel in editor mode 2017-03-28 18:09:15 +03:00
Alexander Zobnin ece6fd73a1 heatmap: add initial rendering tests 2017-03-28 17:46:10 +03:00
Dan Cech 24d4e50343 utf8mb4 encoding (#7959)
* use utf8mb4 character set for connections to mysql

* use utf8mb4 character set for tables, shorten varchar fields used in unique indexes

* migration type to update table character set

* update table character sets

* set charset for temp_user.status

* gofmt
2017-03-28 14:34:53 +02:00
Jaroslav Hanslík e91a078105 Slack notification should contain fallback text (#7961) 2017-03-28 10:05:44 +02:00
Dan Cech dde8583db8 xorm engine.SetMaxConns is a deprecated alias for engine.SetMaxOpenConns 2017-03-27 18:04:03 -04:00
Alexander Zobnin c9801595e5 heatmap: add heatmap_ctrl tests and fix errors 2017-03-27 19:04:29 +03:00
Daniel Lee 09ec8cdebe Merge pull request #7947 from crmac/docs-whats-new-4.0-fixes
Fix some spelling/grammar/wording problems in What's New in Grafana v4.0
2017-03-27 09:01:09 +02:00
crmacleo 54883e09d5 docs: fix some spelling/grammar/wording issues 2017-03-26 17:27:19 -07:00
Alexander Zobnin 0a56db7745 Add unit tests for heatmap_ctrl. 2017-03-26 18:22:54 +03:00
Alexander Zobnin 0023657701 Fix bucket size calculation if all values are 0; 2017-03-24 15:26:27 +03:00
Alexander Zobnin 96e91b5a0f Move css styles to public/sass/components/_panel_heatmap.scss 2017-03-24 15:15:01 +03:00
Alexander Zobnin 68f5e75eba Move heatmap panel into core grafana. 2017-03-24 14:18:26 +03:00
Daniel Lee 44c9ba2edf docs: add query parameter to api user search
ref #7469
2017-03-23 18:09:14 +01:00
Daniel Lee 08984448d0 Merge pull request #7923 from huydx/patch-1
Update README.md
2017-03-23 17:43:07 +01:00
0x6875790d0a 77ca62b1bc Update README.md 2017-03-24 01:04:18 +09:00
Daniel Lee f45d637025 auth: fix warning in test 2017-03-23 15:52:08 +01:00
Daniel Lee 5773499dba docs: adds note for #6428 2017-03-23 15:33:59 +01:00
Daniel Lee beb85f413a oauth: delete session key instead of set to empty
Adds the Delete function to the Session wrapper so that the Macaron
function for deleting keys from a Session can be used.

https://go-macaron.com/docs/middlewares/session#implement-provider-interface
2017-03-23 15:26:13 +01:00
Daniel Lee 79cef75fed Merge pull request #7426 from Altoros/altoros/authorization-errors
Add common type for oauth authorization errors
2017-03-23 15:25:35 +01:00
Torkel Ödegaard 83d864e7e4 fix: graph and fill below to issue, fixes #7916 2017-03-23 14:23:22 +01:00
Torkel Ödegaard 6828d35480 packaging: build fix 2017-03-23 12:38:42 +01:00
Torkel Ödegaard 887867165c packaging: testing fix 2017-03-23 11:31:47 +01:00
Torkel Ödegaard 7864828e75 packaging: publish nightly builds 2017-03-23 11:10:01 +01:00
Tobias Wolf 68e6700663 Add an After= DB ordering relation to systemd .service (#7903)
In systemd `After=` merely codes an ordering relation and does not start
other units.

Grafana needs to specify that it wants to start up _after_ either of the
supported DB services have started, _if they start_.

Enabling the database services, however, is out of scope for Grafana.
2017-03-22 16:49:35 +01:00
Torkel Ödegaard 8aa00f9227 build: updated publish script 2017-03-22 15:07:24 +01:00
Torkel Ödegaard b404f32a09 docs: updated download links 2017-03-22 14:26:57 +01:00
Daniel Lee 01f646c191 docs: adds 4.2.0 release date 2017-03-22 14:06:53 +01:00
Torkel Ödegaard 7dd09d4185 Update CHANGELOG.md 2017-03-22 10:51:06 +01:00
Matt 578ba9bbd5 Added scientific notation as a unit for #7763 (#7781) 2017-03-22 10:49:31 +01:00
Torkel Ödegaard 362a349d9f cloudwatch: added #7892 to changelog 2017-03-22 07:20:46 +01:00
gomlgs e99137598e Cloudwatch: Correctly obtain IAM roles within ECS container tasks. (#7892)
We now obtain credentials based on the container task's role
rather than just relying on the credentials of the enclosing
container instance.

Fixes #6700.
2017-03-22 07:15:19 +01:00
Trent White 5ed7d65b0e orange grafana.com seemed too much. making it gray 2017-03-21 13:13:35 -04:00
Torkel Ödegaard b21ad3c376 Merge branch 'master' of github.com:grafana/grafana 2017-03-21 17:10:54 +01:00
Trent White a510d85480 format css 2017-03-21 11:17:28 -04:00
Trent White 182a30e22c style tweak 2017-03-21 11:16:42 -04:00
Trent White d4f2f41088 add dashboard and plugin icons to plugin list and dash search 2017-03-21 11:12:58 -04:00
Daniel Lee 69bec98962 chore: update all grafana.org urls to .com 2017-03-21 15:37:55 +01:00
Daniel Lee b9940e618c profile: locks login fields if disable_login_form
If the auth config variable, disable_login_form, is set to true then
the username and email fields are set to read-only on the profile page.

The reason for this is so that the user does not lock themselves out by
changing their email address or username. Or create a new user by
changing both.

ref #7810
2017-03-21 14:42:32 +01:00
Torkel Ödegaard 0c372f0b85 Merge branch 'v4.2.x' 2017-03-21 10:36:40 +01:00
Torkel Ödegaard 99064603a4 packaging: added rpm posttrans script to fix config file change, fixes #7686 2017-03-21 10:36:15 +01:00
Daniel Lee 5ecc8a171f template: fix validation for required selects
Since upgrading to Angular 1.6.1, selects with a default empty option
no longer show a popup with an error on submit. This fix adds an
empty option that is then removed with ng-if. Having the default
option set to null or undefined seems to be the cause of the bug.

The list of changes in 1.6 is here but could not find any obvious
cause for this bug:

https://docs.angularjs.org/guide/migration#migrating-from-1-5-to-1-6
2017-03-21 10:31:42 +01:00
Daniel Lee 3d3357ee41 docs: add note for #7614 2017-03-20 23:14:33 +01:00
Daniel Lee 94498d533b template: fix validation for required selects
Since upgrading to Angular 1.6.1, selects with a default empty option
no longer show a popup with an error on submit. This fix adds an
empty option that is then removed with ng-if. Having the default
option set to null or undefined seems to be the cause of the bug.

The list of changes in 1.6 is here but could not find any obvious
cause for this bug:

https://docs.angularjs.org/guide/migration#migrating-from-1-5-to-1-6
2017-03-20 22:51:55 +01:00
Daniel Lee 65910db991 template: tweak to warning message 2017-03-20 17:14:24 +01:00
Torkel Ödegaard c1c241698a Merge branch 'master' of github.com:grafana/grafana 2017-03-20 16:05:13 +01:00
Torkel Ödegaard adf7645bf5 docs: added alias 2017-03-20 16:04:57 +01:00
Daniel Lee e527aebbf1 Merge pull request #7758 from thuck/template_self_reference_7614
Validate query to avoid self-reference of variable #7614
2017-03-20 15:33:48 +01:00
Torkel Ödegaard f78a28395d s3: support for alternative s3 bucket url syntax, closes #7871 2017-03-20 14:11:37 +01:00
Torkel Ödegaard be5c4f47a6 s3: support for alternative s3 bucket url syntax, closes #7871 2017-03-20 14:10:44 +01:00
Torkel Ödegaard 3f76d76be6 Merge branch 'v4.2.x' 2017-03-20 13:39:53 +01:00
Torkel Ödegaard 122b4695e7 Update CHANGELOG.md 2017-03-20 13:37:55 +01:00
Andrii Skomorokhov f2e4269242 Fixed position of tooltip with description at graph. (#7854) 2017-03-20 13:36:00 +01:00
Torkel Ödegaard 711081950e lib: updated dependency, fixes #7579 2017-03-20 13:30:22 +01:00
Torkel Ödegaard dce63ec1d8 docs: updated changelog 2017-03-20 11:40:06 +01:00
Torkel Ödegaard 54c6699c2b usermanagement: disable invite features when login form is disabled, cherry picked from master, #7875 2017-03-20 11:37:33 +01:00
Torkel Ödegaard 970619ed52 Merge branch 'disable-login' 2017-03-20 11:18:41 +01:00
Torkel Ödegaard 6f324cd794 refactor: minor refactorings of #7876 2017-03-20 11:18:29 +01:00
Torkel Ödegaard 4d4e165be7 links: updated links from grafana.net to grafana.com 2017-03-20 10:20:32 +01:00
Mitsuhiro Tanda a67497e679 add new s3 metrics (#7846) 2017-03-20 09:09:08 +01:00
Jens L 5785bfe0cc Add more information for generic oauth2 (#7880)
Add reference to OpenID's userinfo_endpoint (as in #6351)
2017-03-20 08:36:43 +01:00
Denis Doria 87027b0f77 Do not collapse if there is only 1-3 queries #7836 (#7878)
Also has the side effect of new panels having not collapsed queries when
being created
2017-03-18 15:23:40 +01:00
Torkel Ödegaard 50718b592c docs: added aliases 2017-03-18 08:25:26 +01:00
Dan Cech 51bdb60296 fix docs.grafana.org/plugins 2017-03-17 18:41:02 -04:00
Dan Cech 737c29ec8c disable inviting new users to orgs if login form is disabled 2017-03-17 16:35:05 -04:00
Torkel Ödegaard aaf013b360 Merge branch 'master' of github.com:grafana/grafana 2017-03-17 19:33:38 +01:00
Torkel Ödegaard 19516ebcce docs: minor fix 2017-03-17 19:33:31 +01:00
Andrii Skomorokhov 5cb51631db Fixed position of tooltip with description at graph. (#7854) 2017-03-17 11:48:28 +01:00
Daniel Lee 76fa363613 Merge pull request #7867 from pandurang90/opsgenie_typo_fix
Typo fix for OpsGenie
2017-03-17 10:31:47 +01:00
Pandurang Waghulde f3cce7efc9 typo fix for OpsGenie 2017-03-17 12:57:52 +05:30
Daniel Lee 38cab50a0c Merge pull request #7843 from gkman/patch-1
Update alerting.md
2017-03-16 12:41:03 +01:00
Torkel Ödegaard 7856e2f16b fix: metrics_panel and time range issue introduced earlier today, fixes #7849 2017-03-16 12:20:23 +01:00
Torkel Ödegaard 32f89f65da fix: Data source group by time interval did not take effect on initial query after dashboard load, fixes #7839 2017-03-16 09:54:33 +01:00
Gregory Kman e9ad71abed Update alerting.md
Add missing `"`
2017-03-15 12:00:03 -05:00
Torkel Ödegaard 0b73369c4b docs: fixed docs title issue 2017-03-14 12:21:22 +01:00
Torkel Ödegaard b05fca4fd7 Merge branch 'master' of github.com:grafana/grafana 2017-03-14 11:07:37 +01:00
Torkel Ödegaard 23954f775b Update ISSUE_TEMPLATE.md 2017-03-14 09:46:32 +01:00
Torkel Ödegaard f42ef5fe17 Update ISSUE_TEMPLATE.md 2017-03-14 09:44:19 +01:00
Torkel Ödegaard 69ff97305f Update ISSUE_TEMPLATE.md 2017-03-14 09:44:09 +01:00
Torkel Ödegaard 967cdd73e1 Update ISSUE_TEMPLATE.md 2017-03-14 09:43:50 +01:00
Torkel Ödegaard 9e27b8ee47 Update README.md 2017-03-13 23:05:47 +01:00
Torkel Ödegaard 98b65641c3 Update README.md 2017-03-13 23:05:04 +01:00
Torkel Ödegaard 0bb8a920ca Update README.md 2017-03-13 21:32:28 +01:00
Torkel Ödegaard b471e7e448 updated 2017-03-13 20:17:46 +01:00
Torkel Ödegaard e189400f7c Merge branch 'master' into rebrand-docs 2017-03-13 20:14:02 +01:00
Daniel Lee b93a2887a8 docs: add note for #3090 2017-03-13 11:44:02 +01:00
Daniel Lee 84ef6b9d48 Merge branch 'bigbenhur-autologscale'
Closes #5278 and closes #3090
2017-03-13 11:17:45 +01:00
Denis Doria 891df21969 Small fix for the Y-Max/Y-Min inputs on Axes (#7811) 2017-03-13 09:32:36 +01:00
Daniel Lee 77921c4dcd renderpng: fixes invalid image link (#7797)
Closes #7770
2017-03-13 09:31:59 +01:00
Jan Rückert 8637207b55 Change 60-day date range back to 90 days (#7803) 2017-03-11 16:17:35 +01:00
Daniel Lee 2580b61088 docs: adds note for #7663 2017-03-11 14:05:25 +01:00
Daniel Lee 6799b766a4 Merge pull request #7775 from hagen1778/prometheus-textarea-query
Make Prometheus query field a textarea #7663
2017-03-11 14:00:37 +01:00
Torkel Ödegaard 25318f5848 Merge branch 'master' into rebrand-docs 2017-03-11 12:36:58 +01:00
Daniel Lee e19b48840f graph: merge fixes for #5278
This is an old PR so had some problems after merging in master.

- Fix for min and max that were not getting passed into the
applyLogScale function
- Fix for when min/max were undefined rather than null
- Fix for decimal ticks, as this PR populates the ticks itself then
it also needs to calculate the number of decimal places too. Flot
was showing the wrong number of decimal places sometimes otherwise
on the y-axis.
2017-03-10 18:46:36 +01:00
Daniel Lee 28cf229707 Merge branch 'autologscale' of git://github.com/bigbenhur/grafana into bigbenhur-autologscale 2017-03-10 11:57:00 +01:00
Daniel Lee 22553b154a docs: add note for #7799 2017-03-10 10:41:30 +01:00
Daniel Lee 9b806bc209 Merge pull request #7799 from thuck/influxdb_limit_fix_glow
Small fix for the "glow" when focus the field for LIMIT and SLIMIT
2017-03-10 09:12:53 +01:00
thuck 58afb1c7d6 Small fix for the "glow" when focus the field for LIMIT and SLIMIT 2017-03-09 21:22:40 +01:00
Daniel Lee 74c795b294 panel: use meta.soloMode instead of url check
when checking if rendering a png for lazy loading of panels.
2017-03-09 16:55:16 +01:00
Daniel Lee c176de89c9 docs: add notes for #6065 #7232 and #5216 2017-03-09 14:31:27 +01:00
Daniel Lee a30cf204d7 influx: small ux changes to query editor 2017-03-09 14:18:36 +01:00
Torkel Ödegaard 835d420294 alerting: fixed width of query component in alert tab 2017-03-09 12:57:58 +01:00
Torkel Ödegaard 952cc1d883 alerting: fixed width of query component in alert tab 2017-03-09 12:56:49 +01:00
Daniel Lee 2f5814d51c Merge pull request #7735 from thuck/influxdb_limit
Included LIMIT, SLIMIT and ORDER BY time for influxdb. closes #6065 and closes #7232
2017-03-09 09:23:04 +01:00
Torkel Ödegaard 7f8a3a0a2d dashboard: lazy loading panels as they become visible,fix, removed debunce #5216 2017-03-09 09:08:34 +01:00
Torkel Ödegaard aee8f0b75e opentsdb: fix for OpenTSDB and multi value template variable in metric field, fixes #7754 2017-03-09 08:28:31 +01:00
Torkel Ödegaard b272f5144a fix: graphite query ctrl, removed unnesserary check for empty paths, fixes #7740 2017-03-09 07:31:00 +01:00
Torkel Ödegaard 073dec8ba8 Merge branch 'master' of github.com:grafana/grafana 2017-03-09 07:06:04 +01:00
Torkel Ödegaard bb2eb00b0e minor data source edit form improvement 2017-03-09 07:05:49 +01:00
Mitsuhiro Tanda be123a07c5 (prometheus) adjust annotation step (#7768)
* (prometheus) adjust annotation step

* (prometheus) add step option
2017-03-09 06:53:50 +01:00
hagen1778 04d90d7139 Make Prometheus query field a textarea #7663 2017-03-08 21:30:20 +02:00
thuck b8a82827b9 Fix ORDER BY to look like GROUP BY 2017-03-08 20:22:01 +01:00
Daniel Lee 588955c752 Merge branch 'jifwin-load_on_Scroll' 2017-03-08 19:06:59 +01:00
Daniel Lee bd348a47c7 panel: update to #7452 panel loading on scroll
Moves the logic up a level to the panel_ctrl. This cleans up the code
and makes the lazy loading available for all panels.

Removes the config option and making this default behavior. We can
add back the config option if we get feedback that it is needed during
the beta phase of the v4.3.0 release.

Unbind the scroll handler on panel destroy to avoid memory leaks.

Fix for png rendering, it did not match all forms of dashboard-solo.
e.g. /render/dashboard-solo/db...

Fix for when taking a snapshot. All the panels get refreshed then
even the panels that are not visible.

Closes #5216.
2017-03-08 19:02:45 +01:00
Daniel Lee 4f06202e9a build: bumped version to 4.3.0 2017-03-08 17:10:51 +01:00
Daniel Lee 61844cb0da Merge branch 'master' into v4.2.x 2017-03-08 17:09:33 +01:00
Daniel Lee 5037dae959 docs: move #7469 to v4.2.0 2017-03-08 17:09:08 +01:00
Daniel Lee dc6d55a59f docs: changelog for 4.2.0
Adds notes for:
- ref #7694
- ref  #7681
- ref #7736
- ref #7743
- ref #7696
- ref #3536
- ref #6365
- ref #7591
- ref #7276
- ref #7723
- ref #7739
- ref #7680
2017-03-08 11:16:14 +01:00
thuck 1cf569ac8e Fix tabs vs space 2017-03-08 08:25:32 +01:00
thuck 555acacd6d Validate query to avoid self-reference of variable #7614 2017-03-07 23:29:16 +01:00
Daniel Lee 9efb6e76e9 users: adds search and pagination (#7753)
ref #7469. Follow up change that adds proper paging with 50 results
per page as well as a search box to search by name, login or email.
2017-03-07 16:03:54 +01:00
Daniel Lee 08b2edf98c Merge branch 'load_on_Scroll' of git://github.com/jifwin/grafana into jifwin-load_on_Scroll 2017-03-07 15:58:14 +01:00
Torkel Ödegaard 140a0982e8 Merge branch 'master' into v4.2.x 2017-03-07 13:12:59 +01:00
Daniel Lee 8e3f22d307 docs: adds note about closing #7695 2017-03-07 11:23:57 +01:00
Daniel Lee 4ee262fe65 Merge pull request #7720 from mitjaziv/cubic_decimetre
added cubic decimetre - dm3 #7695
2017-03-07 10:41:27 +01:00
Ross Lodge 70c2586c80 Use other variable dependencies in regex filter for datasource variable (#7547) 2017-03-07 08:39:19 +01:00
Joseph Pintozzi a37a2259b3 Allowing "Unique Count"s of any data type (#7704) 2017-03-07 08:36:33 +01:00
Mitsuhiro Tanda a24ac012c4 support full resolution for $interval variable (#7696) 2017-03-07 08:35:29 +01:00
Patric Kanngießer 3735a1ace7 remember scroll position (https://github.com/grafana/grafana/issues/7680) (#7728) 2017-03-07 08:19:34 +01:00
Wouter Smit 125ee865b6 Spelling mistake (#7739) 2017-03-06 21:08:45 +01:00
Mitsuhiro Tanda b387a8759e use session.NewSession() (#7745) 2017-03-06 21:08:16 +01:00
Pranay Kanwar 6ab90425c4 Pass dropcounter rate option if no max counter and no reset value or reset value as 0 is specified (#7743) 2017-03-06 16:19:37 +01:00
Torkel Ödegaard c3202d3f99 sessions: start session gc at startup but only after between 10 - 180 seconds 2017-03-06 12:23:28 +01:00
Torkel Ödegaard ebdd35d799 Merge branch 'master' of github.com:grafana/grafana 2017-03-06 11:52:07 +01:00
Torkel Ödegaard 9f1c6a73f0 tech: added sql logger to log all sql statements sent to sql server 2017-03-06 11:51:35 +01:00
Denis Doria 31866b5e57 Allow commas on template variable #7681 (#7732)
This improvement allows to wrap an "expression" when using single or
double quotes. So now you can have time interval with offset for
influxdb.
2017-03-06 08:37:49 +01:00
Torkel Ödegaard 6af62abd41 docs(): added router_logging to configuration options, closes #7723 2017-03-06 08:26:36 +01:00
Denis Doria 0264fcc66c Remove unsaved dialog when removing a dashboard #7591 (#7733) 2017-03-06 07:49:28 +01:00
Denis Doria e71b13d9fa Improve regex detection for influxdb measurement #7276 (#7734) 2017-03-06 07:47:50 +01:00
thuck c3eb9da160 Finish query builder for LIMIT, SLIMIT and ORDER BY time #6065 2017-03-05 23:41:16 +01:00
thuck f577dd0f38 Including LIMIT, SLIMIT and ORDER BY time on influxdb #6065
Initial work for the query builder interface
2017-03-05 23:13:46 +01:00
Mitja Zivkovic 7ace2463a4 added cubic decimetre - dm3 #7695 2017-03-03 14:27:15 +01:00
bergquist fe970f6629 docs: adds note about closing #7676 2017-03-03 11:09:05 +01:00
bergquist 26bb9ad399 build: use initial checkout within container
speedup and simplify the build within the container
2017-03-03 11:07:05 +01:00
Carl Bergquist f185c2c953 Merge pull request #7676 from dbrgn/threema-emoji
feat(alerting): Add emoji to Threema alert notifications
2017-03-03 11:04:49 +01:00
bergquist 55e0df7896 docs: adds note about closing #7710 2017-03-02 14:01:06 +01:00
bergquist ee190d57eb webhooks: get proxy settings from ini file
closes #7710
2017-03-02 13:58:50 +01:00
bergquist 412b8998a8 webhooks: get proxy settings from ini file
closes #7710
2017-03-02 13:57:28 +01:00
bergquist 473513aa2f docs: how to configure alert notification links 2017-03-01 17:19:34 +01:00
jifwin c09cd4ba29 make load on scroll configurable and use debouce 2017-03-01 15:02:59 +00:00
Carl Bergquist 824357ed3b Merge pull request #7694 from rickard-von-essen/patch-1
Added some details about Sessions in Postgres
2017-03-01 12:17:25 +01:00
bergquist 06146b801c build: replace sha1 files with sha256
due to security reasons.
https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html
2017-03-01 11:44:53 +01:00
Rickard von Essen 573bcdde12 Added some details about Sessions in Postgres 2017-03-01 11:35:12 +01:00
bergquist 62eb19a186 template: dont allow template variables to begin with '__'
closes #7678
2017-02-28 17:08:38 +01:00
bergquist 6b1dd1c7fc changelog: adds note about closing #7678 2017-02-28 17:08:17 +01:00
bergquist 9b6571fab1 template: dont allow template variables to begin with '__'
closes #7678
2017-02-28 17:04:47 +01:00
bergquist 1631c8de95 build: use correct version for tar.gz files 2017-02-28 09:15:06 +01:00
bergquist 3ef077c180 build: use correct version for tar.gz files 2017-02-28 09:09:49 +01:00
Danilo Bargen 1422655e97 feat(alerting): Add emoji to Threema alert notifications
This commit prepends emoji to Threema alert notifications to make it
easier to discern various notification types (e.g. alert, no data, ok).
2017-02-27 17:10:52 +01:00
bergquist 7d897c0980 build: add docker trigger for release builds 2017-02-27 13:26:53 +01:00
bergquist 86789c0b69 docs: update docs for 4.2.0 beta release 2017-02-27 12:44:55 +01:00
bergquist a763285daa updates script for packagecloud 2017-02-27 11:05:05 +01:00
Torkel Ödegaard d2dac02a28 Revert "ES Nested type bucket aggregation (#4694) (#4694)"
This reverts commit 8087af9c89.
2017-02-27 10:57:44 +01:00
Archit Sharma 8087af9c89 ES Nested type bucket aggregation (#4694) (#4694)
* (elasticsearch): add nested agg (use bucket aggs). fixes #4693

* (elasticsearch): rebased after merge of #6043 refactored from #4527
2017-02-27 10:57:00 +01:00
bergquist ffe0ecfaaa release 4.2.0 beta1 2017-02-27 10:33:26 +01:00
bergquist 05952688c5 tech: avoid using http.DefaultClient 2017-02-24 17:22:12 +01:00
bergquist 03354bc49a tech: replace context.TODO with background ctx 2017-02-24 09:20:28 +01:00
Torkel Ödegaard e73b306e0c fix(templating): fixed duplicate dashboard refresh when changing template variable, #7654 2017-02-24 08:16:37 +01:00
bergquist 46ac8c098f changelog: adds note about closing #7482 2017-02-24 07:42:30 +01:00
Carl Bergquist 5d3da99806 Merge pull request #7482 from dbrgn/master
Alerting: Add Threema Gateway integration
2017-02-24 07:40:36 +01:00
bergquist 785cecac26 changelog: adds note about closing #7526 2017-02-24 07:35:45 +01:00
Carl Bergquist bef216b6f4 Merge pull request #7526 from Mic92/master
Add Pushover alert notifications
2017-02-24 07:32:59 +01:00
bergquist 67b8b9743b changelog: note about closing #7602 2017-02-24 07:30:47 +01:00
Carl Bergquist 3ef1a60647 Merge pull request #7602 from Altoros/suppress-empty-results-in-table-plugin
Added suppressing of empty results to table plugin
2017-02-24 07:28:59 +01:00
Torkel Ödegaard d6eaaf3add refactor: minor refactoring 2017-02-23 15:57:36 +01:00
Mitsuhiro Tanda 68bb417db9 support [[var]] in cloudwatch datasource (#7649)
* support [[var]] form in cloudwatch datasource

* support multi variable in single dimension

* fix test
2017-02-23 15:02:35 +01:00
bergquist d88286ab81 orgs: set orgId as query param on load
ref #1613
2017-02-23 11:03:39 +01:00
Mitsuhiro Tanda 988ed06970 typeahead support in mixed datasource selection 2017-02-23 00:48:16 +09:00
bergquist 73830a44fe sharemodal: fixes broken unittests 2017-02-22 14:29:49 +01:00
bergquist fe223cbc96 changelog: adds note about closing #1613 2017-02-22 14:04:01 +01:00
bergquist fdb06c7c10 sharing: set orgId as query parameter when sharing a dashboard
to make sure an user opens the dashboard in the correct org, orgId will
always be added when sharing a dashboard. if the users current orgId
doesnt match the query parameter grafana will change it and redirect the
user.

closes #1613
2017-02-22 13:56:06 +01:00
bergquist dea2e5d743 changelog: adds note about closing #6948 2017-02-22 11:24:06 +01:00
bergquist 607ee635d1 alerting: adds deduping of alert notifications 2017-02-22 10:52:01 +01:00
Carl Bergquist b4fd6f2d45 Merge pull request #7632 from grafana/alerting_notification_dedupe
alerting: dedupe alert notifications when running multiple servers
2017-02-22 10:48:41 +01:00
bergquist c1d69358ba changelog: adds note about closing #552 2017-02-22 10:39:52 +01:00
bergquist 9ed1d12cc0 style: use for loops over _.each in typescript 2017-02-22 10:36:30 +01:00
bergquist c5a76fba87 shortcuts: add expand/collapse to shortcut help 2017-02-22 10:33:24 +01:00
bergquist e828f3a97b shortcuts: change init bind key to d 2017-02-22 10:32:30 +01:00
Mitsuhiro Tanda 5a30b08b14 add keyboard shotcuts for collapse/expand rows 2017-02-22 09:30:56 +01:00
Torkel Ödegaard e3b71ed95e docs(): updated CLA 2017-02-22 09:10:08 +01:00
Torkel Ödegaard 9c84b9f944 docs(): CLA fixes 2017-02-22 08:55:24 +01:00
Daniel Lee e5f5c1724a templating: check for default data source (#7636)
For data source template variables, check if the
selected value is default and if so load the
default data source.

Fixes #7586
2017-02-21 17:27:21 +01:00
bergquist 00dddca26a alerting: dedupe alert notifications when running multiple servers
alert notifications will only be sent if the database value
is updated.

ref #6957
2017-02-21 16:54:49 +01:00
Daniel Lee 96a3ed0ac3 docs: new /api/users/search route
ref #7469. Description of new route that
adds paging for the users list.
2017-02-21 16:09:15 +01:00
Torkel Ödegaard d5245fd19a docs(): updated changelog with #7612 2017-02-21 10:49:50 +01:00
Aaron Roydhouse 4039e5edbc Improve 'external_image_storage.s3' documentation (#7623)
Add documentation for 'external_image_storage.s3' to explain how to specify the AWS region for the S3 bucket, and the requires S3/IAM permissions.
2017-02-21 10:09:50 +01:00
bergquist 70b36a02af Revert "tech: use context package over xperimental version"
This reverts commit 99f1c30071.
2017-02-20 22:04:51 +01:00
bergquist 99f1c30071 tech: use context package over xperimental version 2017-02-20 21:44:15 +01:00
tamayika b01fd3d0b5 Support for all ad-hoc filter operators on Elasticsearch (#7612) 2017-02-20 21:01:52 +01:00
Torkel Ödegaard 1d9b3871fa Merge branch 'rebrand-docs' of github.com:grafana/grafana into rebrand-docs 2017-02-20 12:12:47 +01:00
Torkel Ödegaard bc9165bdfc Merge branch 'master' into rebrand-docs 2017-02-20 12:11:22 +01:00
bergquist 072c1559ba middlware: prevent orgredirect to open body stream
the org redirecter opened the body stream by misstake. Causing
downstream code to start reading from an empty stream and raise errors.
2017-02-20 11:38:29 +01:00
Torkel Ödegaard b176f36889 docs(): updated CLA 2017-02-20 10:41:13 +01:00
Torkel Ödegaard 38126bc595 fix(templating): fixed issue detecting template variable dependency, fixes #7354 2017-02-20 09:31:50 +01:00
bergquist 492b2bd42f build: fixes golang 1.8 build on windows 2017-02-19 11:32:26 +01:00
Simon Effenberg a4318e41f8 fixing little spelling issue (#7603) 2017-02-18 17:21:29 +01:00
Tim De Pauw 48649951e4 Github → GitHub (#7607) 2017-02-18 17:20:44 +01:00
bergquist d2444cbed0 Merge branch 'paging-users' 2017-02-17 16:25:03 +01:00
bergquist 400bd8d2d3 build: reduce logs from npm install 2017-02-17 16:16:17 +01:00
Carl Bergquist 24474ba41a Merge pull request #7601 from grafana/redirect_on_new_orgid
middlware: change org when url contains orgid
2017-02-17 15:31:17 +01:00
bergquist 6115941df0 middleware: rename org-id -> orgId 2017-02-17 15:18:40 +01:00
bergquist 5174d050f2 middlware: change org when url contains orgid
closes #6948
ref #1613
2017-02-17 15:02:14 +01:00
Torkel Ödegaard ac0d09c419 fix(): fixed issue with syncing refresh interval to url 2017-02-17 14:07:15 +01:00
bergquist 12f1ea71fd chore: delete empty test 2017-02-17 12:07:46 +01:00
bergquist 76f617b862 build: disable setup for windows build 2017-02-17 12:06:24 +01:00
bergquist 774c1de892 changelog: adds note about closing #7319 2017-02-17 10:42:52 +01:00
bergquist 5fb4540358 changelog: adds note about closing #7382 2017-02-17 10:41:15 +01:00
bergquist 79daa71350 docs: update golang requirement to 1.8 2017-02-17 10:37:59 +01:00
bergquist defa81e4c1 Merge branch 'http_graceful' 2017-02-17 10:34:02 +01:00
bergquist cf871b1284 http: close http server gracefully. 2017-02-17 10:33:47 +01:00
bergquist 52566376b2 tech(server): remove unused code 2017-02-17 10:18:11 +01:00
bergquist a32b7dfb9d build: upgrade to golang 1.8 2017-02-17 09:05:52 +01:00
bergquist c924510deb alertlist: adds pause as filter option
closes #7400
2017-02-16 16:01:57 +01:00
bergquist a747d33373 templating: allow whitespace values
closes #7382
2017-02-16 15:58:01 +01:00
bergquist d72011589e templating: refactor sorting test 2017-02-16 14:22:38 +01:00
bergquist 927b39fa63 templating: adds test for sorting template values 2017-02-16 14:14:17 +01:00
Senkevich Alexsandr 17d02a7065 added suppressing of empty results in table plugin 2017-02-16 14:35:42 +03:00
bergquist 3c0f61511d build: deps-go is not required for building grafana
setup compiles the backend and caches it which is nice
when developing grafana since incremental compiles are
much faster. But its not required for building grafana.
2017-02-16 09:10:55 +01:00
bergquist 9b4d95ff25 changelog: note about closing #7347 2017-02-15 14:35:40 +01:00
Roman Vynar 4fcd5eab29 Add advanced TLS settings to harden setup. (#7347)
* Hardcoded the most secured TLS options.
2017-02-15 14:29:20 +01:00
Torkel Ödegaard 902cf5f889 fix(): google analytics fix 2017-02-15 14:26:57 +01:00
bergquist bd010289b2 alerting: images in alert notifications is now optional
its now possible to turn of image uploading in alert notifications
for those who operate on very sensitive data.

closes #7419
2017-02-15 14:17:36 +01:00
bergquist f14e25612e annotations: go vet fixes 2017-02-15 14:15:42 +01:00
bergquist c8c3021987 docs: tutorial for setting up grafana as HA
ref #7541
2017-02-15 12:38:50 +01:00
Daniel Lee 6dfdcd7ca5 email: change default from name to Grafana
Changes default from name in smtp settings
from Grafana Admin to Grafana.

Fix for integration test (which is skipped but that
did not work)
2017-02-15 11:02:46 +01:00
Daniel Lee 8144b73544 changelog: adds note about closing #2131 2017-02-15 10:44:43 +01:00
Daniel Lee 5fca4c7304 Merge pull request #7569 from jacobbednarz/add-sender-name-to-email
Updates mailer to include `from_name` value
2017-02-15 10:32:06 +01:00
Dennis Wiemer 8b25ba6a7c Added click events in graph to core eventbus (#7511) 2017-02-15 08:47:20 +01:00
Torkel Ödegaard e573006283 docs(): added cla 2017-02-15 08:40:34 +01:00
Jan Garaj 79cd48f64c Cloudwatch AWS/SES metrics (#7568) 2017-02-15 08:12:24 +01:00
Jacob Bednarz 6a9247500a Update documentation to include information about from_name values 2017-02-15 08:07:29 +11:00
Jacob Bednarz 7520b4f404 Update default configuration to include from_name values 2017-02-15 08:06:58 +11:00
Jacob Bednarz 796957c8c6 Update mailer tests to include FromName 2017-02-15 08:04:21 +11:00
Jacob Bednarz 66445faeb5 Format mailer From field to include name
Updates the messafe `From` field to include the name and email of the
sender.
2017-02-15 07:51:41 +11:00
Jacob Bednarz 90cbfacacf Add FromName to SmtpSettings struct
Updates the `SmtpSettings` struct to include a value for setting the
name of the email sender.
2017-02-15 07:45:28 +11:00
Jacob Bednarz 7dc6b69c8b s/smpt/SMTP 2017-02-15 07:43:59 +11:00
Jacob Bednarz c9d4654592 s/from_adress/from_address 2017-02-15 07:43:16 +11:00
bergquist 423e8686ef docs: fixes markdown formating 2017-02-14 12:56:49 +01:00
bergquist e97cab9964 docs: removes version selector from influxdb 2017-02-14 12:02:31 +01:00
Daniel Lee 5304e7b220 changelog: adds #7554 - minor enhancement to 4.2.0 2017-02-14 11:22:47 +01:00
Daniel Lee 76f82b00d7 Merge pull request #7554 from ryantxu/kbn_physics
Add more physics units
2017-02-14 11:16:20 +01:00
bergquist 73bec813fc docs: adds delete datasource by name 2017-02-14 10:41:08 +01:00
Daniel Lee 6861c6033c Changelog: add 7449 - minor enhancement to 4.2.0
Closes #7449
2017-02-14 10:21:07 +01:00
Ryuichi Sakai 0c9f664ea0 Make timeout for snapshot creation configurable 2017-02-14 10:10:51 +01:00
bergquist 9f80e8c03d changelog: rearrange closed issues 2017-02-14 10:06:31 +01:00
bergquist 6761661e10 changelog: adds note about closing #7542 2017-02-14 10:03:23 +01:00
bergquist 0523830716 changelog: add note about closing #7542 2017-02-14 08:56:00 +01:00
xginn8 1c8509ea58 wrap text in annotations modal (#7549)
annotation: wrap text in drop_element, fixes #7542
2017-02-14 08:49:43 +01:00
ryan 7867a24d87 Adding more physics units 2017-02-13 23:30:15 -08:00
Carl Bergquist 05a6cb3f76 Merge pull request #7548 from ryantxu/influxdb_logo
update datasource logos
2017-02-14 08:23:03 +01:00
ryan a1e071d3c5 missing space 2017-02-13 18:47:59 -08:00
ryan 2749dd8711 elasticsearch svg 2017-02-13 18:47:01 -08:00
ryan b46fac34d9 replace elastic logo 2017-02-13 18:38:13 -08:00
ryan fc0de84701 update influx logo 2017-02-13 18:19:14 -08:00
bergquist 2ad2b96133 build: avoid progress bar update on yarn install
this will save us ~100TB of unneeded data in the long term.
2017-02-13 15:26:10 +01:00
bergquist 2c68c071c0 changelog: update release of 2017-02-13 2017-02-13 15:11:45 +01:00
bergquist c7560edba5 docs: release 4.1.2 for windows 2017-02-13 14:17:26 +01:00
bergquist 89fdcc84de docs: release 4.1.2 2017-02-13 13:52:42 +01:00
Daniel Lee 193d468ed3 admin: adds paging to global user list
Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.

Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.

Fixes #7469
2017-02-13 12:59:36 +01:00
Jörg Thalheim f069aae576 Add Pushover alert notifications
Pushover is a service for getting real-time
notifications on your mobile devices and desktop
computers: https://pushover.net
2017-02-10 22:44:33 +01:00
bergquist e80f673264 changelog: adds note about closing issues 2017-02-10 15:56:28 +01:00
Carl Bergquist 7f4f38e773 Merge pull request #7519 from huydx/master
(feat) support datasource delete by name api
2017-02-10 15:53:34 +01:00
huydx 143cbe921f (feat) support datasource delete by name api 2017-02-10 23:30:14 +09:00
bergquist f147ac053d Merge branch 'huydx-feat/sqlmax' 2017-02-10 15:30:12 +01:00
bergquist 5b7b3fef64 conf: adds sample values for db conn settings 2017-02-10 15:30:01 +01:00
huydx 28d93b574d (feat) support max connection setting for database configuration 2017-02-10 15:30:01 +01:00
bergquist 3c7cf3f728 docs: kairosdb is no longer supported by default 2017-02-10 14:42:19 +01:00
Daniel Lee 1294b203e6 admin: adds paging to global user list
Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.

Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.

Fixes #7469
2017-02-10 11:00:04 +01:00
bergquist 900230890f changelog: adds note about closing #2385 2017-02-10 10:15:03 +01:00
Vladimir Kolobaev 8083079eea graph: set max width for legend tables.
ref #2385
2017-02-10 10:11:39 +01:00
Torkel Ödegaard 1e26a8e68a docs(): rebrand updates 2017-02-10 08:58:53 +01:00
Torkel Ödegaard 0d8cdf0ebe docs(): rebrand updates 2017-02-10 08:58:45 +01:00
bergquist dcf097a8b9 changelog: adds note about closing #6109 2017-02-10 08:57:46 +01:00
xginn8 3d4c3ff00d return an empty message if table contains no data #6109 (#7487) 2017-02-10 08:54:00 +01:00
bergquist 7bf570532f docs: adds note about closing #7493 2017-02-10 08:34:56 +01:00
Vladimir Kolobaev 6eda5604d2 Full metric description (#7493)
graph: add full metric description for graph-legend-alias title
2017-02-10 08:31:51 +01:00
bergquist 38c29d2209 changelog: adds note about closing #7513 2017-02-10 08:29:44 +01:00
Carl Bergquist 73d441450b Merge pull request #7516 from grafana/oauth-login-redirect
redirect user to requested url after login via oauth
2017-02-10 08:27:41 +01:00
bergquist 5dd961c0f5 settings: remove commented code 2017-02-10 07:39:26 +01:00
Dan Cech b22881c717 redirect user to requested url after login via oauth 2017-02-09 14:01:53 -05:00
bergquist c7febca447 mqe: fixes broken test for indexalias 2017-02-09 16:43:57 +01:00
bergquist aa7292fac6 mqe: adds support for wildcard and index aliases 2017-02-09 16:25:03 +01:00
Torkel Ödegaard c05c6ee7a4 docs(): minor fix 2017-02-08 20:00:39 +01:00
Daniel Lee bccb650010 Adds Sorting for lists of data sources to 4.2.0 2017-02-08 12:06:00 +01:00
Daniel Lee 2b2368b189 Merge pull request #7491 from grafana/sorting-datasources
Sorting datasources with case insensitive order
2017-02-08 12:01:31 +01:00
Daniel Lee fbc3c3dd32 api: removes import alias + some unused fields 2017-02-08 11:57:05 +01:00
bergquist 10508d0238 docs(changelog): adds note about closing #6451 2017-02-08 11:28:26 +01:00
bergquist e8f191ef32 Merge branch 'jregovic-master' 2017-02-08 11:25:41 +01:00
bergquist 00549f393c style(hipchat): improves code style 2017-02-08 11:24:49 +01:00
Torkel Ödegaard 0a17217d59 docs(): updating links 2017-02-08 08:23:23 +01:00
Daniel Lee 8aa5b62d6d fix(panel): case insensitive sort metric sources
Sorts the list of metric sources that is used in dropdown for Panel
Data Source on the Metrics tab so that it is case insensitive and
so that the built data sources are last in the list.
2017-02-08 00:01:42 +01:00
Daniel Lee cbd1455c42 fix(api): case insensitive sort for datasources
The data source list is case sensitive when sorted. This changes the
sort to be case insensitive. The test only tests the handler, not the
routing or database query.
2017-02-07 22:15:52 +01:00
James Regovich 53942f7987 Adding HipChat Notifier 2017-02-07 10:50:49 -06:00
bergquist 5bba0c2a94 tech(build): upgrade dist builder to golang1.8rc3 2017-02-07 12:45:06 +01:00
Torkel Ödegaard 10e100b080 docs(): updates 2017-02-07 12:27:16 +01:00
bergquist b3db5aae4b docs(changelog): adds note about closing #6799 2017-02-07 11:21:20 +01:00
Carl Bergquist 7d205ae2b8 Merge pull request #7466 from hagen1778/prometheus-basicauth-query
allow setting basic auth headers for prometheus datasource
2017-02-07 11:18:17 +01:00
bergquist 8ca4afaf22 docs(changelog): adds note about closing #7459 2017-02-07 11:17:20 +01:00
Danilo Bargen 689f5cb686 feat(alerting): Text formatting for Threema alert messages 2017-02-07 11:14:57 +01:00
Danilo Bargen d1a5d9c15c feat(alerting): Add Threema Gateway integration
This commit adds alerting support for Threema Gateway. It supports all
Simple IDs (managed by the Gateway server).

More information can be found on https://gateway.threema.ch/
2017-02-07 11:14:57 +01:00
bergquist 9ece10ef24 style(dataproxy): simplify expression 2017-02-07 11:03:57 +01:00
bergquist b386920abb Merge branch 'prometheus_secure' of https://github.com/mtanda/grafana into mtanda-prometheus_secure 2017-02-07 11:01:02 +01:00
hagen1778 a1e835884b use configured Transport instead of defaultHttpTransport 2017-02-07 11:56:59 +02:00
Daniel Lee 5e9653f935 docs(): adds missing index pages + link fix 2017-02-07 10:22:14 +01:00
bergquist 285918caf6 tech(build): switch to golang 1.8rc3 2017-02-07 10:13:21 +01:00
Torkel Ödegaard 8a92861133 docs(): fixes for rebranded docs site 2017-02-07 09:09:51 +01:00
Daniel Lee abd9233f86 Docs for developing plugins (#7475)
* docs(plugins): new developing plugins section

Creates new section called Developing Plugins in
the plugin section of the docs.

1. Some changes to the Development guide page
2. Converted defaults/editor mode blog post
to new page
3. Converted snapshots blog post to new page
4. Adds new code styleguide page
5. Updates to apps and datasources pages
6. Adds plugin.json schema

* docs(links): fixes broken links

Fixes broken links to other pages as
well as broken image links.
2017-02-07 07:48:01 +01:00
Torkel Ödegaard 3398c28ab2 docs(): fixing redirects for moved doc pages, updating links to point to new urls 2017-02-06 18:04:53 +01:00
r.khavronenko 25be602dce go fmt 2017-02-06 17:17:16 +02:00
bergquist 5a7abe365c tech(build): echo before running go fmt/vet 2017-02-06 15:55:22 +01:00
bergquist 57d36b3d42 feat(alerting): transform labels into tags for prometheus tsdb 2017-02-06 15:25:15 +01:00
r.khavronenko 80b92335bb allow setting basic auth headers for prometheus datasource 2017-02-06 16:22:09 +02:00
Mitsuhiro Tanda 69566a23fc improve security of Prometheus datasource 2017-02-06 23:10:10 +09:00
bergquist 3827c0a69c tech(alerting): adds tags to alerting data model 2017-02-06 14:59:29 +01:00
Torkel Ödegaard 982dc276d3 Update building docs readme 2017-02-06 10:19:47 +01:00
jifwin 9e7df648b5 Fix requests cancelling (#7457)
* fix backendSrv request cancelling

* revert imports

* formatting
2017-02-06 06:42:26 +01:00
bergquist a36b1d9dce tech(build): require go vet to pass 2017-02-05 21:21:05 +01:00
bergquist c05bc0cb17 chore(vet): fixes invalid fmt.Sprintf format 2017-02-05 21:19:39 +01:00
Grzegorz Pietrusza a3019a9789 cleanup 2017-02-04 14:30:24 +00:00
Grzegorz Pietrusza 220b65afd2 implement panels loading on scroll 2017-02-04 14:10:40 +00:00
bergquist d9b5628126 docs: update nodejs version requirement in readme 2017-02-03 16:15:37 +01:00
Carl Bergquist 282b1bc73a Merge pull request #7442 from lucapette/patch-1
Fix typo
2017-02-03 14:06:54 +01:00
lucapette 032ecad3b7 Fix typo 2017-02-03 12:10:22 +01:00
bergquist 457d6c8f81 tech(build): fixes broken build 2017-02-02 17:25:33 +01:00
Torkel Ödegaard 65cf0d0e5c fix(graph legend): fixed legend table mode scrollbar visible when it needs to to, fixes #6828 2017-02-02 16:29:11 +01:00
bergquist 3e62b1b2d7 tech(build): use build number as iteration number 2017-02-02 15:55:37 +01:00
bergquist a580113de4 feat(alerting): changes default timerange to 15min 2017-02-02 12:05:44 +01:00
bergquist 63aa436997 tech(build): slimdown the size of the build container 2017-02-02 11:33:34 +01:00
bergquist 3cbca80d3c tech(build): starts docker build for latest build 2017-02-02 10:41:11 +01:00
Alexander Menzhinsky 30c334a2b8 Add common type for oauth authorization errors 2017-02-01 16:42:59 +03:00
bergquist aef4195493 tech(build): fixes invalid script file usage 2017-02-01 07:09:36 +01:00
bergquist ea6d996abc tech(build): enable windows build trigger 2017-01-31 21:43:18 +01:00
bergquist 74c5c5368c tech(build): update windows trigger 2017-01-31 21:36:52 +01:00
bergquist afd135944a tech(build): upgrade golang to 1.7.4 2017-01-31 21:11:34 +01:00
bergquist 18f20a3357 tech(build): deploy to new s3 buckets 2017-01-31 20:26:19 +01:00
Torkel Ödegaard 01f1c1b8dc feat(): began refactoring PR #5364 2017-01-31 17:10:27 +01:00
bergquist b600e1c50b docs(changelog): adds note about closing #7417 2017-01-31 15:24:00 +01:00
Mitsuhiro Tanda 91999851cb support regex expansion in templating "Regex" field (#6565) 2017-01-31 15:21:53 +01:00
Carl Bergquist 4f5dc6104f Merge pull request #7417 from Erliz/patch-1
Add image url to telegram alert notifier
2017-01-31 15:13:21 +01:00
Kevin Bowling 0c46def1a0 Add an idiomatic plugin path for FreeBSD (#7410) 2017-01-31 14:54:53 +01:00
Stanislav Vetlovskiy 0e892e9f86 Add image url to telegram alert notifier
If public image url of alert is exist add it to the telegram message
2017-01-31 16:47:14 +03:00
bergquist 513fcdeeb8 tech(build): prepare for tag builds 2017-01-31 11:00:23 +01:00
Torkel Ödegaard f602752bdc fix(packaging): fixed issue in deb package post install script that made it think upgrade was happening, fixes #7403 2017-01-31 10:56:04 +01:00
bergquist d72f257f27 tech(build): disable package iteration for release builds 2017-01-31 09:40:26 +01:00
Torkel Ödegaard fce2e341d2 mergefix(): fixed issue with master merge 2017-01-31 09:00:36 +01:00
Torkel Ödegaard 8a95c563bb Merge branch 'master' into websocket 2017-01-31 08:56:49 +01:00
Torkel Ödegaard 2594041eed hiding grafana live ds 2017-01-31 08:56:46 +01:00
Torkel Ödegaard 9ba1ea0179 fix(): another unit test fix attempt 2017-01-31 08:52:48 +01:00
Torkel Ödegaard 0c5abc1615 Merge branch 'xginn8-master' 2017-01-31 08:27:53 +01:00
Torkel Ödegaard 5fc5971145 refactor(): refactoring PR #7124 2017-01-31 08:27:48 +01:00
Torkel Ödegaard 436e35c845 fix(): fixed unit test broken in last PR merge 2017-01-31 07:59:14 +01:00
Torkel Ödegaard 9a61d43dc6 refactor(): refactoring PR #7141 2017-01-31 07:57:39 +01:00
Torkel Ödegaard c400b5cf63 Merge branch 'master' of github.com:grafana/grafana 2017-01-31 07:48:44 +01:00
Torkel Ödegaard 1a9aaa4138 feat(server side png rendering): added timezone parameter for server side rendering, refactoring PR #7264 2017-01-31 07:48:10 +01:00
Torkel Ödegaard 830491fa66 Merge branch 'time-offset-to-image' of https://github.com/ryu1-sakai/grafana into ryu1-sakai-time-offset-to-image 2017-01-31 06:28:54 +01:00
Pavlos Daoglou 3e741315b4 [3743] Adds support for user search based on login or email (#7334)
* [3743] Adds support for user search based on login or email

* Use query parameter instead

* Use macaron Query() instead
2017-01-31 06:25:55 +01:00
Stanislav Vetlovskiy bd4eadf69c #7383 Fix factory typo in telegram notifier (#7406) 2017-01-31 06:23:19 +01:00
bergquist 3c304b9b88 tech(build): disable builds for master 2017-01-30 16:24:50 +01:00
bergquist cefb4103a7 tech(build): disable build based on tag 2017-01-30 16:03:55 +01:00
bergquist dd982ac9a2 tech(build): dont include buildnumber when building tags 2017-01-30 15:23:38 +01:00
bergquist ac6b5ea796 tech(build): option to not include buildIteration in package name 2017-01-30 15:21:39 +01:00
bergquist 163036591d tech(build): fixes broken build 2017-01-30 15:04:55 +01:00
bergquist 2de8cdb85c tech(build): remove unused deps 2017-01-30 14:28:39 +01:00
bergquist 7307e6345b tech(build): remove sha calc from build step 2017-01-30 13:58:39 +01:00
bergquist 6de13e081b tech(build): deploy builds for each commit to master 2017-01-30 10:37:14 +01:00
Jay Linski 91513f0bc0 Remove deprecated dataproxy logging setting (#7398)
This should have been removed in 06440ef57b, but was probably forgotten.

Solves #6718.
2017-01-30 08:14:44 +01:00
Torkel Ödegaard b191638f41 feat(packaging): Make config file not part of package to simplify upgrade, made commit always a short sha, changed RESTART_ON_UPGRADE to true by default, #7399, #7227 2017-01-30 08:08:37 +01:00
Torkel Ödegaard 2a09d4a5a6 fix(): conf file had left over of old config key, #7395 2017-01-30 07:11:12 +01:00
Oleksandr Kushchenko edba465a75 add DeliveryStreamName dimension to AWS/Firehose Cloudwatch namespace (#7388) 2017-01-28 08:30:57 +01:00
lpic 5b699dbf0d Set time when testing ES datasource, fixes #7044 (#7390) 2017-01-28 08:30:33 +01:00
Kit Westneat cddc9ac0a7 file_export.ts: #5325 missed exportTableDataToCsv when adding sep (#7391) 2017-01-28 08:29:57 +01:00
bergquist 1fee26925f Merge branch 'new_deploy' 2017-01-27 15:55:42 +01:00
bergquist 4b6aaec880 tech(build): create sha files after signing packages 2017-01-27 15:54:19 +01:00
bergquist a634bd0ce8 tech(build): sign and deploy packages to s3 2017-01-27 15:21:16 +01:00
bergquist feed804a0e tech(build): updates path to signing file 2017-01-27 15:21:16 +01:00
bergquist 0cc21669f4 tech(build): adds package signing step 2017-01-27 15:21:16 +01:00
bergquist 46e4a54a6e style: go fmt with simplify 2017-01-27 15:21:02 +01:00
bergquist 1df9c2cab3 docs(changelog): adds note about closing #7377 2017-01-27 08:54:23 +01:00
Carl Bergquist b3847a3738 Merge pull request #7377 from solugebefola/patch-3
Disable sign out for AuthProxyEnabled
2017-01-27 08:51:32 +01:00
Solar Olugebefola de7edb40f5 Disable sign out for AuthProxyEnabled
Sign out was disabled for AuthProxyEnabled in #3122.  This is to catch the one other instance of a sign out link in the side menu.
2017-01-26 13:10:33 -05:00
Torkel Ödegaard 2f4da15264 fix(http api): throw validation error if missing property in call to /api/admin/users/123/permissions, #7365 2017-01-26 08:54:51 +01:00
Ryan McKinley a656d01bf5 append windows phantomjs with .exe (#7065) 2017-01-25 14:49:09 +01:00
Torkel Ödegaard 9b8760bad7 packaging(): fix rpm & SUSE compatability issue, #7293 2017-01-25 14:42:19 +01:00
Torkel Ödegaard 7c5ef2c75a Merge branch 'connection-reset-shared_tooltip' 2017-01-25 14:35:02 +01:00
Torkel Ödegaard 28f890e42f refactor(): removed commented out code 2017-01-25 14:34:55 +01:00
Torkel Ödegaard 23eab81cbe fix(): fixed minor issue with single stat tooltip, #7357 2017-01-25 14:11:30 +01:00
Torkel Ödegaard e073d20731 updated sample config 2017-01-25 13:34:02 +01:00
Torkel Ödegaard f196ffa07d updated docs 2017-01-25 13:33:27 +01:00
Torkel Ödegaard 40d39f8a3e refactor(): renaming alerting hide ui option, #7318 2017-01-25 13:32:26 +01:00
Torkel Ödegaard fee4846429 Merge branch 'alerting_ui' of https://github.com/smalik03/grafana into smalik03-alerting_ui 2017-01-25 13:16:48 +01:00
Torkel Ödegaard 4e30aa9da2 docs(): changelog updated with #7112 2017-01-25 12:32:59 +01:00
Naoufel JAMALI 4e1d8c9ced Elasticsearch - Term aggregation limit fix (should fix #7112) (#7338)
* Elasticsearch - Term aggregation limit fix  (should fix #7112)

* Elasticsearch - Term aggregation limit fix
2017-01-25 12:29:41 +01:00
bergquist b6305a6577 tech(build): dont upload packages from master 2017-01-24 15:24:43 +01:00
bergquist d5e753adbc tech(build): fixes circle.yml format issue 2017-01-24 14:01:50 +01:00
bergquist 3d6698389b tech(build): adds s3 bucket for nightly 2017-01-24 13:58:37 +01:00
bergquist f7993db73c tech(build): installs yarn in build image 2017-01-24 11:26:03 +01:00
bergquist 66fa12835a tech(build): replace grafana_branch with circle_branch; 2017-01-24 11:26:03 +01:00
bergquist 6b70fb2729 tech(build): fixes broken yum installer 2017-01-24 11:26:03 +01:00
bergquist 5f0033f3eb tech(build): path to build relative 2017-01-24 11:26:03 +01:00
bergquist ac111bc238 tech(build): cache golang downloads. DUH! 2017-01-24 11:26:03 +01:00
bergquist 5be00191ec tech(build): Dockerfile for building grafana 2017-01-24 11:26:03 +01:00
bergquist e504e5aaf6 tech(build): avoids setup since all deps should be in /vendor 2017-01-24 11:26:03 +01:00
bergquist 1339ce80f5 tech(build): moves builds script into main repo 2017-01-24 11:26:03 +01:00
Chris Burkhart b1888fb8eb Update building_from_source.md (#7340)
Add a note about the `go get` warning that the user sees when following the setup instructions.
2017-01-24 08:31:10 +01:00
bergquist 9b57005540 tech(build): makes npm paths absolute 2017-01-23 15:53:47 +01:00
bergquist 3d5efd3350 tech(build): removes coveralls 2017-01-23 15:53:16 +01:00
Carl Bergquist 3d3958e694 Merge pull request #7328 from jubicoy/master
Added commonly used kilo-prefixed energy units
2017-01-23 13:56:35 +01:00
Torkel Ödegaard 697d0867fa fix(Elasticsearch): fix for alias patterns that refers to term that is numeric zero, fixes #7323 2017-01-23 10:15:02 +01:00
Teemu Huhtala 03eb98e94d Added commonly used kilo-prefixed energy units
Kilovolt-ampere reactive (kvar)
Kilovolt (kV)
Kiloampere (kA)
2017-01-23 10:20:11 +02:00
Torkel Ödegaard 8eae09e5e6 docs(): updated changelog with info on #7324 2017-01-23 07:29:16 +01:00
lpic cf9790fc4c ES - Support for min_doc_count on group by terms (#7324) 2017-01-23 07:26:42 +01:00
lpic a0c8380baf ES: Change bool queries to use 'filter' clause (#7313)
Change all bool queries to use 'filter' clause instead of 'must' for
better performance
2017-01-21 08:31:29 +01:00
Chris Bentivenga 9151b4034a annotationsQuery -> annotationQuery (#7321)
Documentation calls for `annotationQuery` but the [example](https://github.com/grafana/simple-json-datasource/blob/205cf4cfbce95cd455da97c7972b64538cc80ab3/src/datasource.js#L41) uses the method name `annotationQuery`
2017-01-21 08:29:21 +01:00
smalik 9862c9ff40 feat(alerting): Show/hide alerting UI using configuration variable
Use configuration variable "show_alerting_ui" to show/hide alerting UI
2017-01-20 10:43:29 -05:00
Axel Pirek 4b8f2aeb36 Fix tooltips sometimes rendering outside of graph panel
I noticed tooltips on other panels rendering outside of their panel or
even the browser window when hovering on the very edge of graphs with
relative time overrides.
2017-01-19 13:33:49 +01:00
Axel Pirek 138a79c2fb Clear highlight when clearing tooltip and crosshair 2017-01-19 11:08:32 +01:00
Axel Pirek ee58a6ee2b Speed up tooltip value retrieval 2017-01-19 10:16:28 +01:00
Axel Pirek a2e6408be1 Only render tooltip if position is in viewport 2017-01-19 10:16:20 +01:00
bergquist 57099f0273 docs(changelog): adds note about closing #7301 2017-01-19 09:33:53 +01:00
bergquist 09b61caa65 Merge branch 'huydx-notify-line' 2017-01-19 09:30:13 +01:00
bergquist f5d8a75381 tech(webhook): remove redundant if statement 2017-01-19 09:29:40 +01:00
huydx 376d2d56bf (feature) add LINE notify to notifier 2017-01-19 17:26:53 +09:00
Adrián López e1b82e72eb Fix empty value tags and comma separated values (#7289)
When a tag doesn't have a value it was showing a empty 'bubble'.
If value has several values separated by commas, make a 'bubble' for
each one.
2017-01-18 16:02:40 +01:00
bergquist 94e901793a docs(guides): rearranges menu order 2017-01-17 14:56:11 +01:00
bergquist 96fbe404f8 docs(changelog): adds note about closing #7268 2017-01-17 12:19:46 +01:00
bergquist 55af92eba1 fix(table): fixes broken annotation rendering
closes #7268
2017-01-17 12:17:18 +01:00
bergquist 2dd1eb81cd docs(changelog): adds note about closing #7223 2017-01-17 10:49:31 +01:00
bergquist 4ea4e0436a feat(mailer): set localname to hostname
Some email providers does not accept localhost
in the HELO message. So we set it to hostname
instead. Our hope is that should be enough for
those providers who does not accept localhost.

closes #7223
2017-01-17 10:36:04 +01:00
bergquist 276916cd5d docs(changelog): note about closing #7035 2017-01-17 10:05:56 +01:00
bergquist ed9595a20d Merge branch 'show_no_data_in_list' 2017-01-17 09:53:38 +01:00
bergquist e78da57e4d feat(alerting): shows when no_data triggered alerts
closes #7035
ref #7257
2017-01-17 09:49:25 +01:00
Torkel Ödegaard 0683742e83 tech(library upgrade): fixed unit test broken by angularjs upgrade, #7274 2017-01-16 22:27:35 +01:00
Torkel Ödegaard 6f87f88690 tech(lib upgrade): upgraded angularjs from 1.5.8 to 1.6.1, closes #7274 2017-01-16 21:31:55 +01:00
Torkel Ödegaard 710d07d7a5 Merge branch 'mtanda-clipboard_js' 2017-01-16 21:08:47 +01:00
Torkel Ödegaard c5955bacd2 refactor(): minor refactor 2017-01-16 21:08:39 +01:00
Torkel Ödegaard 09cec8535e Merge branch 'clipboard_js' of https://github.com/mtanda/grafana into mtanda-clipboard_js 2017-01-16 20:57:16 +01:00
Mitsuhiro Tanda d683b0379b fix monkey patch for clipboard.js 2017-01-17 01:12:37 +09:00
bergquist f29f83ca75 chore: adds comment out why the code was added 2017-01-16 15:04:53 +01:00
bergquist 3c9357a2e9 fix(alerting): supports lowercase metrics
this fix is due to EvalMatch now serailize as lower case.

ref #7257
2017-01-16 15:01:57 +01:00
bergquist 01c6658a7a docs(changelog): adds note about closing #7269 2017-01-16 14:42:31 +01:00
bergquist bfa3c590e7 fix(alertlist): changes scroll to auto
close #7269
2017-01-16 14:38:01 +01:00
bergquist 22601fa736 docs(changelog): adds note about closing #7209 2017-01-16 12:48:29 +01:00
bergquist 76c9f62265 Merge branch 'Ricky-N-feature/dataProxyAuditLog' 2017-01-16 12:44:40 +01:00
bergquist 06440ef57b tech(dataproxy): moves cfg to [dataproxy] 2017-01-16 12:43:59 +01:00
bergquist d4a96b9741 tech(dataproxy): make the code a little bit more defensive 2017-01-16 12:24:08 +01:00
bergquist dd84fb563a style(dataproxy): renames log functions 2017-01-16 12:23:49 +01:00
bergquist 51bca7d84b tech(dataproxy): moves all parameters to Info call 2017-01-16 12:16:41 +01:00
bergquist 839eb97061 Merge branch 'feature/dataProxyAuditLog' of https://github.com/Ricky-N/grafana into Ricky-N-feature/dataProxyAuditLog 2017-01-16 12:02:43 +01:00
xginn8 873a8bc520 wrap the title of a panel and dashboard search results. fixes #7203 (#7213) 2017-01-16 12:02:07 +01:00
bergquist ee1c15b9cc docs(changelog): adds note about closing #7234 2017-01-16 11:54:38 +01:00
bergquist 99f18f9d69 merge branch 'oliverpool-diff-aggregate' 2017-01-16 11:52:34 +01:00
bergquist 480a58d377 Merge branch 'diff-aggregate' of https://github.com/oliverpool/grafana into oliverpool-diff-aggregate 2017-01-16 11:52:22 +01:00
bergquist 8a8de91a8b Merge branch 'andrewhowdencom-master' 2017-01-16 11:50:23 +01:00
bergquist 2fdb47ae97 docs(prometheus): rewrote and shorten the note about templates 2017-01-16 11:50:12 +01:00
bergquist 2696d6cd3f Merge branch 'master' of https://github.com/andrewhowdencom/grafana into andrewhowdencom-master 2017-01-16 11:47:13 +01:00
bergquist c73e86e557 docs(testdata): some minor changes 2017-01-16 11:21:23 +01:00
bergquist ae08386ce3 docs(testdata): adds docs page about test datasource 2017-01-16 11:13:52 +01:00
bergquist 92f0a22fd7 docs: moves datsources pages to feature folder 2017-01-16 11:13:27 +01:00
bergquist bd414c1793 docs: moves panels to panel folder 2017-01-16 08:17:37 +01:00
bergquist 20bdc48f13 docs(guides): remove (Latest) from menu name 2017-01-16 08:15:47 +01:00
bergquist f4713956f0 tech: updates latest.json to 4.1.1 2017-01-16 07:07:32 +01:00
bergquist eb8d1dfa34 docs(smtp): adds info about how to use passwords with #
closes #7265
2017-01-16 07:03:35 +01:00
bergquist 62eaa683c0 docs(changelog): note about closing #7256 2017-01-16 07:00:51 +01:00
And^Cw Howden 6edbc4604c Add additional documentation about Prometheus + Templated queries 2017-01-15 20:56:53 +01:00
Ryuichi Sakai 1bc55a2d38 Enable image rendering to use browser time offset 2017-01-15 22:01:28 +09:00
Torkel Ödegaard e5a6c523d7 Merge branch 'master' of github.com:grafana/grafana 2017-01-13 17:39:41 +01:00
Torkel Ödegaard 49fe74228b fix(browser history): fixes and enhancements to browser history, it now works properly again AND it can restore previous time ranges in dashboards, closes #7259 2017-01-13 17:37:53 +01:00
Carl Bergquist c43bb7fb99 Extractor should not modify dashboard json (#7256)
* test(dashboard): tests that he extractor does not modify original json

* feat(extractor): validate a cloned version of the dashboard json
2017-01-13 15:46:23 +01:00
bergquist 2d441bfb37 docs(changelog): note about closing #7149 2017-01-13 15:20:15 +01:00
Carl Bergquist 1efeaafdbf Merge pull request #7249 from grafana/alerting_test_alertrule
Enable error and no_data overrides when testing alerting.
2017-01-13 15:18:02 +01:00
Torkel Ödegaard deff24d2c1 Merge branch 'clipboard_js' of https://github.com/mtanda/grafana into mtanda-clipboard_js 2017-01-13 14:57:23 +01:00
Torkel Ödegaard d354f3a8af fix(alerting): fixed evaluation for no_value condition, fixes #7244 (#7247)
* fix(alerting): fixed evaluation for no_value condition, fixes #7244

* feat(alerting): moving null library into grafana, fixing handling on no value / no series
2017-01-13 12:32:30 +01:00
bergquist 0873d493c2 feat(alerting): moves getNewState to evalHandler
closes #7149
2017-01-13 11:02:24 +01:00
rrickardt bccdd7cad1 Update postinst (#7233)
With present postinst script on Centos 7, restart after upgrade is not working with Warning: grafana-server.service changed on disk. Run 'systemctl daemon-reload' to reload units.

So i added systemctl daemon-reload.
2017-01-13 06:27:36 +01:00
Tomas Varneckas 54c456ec5b Make API key usage example meaningfully runable (#7243) 2017-01-13 06:25:49 +01:00
Mitsuhiro Tanda 1672ca4edb call clipboard destroy() 2017-01-13 02:58:44 +09:00
Mitsuhiro Tanda 3df119002d patch for clipboard.js work 2017-01-13 02:19:02 +09:00
Carl Bergquist 13178d99d4 Merge pull request #7240 from tomasv/fix-tags-api-doc
Fix typo in tags API documentation example request
2017-01-12 17:08:14 +01:00
Tomas Varneckas 9449e93e1e Fix typo in tags API documentation example request 2017-01-12 17:55:43 +02:00
oliverpool 80c67267e8 Add the diff option on the singlestat panel 2017-01-12 16:23:57 +01:00
oliverpool 92a0b402c5 Add diff documentation 2017-01-12 16:22:41 +01:00
oliverpool 2b932492c2 Add a diff aggregate
`diff = current - first` (when available)
2017-01-12 16:19:18 +01:00
bergquist 60a2041065 tech(build): yarn install should use --pure-lockfile 2017-01-12 15:36:44 +01:00
bergquist 915b1efab9 tech(build): updates deps in yarn 2017-01-12 15:33:07 +01:00
bergquist 9a35d82e51 docs(singlestat): its called avg in grafana
ref #7234
2017-01-12 13:36:10 +01:00
bergquist 35db025b0a docs(installation): updates docs for 4.1.1 2017-01-12 10:38:23 +01:00
Torkel Ödegaard 821876a85b Merge branch 'master' of github.com:grafana/grafana 2017-01-11 19:48:17 +01:00
Torkel Ödegaard b8b517cd3f docs(): updated changelog 2017-01-11 19:48:06 +01:00
Mitsuhiro Tanda 4b567e35d5 suppress refresh when user is inactive (#7219) 2017-01-11 19:46:34 +01:00
Torkel Ödegaard f045fbf267 Merge branch 'master' of github.com:grafana/grafana 2017-01-11 19:40:59 +01:00
Torkel Ödegaard 9c0f7f547b fix(alerts): added alert listener for appEvents 2017-01-11 19:40:05 +01:00
Mitsuhiro Tanda db2718a699 remove zero_clipboard.js 2017-01-12 02:37:32 +09:00
Mitsuhiro Tanda 1571072c18 use clipboard.js 2017-01-12 02:37:29 +09:00
Mitsuhiro Tanda 5ccbe6d40b add clipboard.js 2017-01-12 02:22:56 +09:00
Ricky Niemi 0b48e48e3d Small whitespace fix on setting file 2017-01-11 07:51:46 -08:00
Ricky Niemi 269d16301a Rename to audit logging to data proxy logging 2017-01-11 07:40:06 -08:00
Ricky Niemi 0fee7c863a Gate data proxy audit logging behind audit_logging server setting 2017-01-11 07:22:57 -08:00
Torkel Ödegaard 61214899bd docs(): updated changelog 2017-01-11 15:26:08 +01:00
Torkel Ödegaard bd8899b37d fix(graph): fixed table legend min-height, fixes #7221 2017-01-11 15:24:43 +01:00
Torkel Ödegaard edae622d8f docs(): updated changelog 2017-01-11 14:04:34 +01:00
Mitsuhiro Tanda 7e4c101d02 S3 IAM support (#7058)
* add s3 dependencly

* rewrite image uploader by aws-sdk-go

* improve backward compatibility of s3 image uploading

* set default for expires option

* remove acl and expires
2017-01-11 14:00:49 +01:00
Lee Briggs 2e796da441 Add support for sensu notifications (#7207) 2017-01-11 13:57:07 +01:00
Torkel Ödegaard 64f5146a62 change(text panel): removed rarely used (and not properly working), text mode option, closes #6389, closes #7214 2017-01-11 12:33:12 +01:00
Torkel Ödegaard cdc7da3ae1 docs(): updated changelog 2017-01-11 12:16:34 +01:00
Torkel Ödegaard b48273d1cf Merge branch 'master' of github.com:grafana/grafana 2017-01-11 12:11:38 +01:00
Torkel Ödegaard 149dd78298 Merge branch 'built_in_template_variables' 2017-01-11 12:10:33 +01:00
Torkel Ödegaard b475f91387 feat(templating): completed work on built in template variables and , closes #7190, refactors #7170 2017-01-11 12:10:26 +01:00
bergquist 5e14f4a16e tech(build): changes build for 4.1 release 2017-01-11 11:07:01 +01:00
bergquist 8574f100aa docs(guides): removes beta info for 4.1 2017-01-11 10:50:41 +01:00
Torkel Ödegaard 44b7a26119 fix(graph): fix for table legend and scroll, fixes #7204, fixes #6628 2017-01-11 10:35:52 +01:00
Torkel Ödegaard 8c39cd35f0 progress on interval built in variable 2017-01-11 10:18:21 +01:00
bergquist f4e9bd507b tech(build): updates packagecloud script 2017-01-11 08:59:44 +01:00
Utkarsh Bhatnagar 7e3ccdf983 Fixed opentsdb templating bug (#7208) 2017-01-10 21:35:05 +01:00
Ricky Niemi d9cbb994b8 Clean up audit log formatting and code 2017-01-10 11:42:03 -08:00
bergquist 6518a0f765 Merge branch 'docs-4.1' 2017-01-10 15:37:07 +01:00
bergquist 50b937dcb1 tech(build): updates docs to 4.1.0 2017-01-10 15:36:54 +01:00
bergquist 4d0b5ca14a tech(build): upgrades appveyour nodejs version 2017-01-10 15:01:53 +01:00
bergquist 381f8d4475 docs(changelog): adds note about closing #7195 2017-01-10 10:30:28 +01:00
Ricky Niemi d03977ac0e Add initial audit logging to data proxy 2017-01-09 22:59:43 -08:00
Carl Bergquist edf868d46b Merge pull request #7195 from theisenmark/webhook-username
Fix webhook username mismatch
2017-01-09 18:03:34 +01:00
Mark Theisen afda9cbb2d Fix webhook username mismatch
Fixing variable name mismatch so that the Authorization HTTP header is added to webhook notifications.
2017-01-09 17:18:53 +01:00
bergquist 4f216f22e9 docs(http): fixes typos 2017-01-09 16:49:06 +01:00
Torkel Ödegaard e218837380 began work on built in template variables, #7190 2017-01-09 15:31:19 +01:00
Carl Bergquist bcfe048aae Merge pull request #7184 from simnv/git-via-https
Use HTTPS instead of git to download tether-drop package
2017-01-09 07:15:01 +01:00
Valeriy Simonov 1aa1f7b12c Use https instead of git for tether-drop
git protocol (tcp/udp/9418) is forbidden when using some corporate
proxies. HTTPS is used more widely.
2017-01-09 10:00:07 +05:00
Valeriy Simonov 5bfe0ab237 Merge remote-tracking branch 'grafana/master' 2017-01-09 09:37:19 +05:00
Vitaliy Fuks 7c376f2bda Fixed typo. (#7181) 2017-01-08 09:43:17 +01:00
Mekal Zheng e57c764410 check validation of interval string before converting to seconds 2017-01-07 18:17:44 +08:00
Mekal Zheng 333aeb43c4 use methods of kbn to convert interval string to both second and millisecond 2017-01-07 16:33:40 +08:00
Mekal Zheng af798092b7 add variable $intervalSecond 2017-01-07 00:28:32 +08:00
Torkel Ödegaard 53fbb8b074 docs(changelog): added entry for telegram notifier, #7098 2017-01-06 12:19:39 +01:00
Torkel Ödegaard 31bd725559 Merge branch 'notifier-refactor' 2017-01-06 12:17:34 +01:00
Torkel Ödegaard eca918c0e7 Merge branch 'master' of github.com:grafana/grafana 2017-01-06 12:15:12 +01:00
Torkel Ödegaard 69d31c560d bumped master to 4.2 2017-01-06 12:14:58 +01:00
Mitsuhiro Tanda dfaefe34a4 add cloudwatch region (#7161) 2017-01-06 12:05:27 +01:00
Torkel Ödegaard b8f559aecb feat(plugins): made notifiers more pluggable and easier to support many of them, new ones can now be added without modifying any existing file, #7162 2017-01-06 12:04:25 +01:00
Torkel Ödegaard d6a2431767 Merge branch 'notifier-telegram-messenger' of https://github.com/leonoff/grafana into leonoff-notifier-telegram-messenger 2017-01-06 10:27:20 +01:00
Torkel Ödegaard 45d2e70ba7 feat(dashboard): sorting dashboard model kekeys, refactoring PR #7139 2017-01-06 10:09:11 +01:00
Torkel Ödegaard c472054f21 Merge branch 'master' into dashboard-export 2017-01-06 07:50:16 +01:00
Carl Bergquist e61d049623 tech(build): replace npm with yarn (#7108)
* tech(build): replace npm with yarn

* tech(build): change node version for CI
2017-01-06 07:28:43 +01:00
Torkel Ödegaard 7433e8c58f docs(changelog): updated changelog with ES PR #7154 2017-01-06 07:24:56 +01:00
Torkel Ödegaard 20b7c2f2e2 feat(ES): refactoring PR #7154 2017-01-06 07:22:37 +01:00
Torkel Ödegaard 293fd93e6c fix(elasticsearch): fixed predict default value, fixes #7145 2017-01-06 07:06:41 +01:00
Torkel Ödegaard 6960fb46c2 fix(build): remove triggering full package release on every commit, #6970 2017-01-06 06:51:17 +01:00
Torkel Ödegaard 813232315e fix(testdata): fixed test data source build issue 2017-01-06 06:50:02 +01:00
Torkel Ödegaard 63f6e86e46 feat(ES): better support for text type, closes #7151 2017-01-06 06:35:08 +01:00
Torkel Ödegaard 658d39944b feat(elasticsearch): add support for Elasticsearch scaled_type number type, closes #7155 2017-01-06 06:12:48 +01:00
Vaibhav Tandon b97e784555 Moving average support for all models along with additional settings associated with each model 2017-01-05 23:17:24 +00:00
Matthew McGinn 870c5f8cef adding refresh url param to pass refresh interval #7124 2017-01-05 00:15:52 -05:00
Dan Cech df1e90c723 export sorted dashboard json 2017-01-04 18:13:33 -05:00
Torkel Ödegaard 36929c2a92 fix(elasticsearch): add support for text type filter in templating query, fixes #7136, fixes #7135 2017-01-04 20:14:56 +01:00
Utkarsh Bhatnagar 65057212e7 Org update should throw error if not found (#7066)
* Org update should give error if not found

* Used affected rows
2017-01-03 09:21:18 +01:00
bergquist d8ebebc612 docs(http_api): adds docs for alerting in http api 2017-01-03 08:12:18 +01:00
bergquist 9a3e51894b tech(alerting): remove unused property 2017-01-03 08:11:17 +01:00
Torkel Ödegaard 9dc42648cf fix(templating): fixed issue with experimental feature template variable value groups tags, fixes #6752 2017-01-02 13:32:20 +01:00
bergquist 2e7d222f6e Revert "tech: remove unused code"
This reverts commit d9131be0a5.
2017-01-02 13:22:37 +01:00
bergquist d9131be0a5 tech: remove unused code 2017-01-02 13:11:09 +01:00
Torkel Ödegaard 2be5ee0bd5 fix(graph): fixed graph legend issue with always visible scrollbar, fixes #6828 2017-01-02 12:22:56 +01:00
Torkel Ödegaard 083a42942f fix(phantomsj): fixed issue with y axis label rotation in phantomjs rendered graphs, fixes #6924 2017-01-02 12:01:48 +01:00
Torkel Ödegaard 8030b56bba fix(panel): fixed panel help text for panels that set background color, fixes #7085 2017-01-02 11:14:00 +01:00
Mitsuhiro Tanda 9855ea8c6c handle sts error (#7088) 2016-12-30 16:59:06 +01:00
bergquist 08bad530dc tech(build): fail when go fmt fails 2016-12-30 15:08:31 +01:00
Mikhail Leonov e32a653cb6 Added Telegram Messenger notification destination 2016-12-30 15:57:12 +03:00
Julie Lee 8ed8922525 Update _tabbed_view.scss (#7078)
repeated style statement
2016-12-28 12:28:05 +01:00
Carl Bergquist c97131d1a0 Merge pull request #7074 from ksatirli/master
Adds London and Canada AWS Regions
2016-12-27 16:32:56 +01:00
Kerim Satirli 48b57afe84 Adds London and Canada AWS Regions 2016-12-27 14:25:12 +01:00
Kerim Satirli 797e2ea25d Adds London and Canada AWS Regions 2016-12-27 14:10:36 +01:00
Vitaliy Fuks 716d6473b7 Fixed typo. (#7064) 2016-12-27 11:35:00 +01:00
Darrian d662961ebe Added 'linear' to fill types for InfluxDB (#7042) 2016-12-23 09:43:47 +01:00
Ryan McKinley 27d83f414e Add influx 'mode' and 'cumulative_sum' (#7045) 2016-12-23 09:43:15 +01:00
James Blackburn f98e07e012 Fix auto_assign_org_role = Read Only Editor docs (#7057)
`auto_assign_org_role` should be `Read Only Editor` rather than `Read-Only Editor`
2016-12-23 09:41:28 +01:00
Darrian cdfb24ab85 Added offset interval to specs 2016-12-21 22:58:40 +00:00
Darrian 96f3ee9e4c Added missing category for Predictions 2016-12-21 22:55:18 +00:00
Darrian 27ead53382 Set indentation to tabs 2016-12-21 22:54:56 +00:00
bergquist fef511d403 docs(conf): adds docs about supporting database_url
closes #1878
2016-12-21 23:39:08 +01:00
Darrian b8572b69f0 Register new queries available in InfluxDB - Holt Winters fixes #5619
For correct data fill on holt winters predictions, the time function
needed modification to allow a 2nd param for offset, as per
https://docs.influxdata.com/influxdb/v1.0/query_language/data_exploratio
n/#advanced-group-by-time-syntax
2016-12-21 22:30:32 +00:00
bergquist c18741c605 docs(ldap): adds note about special chars in password
closes #5337
2016-12-21 22:02:34 +01:00
bergquist 02bf83b37e docs: fixes broken code formating 2016-12-21 15:35:55 +01:00
Torkel Ödegaard fad07f0d15 refactor(http): refactoring http server 2016-12-21 14:36:32 +01:00
bergquist 8859eeb151 docs(readme): adds link to 4.1 beta release 2016-12-21 12:35:54 +01:00
bergquist a7b3ef06a8 docs: update image in github repo 2016-12-21 12:31:25 +01:00
Carl Bergquist 70f37651be Merge pull request #7034 from Timosha/add-ruble-sign
add Russian ruble sign
2016-12-21 11:10:01 +01:00
Timon 1ab66ac5d7 add Russian ruble sign 2016-12-21 12:59:09 +03:00
bergquist cb21b20905 docs(changelog): adds note about closing #6997 2016-12-21 10:05:56 +01:00
bergquist 4e306590f8 Merge branch 'v4.0.x' 2016-12-21 10:02:28 +01:00
bergquist 8cef4cc74e fix(influxdb): handles time(auto) like time($interval)
closes #6997
2016-12-21 10:01:20 +01:00
Torkel Ödegaard 8bccbdafd2 feat(live): minor progress on stream manager 2016-12-21 09:16:29 +01:00
bergquist c3005397f5 docs: adds guide for whats new in 4.1 beta 2016-12-21 08:33:35 +01:00
bergquist c18b410104 docs: updates release date for 4.1.0 2016-12-20 20:11:38 +01:00
Trent White 5440804109 add new grabber icon and tweak styles to better fit space (#7019) 2016-12-20 17:49:04 +01:00
Torkel Ödegaard b7827962dc feat(live): just wanted to checkout how far I got on the websocket data source 2016-12-20 16:09:04 +01:00
bergquist 1c8865e702 docs: updates links to windows beta build 2016-12-20 16:08:05 +01:00
Torkel Ödegaard 1507d6c872 Merge branch 'master' of github.com:grafana/grafana 2016-12-20 15:30:10 +01:00
Torkel Ödegaard 4c5bdd9da4 fix(panel): need to check if panel has links 2016-12-20 15:24:53 +01:00
bergquist 48fbd7e134 docs: add note about closing #4079 2016-12-20 14:46:05 +01:00
bergquist afa5e9507a docs: updates install links for 4.1.0 beta 2016-12-20 13:15:59 +01:00
Utkarsh Bhatnagar 13c4ce68ee Added name and id in response of create/update (#7016) 2016-12-20 13:02:26 +01:00
Torkel Ödegaard fa01022494 fix(ux): fixed css issue with add row button, fixes #7017 2016-12-20 13:00:46 +01:00
Torkel Ödegaard e81e4ad06f updated websocket lib 2016-12-20 11:36:11 +01:00
bergquist 034db646ab release v4.1.0-beta1 2016-12-20 11:25:58 +01:00
bergquist 2660609c40 tech(build): adds scripts for only uploading to testing 2016-12-20 11:12:19 +01:00
bergquist ba96b88b66 feat(alerting): adds 24h and 48h duration as pre defined values
ref #7007
2016-12-20 09:23:05 +01:00
bergquist 80d438ca49 chore(alerting): removes double logging 2016-12-20 08:34:44 +01:00
bergquist 0c857e0ed8 docs(http): adds info about mass pausing alerts 2016-12-19 16:45:46 +01:00
bergquist a230ff65a9 fix(alerting): typo 2016-12-19 16:44:59 +01:00
bergquist 8d6c94b9f9 docs(changelog): adds note about closing #6589 2016-12-19 16:42:11 +01:00
Carl Bergquist 9135abf3ae Merge pull request #6996 from bergquist/pause_all_alerts
Pause all alerts
2016-12-19 16:38:44 +01:00
Torkel Ödegaard 164de5e3ce Merge branch 'master' of github.com:grafana/grafana 2016-12-19 16:36:26 +01:00
Torkel Ödegaard a2baec8592 fix(panel): fixed panel help tooltip issue, #4079 2016-12-19 16:36:09 +01:00
bergquist 6c2c3c7e24 Revert "fix(alerting): pause dto can only pause one"
This reverts commit b2c5a6a037.
2016-12-19 16:07:55 +01:00
bergquist b2c5a6a037 fix(alerting): pause dto can only pause one 2016-12-19 16:05:24 +01:00
bergquist 71f406558e tech(alerting): remove comments 2016-12-19 15:40:09 +01:00
bergquist a2257ec3d0 tech(alerting): renames pause all method 2016-12-19 15:17:49 +01:00
bergquist ecf44d4d9c tech(): go fmt code 2016-12-19 13:26:42 +01:00
bergquist ecdf1888c4 feat(alerting): removes pause per datasource 2016-12-19 13:24:45 +01:00
Torkel Ödegaard 090db9401c fix(graph): fix for when data min/max delta is zero and negative and grid y min/max is auto, fixes #6980 2016-12-19 09:30:52 +01:00
Torkel Ödegaard 3be77ad293 fix(docs): fixed spelling in docs article 2016-12-19 08:42:37 +01:00
bergquist 6b9db0c0c5 style(alerting): simplify support for pausing multiple alerts 2016-12-19 08:18:42 +01:00
Torkel Ödegaard 0a0b4f5533 Merge branch 'info-corner-refinements' 2016-12-16 21:17:47 +01:00
Torkel Ödegaard 2fc2cc721e change(panel): changed hover delay for #6998 2016-12-16 21:16:35 +01:00
Matt 594207b6d3 Polish on icon placement, incorporated torkel's better idea for going slightly lighter, make sure error icon color was white now 2016-12-16 12:51:22 -05:00
Matt 0c85e845df Softened the color a bit by mixing in the panel-bg, so it's not introducing any new variables. Was too start as pure body-bg 2016-12-16 12:11:29 -05:00
bergquist 86f148be48 docs(paths): updates relative path on /installation/ page 2016-12-16 17:42:40 +01:00
bergquist 30022b0d0b docs(paths): adds aliase for rpm and debian install
got reports on twitter about broken links.
2016-12-16 17:36:01 +01:00
bergquist 686f598d44 docs(changelog): adds note about closing #6473 2016-12-16 17:11:33 +01:00
bergquist 4244551a87 fix(influxdb): removes quotes for field key queries
fixes #6473
2016-12-16 17:09:17 +01:00
Torkel Ödegaard 3a9680939e Merge branch 'master' of github.com:grafana/grafana 2016-12-16 16:09:59 +01:00
Torkel Ödegaard a361d1f488 feat(panel): refinements for panel help text, made the inspector the home for the model version 2016-12-16 16:09:02 +01:00
bergquist 4ef95cfd31 style(api): reduce code complexity 2016-12-16 16:07:23 +01:00
bergquist c45ad965d1 chore(github): typo 2016-12-16 15:50:29 +01:00
bergquist 1f8f3ed038 style(api): extracts filter logic for mass pause 2016-12-16 15:19:13 +01:00
bergquist fb6aa0e026 feat(api): adds endpoint for mass pausing alerts
ref #6589
2016-12-16 15:00:58 +01:00
Torkel Ödegaard 2c05237d90 Merge branch 'master' of github.com:grafana/grafana 2016-12-16 13:47:22 +01:00
Torkel Ödegaard c04590784b Merge branch 'utkarshcmu-help-text' 2016-12-16 13:43:51 +01:00
Torkel Ödegaard af363ab478 fix(panel): build fixes 2016-12-16 13:43:43 +01:00
Torkel Ödegaard 62f3b16671 feat(panel): working on panel help text and unifying panel links, panel errors, and panel help into a single panel feature, #4079 , #6847 2016-12-16 13:06:04 +01:00
Torkel Ödegaard ac9ae52cea feat(panel): working on panel help text and unifying panel links, panel errors, and panel help into a single panel feature, #4079 , #6847 2016-12-16 12:46:29 +01:00
Torkel Ödegaard b9043c915e feat(panel): working on panel help text, #4079 , #6847 2016-12-16 11:48:32 +01:00
Mitsuhiro Tanda bc8d27737f fix cloudwatch docs (#6992) 2016-12-16 11:31:02 +01:00
Mitsuhiro Tanda 81394fcaa4 add cloudwatch internal metrics (#6990) 2016-12-16 10:48:05 +01:00
Mitsuhiro Tanda f8d6902428 fix cloudwatch percentile (#6989) 2016-12-16 10:47:41 +01:00
Torkel Ödegaard ca7bc25c83 feat(panel): working on panel help text, #4079 , #6847 2016-12-16 10:34:00 +01:00
bergquist df3adbc0f8 refactor(mqe): reduce duplication 2016-12-16 08:01:58 +01:00
bergquist 830bf5a91c docs(changelog): adds note about closing #6676 2016-12-15 16:31:30 +01:00
bergquist faa3b5f4e8 feat(alertlist): adds sorting on state
closes #6676
2016-12-15 16:29:40 +01:00
bergquist 2264addd9d docs(changelog): adds notes about closing #6905 2016-12-15 14:29:06 +01:00
bergquist c467e48940 feat(notifications): removes html escaping subject
closes #6905
2016-12-15 14:27:33 +01:00
Torkel Ödegaard 597ebb1161 fix(config): fixed issue setting generic oauth name via ENV variable, fixes #6974 2016-12-15 14:08:39 +01:00
Torkel Ödegaard 0c94194a5b Merge branch 'master' of github.com:grafana/grafana 2016-12-15 13:57:05 +01:00
Torkel Ödegaard b50490f080 docs(): changelog updated 2016-12-15 13:56:49 +01:00
Torkel Ödegaard 35b970347a Merge branch 'v4.0.x' 2016-12-15 13:55:26 +01:00
Torkel Ödegaard 497a1fcefc Merge branch 'v4.0.x' of github.com:grafana/grafana into v4.0.x 2016-12-15 13:54:58 +01:00
Torkel Ödegaard 94962b4193 fix(logging): fixed default log level filter option not taking effect, fixex #6978 2016-12-15 13:54:47 +01:00
bergquist 0c8193a6af docs(changelog): adds note about closing #6866 2016-12-15 11:15:06 +01:00
bergquist ca7baca21d feat(alerting): adds ok as no data option
closes #6866
2016-12-15 11:13:19 +01:00
bergquist 6a161216de fix(influxdb): fixes bug with empty tagColumn for annotations 2016-12-15 10:54:22 +01:00
bergquist 51c4385c92 fix(mqe): only parse none empty functions 2016-12-15 08:52:43 +01:00
bergquist f907330c9e tech(mailer): improves error when grafana cannot read open cert/key file
ref #6949
2016-12-15 08:27:21 +01:00
bergquist e3b53fe599 test(mqe): adds test for double function usage 2016-12-15 07:36:06 +01:00
bergquist 7dece3ff0c test(mqe): solves brittle unit test 2016-12-15 07:36:06 +01:00
Torkel Ödegaard 19552450fa Merge branch 'master' of github.com:grafana/grafana 2016-12-14 22:31:11 +01:00
Torkel Ödegaard 435f474e8a docs(): minor fix for docker docs 2016-12-14 22:30:20 +01:00
bergquist dde6e73fed feat(mqe): add basic support for functions list 2016-12-14 22:29:17 +01:00
Solar Olugebefola 1e6210dd41 update broken links (#6961) 2016-12-14 22:20:22 +01:00
Torkel Ödegaard 8fc6e4cfb0 fix(auth proxy, ldap): fixed so users cannot change password when ldap or auth proxy is enabled, fixes #2495, do not allow user to change email or username depending on what property auth proxy is using, fixes #6903 2016-12-14 22:19:25 +01:00
Torkel Ödegaard df562e23cf feat(ldap): better ldap logging, closes #6918 2016-12-14 22:01:02 +01:00
Torkel Ödegaard 6e27db148c Merge branch 'authproxy_ldap' of https://github.com/seuf/grafana into seuf-authproxy_ldap 2016-12-14 21:45:15 +01:00
Torkel Ödegaard 9f69a4d34d clean(): removed old docs file 2016-12-14 21:22:01 +01:00
Torkel Ödegaard c59fd2e8f6 fix(docs): fixed support for old docs url, fixes #6960 2016-12-14 21:21:21 +01:00
Torkel Ödegaard 330c1b945e refactor(datasource): refactoring datasource secure json fields handling, #6697, #6692 2016-12-14 21:06:10 +01:00
Torkel Ödegaard b38e9b0cac fix(cloudwatch): removed debugger statement 2016-12-14 20:40:02 +01:00
Torkel Ödegaard c3920bfba1 fix(cloudwatch): fixed broken cloudwatch edit page, #6697 2016-12-14 20:38:35 +01:00
Torkel Ödegaard 467ddc19c3 feat(panel): worked on panel description tooltip, #6847 2016-12-14 17:22:19 +01:00
bergquist ca6a667555 feat(mqe): renames app tag into cluster 2016-12-14 16:49:16 +01:00
Torkel Ödegaard 5f7ad9ddb6 Merge branch 'help-text' of https://github.com/utkarshcmu/grafana into utkarshcmu-help-text 2016-12-14 16:20:36 +01:00
bergquist f8871f9e4a chore(mqe): remove comments 2016-12-14 16:16:42 +01:00
bergquist 6d57e42246 feat(mqe): restricts the executor to max 4 concurrent outgoing requests 2016-12-14 15:40:15 +01:00
Torkel Ödegaard 7425c63528 fix(dashboard): fixed unit test 2016-12-14 14:42:25 +01:00
Torkel Ödegaard e72a60bbf5 feat(graph): shared graph tooltip is not a select option with 3 options, normal, shared crosshair & shared tooltip, CTRL+O or CMD+O cycles option, closes #6894 2016-12-14 14:33:33 +01:00
Torkel Ödegaard baec2bbe8a fix(firefox): fixed table options tab UX issues, fixes #6900 2016-12-14 13:16:54 +01:00
Torkel Ödegaard 488fe62f15 fix(singletat): fixed/polished layout in singlestat ui options tab 2016-12-14 12:58:20 +01:00
Torkel Ödegaard faf6a5fd36 fixed issue in metric segment and option lookup, #6912 2016-12-14 10:50:48 +01:00
Carl Bergquist 38d8ba8faa Merge pull request #6952 from huydx/format-gofmt
(format) run go fmt in pkg
2016-12-14 09:26:38 +01:00
Carl Bergquist 9cd04768f7 Merge pull request #6953 from huydx/typo-execution
(typo) Exeuction -> Execution
2016-12-14 09:24:54 +01:00
bergquist 9510f21304 docs(changelog): fixes invalid ticket ref 2016-12-14 09:12:22 +01:00
huydx b97f4fd8b9 (typo) Exeuction -> Execution 2016-12-14 12:21:41 +09:00
huydx adb441e5c8 (format) run go fmt in pkg 2016-12-14 12:17:38 +09:00
bergquist 63bf332023 Merge branch 'alerting_mqe' 2016-12-13 16:15:22 +01:00
bergquist e6c557bb91 Merge branch 'master' into alerting_mqe 2016-12-13 16:15:04 +01:00
bergquist 362162d6fa feat(mqe): add token cache 2016-12-13 14:01:48 +01:00
bergquist 69d6316512 style(mqe): instance dependencies in ctor func 2016-12-13 12:47:57 +01:00
bergquist 549c3ab78b tech(mqe): update todo 2016-12-13 11:42:06 +01:00
bergquist b620c7457d test(query_editor): adds test for nesting queries in targetFull 2016-12-13 10:46:09 +01:00
Utkarsh Bhatnagar bd20dc6c4c Fixed failing tests (#6941) 2016-12-13 10:00:33 +01:00
bergquist 76f78c0f72 test(alert_tab): basic test skeleton
I created this test by misstake. But instead of deleting it I thought it
might be good to keep it to make it easier to add tests for the alert
tab
2016-12-13 09:50:38 +01:00
Torkel Ödegaard 62d18cd493 docs(): updated changelog with PR #6940 2016-12-13 09:18:10 +01:00
Utkarsh Bhatnagar 5777f65d05 Basic Auth now supports LDAP username and password (#6940) 2016-12-13 09:15:52 +01:00
Torkel Ödegaard 0841e841f5 cleanup(): removed docker/production folder as it was old and unused (ie grafana-docker repo is the place for the offical production docker container 2016-12-12 22:12:27 +01:00
bergquist e1703166f0 docs(changelog): add thank you note to contributor 2016-12-12 19:06:21 +01:00
bergquist 99e3db8208 Merge branch 'master' into alerting_mqe 2016-12-12 19:01:50 +01:00
Torkel Ödegaard 46c161b104 Merge branch 'master' of github.com:grafana/grafana 2016-12-12 16:35:59 +01:00
Torkel Ödegaard 80d88d302c fix(config): changed default for oauth and allow_sign_up setting, #6928 2016-12-12 16:35:42 +01:00
Hans Kristian Flaatten 1060b99810 docs(configuration): set allow_sign_up to true for gerneric OAuth (#6928)
This enables Grafana to accept new users authenticated through OAuth, without this set to true only previously authenticated users may log in with OAuth - and thus defeating the purpose.
2016-12-12 16:27:51 +01:00
Torkel Ödegaard 9da44141f1 fix(git): removed external submodule, accedentially included in PR, fixes #6929 2016-12-12 15:43:04 +01:00
bergquist 0e03c43174 docs(changelog): adds note about merging #4550 2016-12-12 14:59:02 +01:00
bergquist f33aeb6591 Merge branch 'adrianlzt-bug/show_multiple_tags_with_influxdb' 2016-12-12 14:56:51 +01:00
bergquist 530e1b358a Merge branch 'master' into adrianlzt-bug/show_multiple_tags_with_influxdb 2016-12-12 14:55:56 +01:00
bergquist ce4e71364c test(influxdb): adds tests for supporting multiple tags 2016-12-12 14:55:39 +01:00
Torkel Ödegaard 5ec7dea81a Merge branch 'v4.0.x' 2016-12-12 14:39:53 +01:00
Torkel Ödegaard 8feaef20e0 fix(graph): fixed graph issue with axes mode set to series and picking Max value, fixes #6926 2016-12-12 14:37:40 +01:00
Torkel Ödegaard 40b359334b fix(typescript): fixed sourcemap issue, #6904 2016-12-12 14:24:36 +01:00
bergquist d599f45707 Merge branch 'bug/show_multiple_tags_with_influxdb' of https://github.com/adrianlzt/grafana into adrianlzt-bug/show_multiple_tags_with_influxdb 2016-12-12 13:30:27 +01:00
bergquist ba848cffb4 docs(cli): add page for the cli 2016-12-12 13:15:35 +01:00
Torkel Ödegaard ee6cd727ea Merge branch 'master' of github.com:grafana/grafana 2016-12-12 11:38:31 +01:00
Torkel Ödegaard 3bb9d47a45 minor change to #6904 2016-12-12 11:38:10 +01:00
bergquist 413a187119 docs(notification): add message property to notification 2016-12-12 11:28:16 +01:00
Carl Bergquist a5c41fe7cb Merge pull request #6921 from huydx/master
fix(alert): alert test should return error when it failed to dispatch
2016-12-12 11:02:14 +01:00
Torkel Ödegaard 815722c3cc Merge branch 'upgrade_typescript' of https://github.com/Nepomuceno/grafana into Nepomuceno-upgrade_typescript 2016-12-12 10:53:19 +01:00
bergquist 3cbc325f18 tech(github): asks ppl to remove placeholder text 2016-12-12 10:39:45 +01:00
huydx 015fa82cf5 fix(alert): alert test should return error when it failed to dispatch 2016-12-12 18:22:58 +09:00
Seuf 12a82bc0d4 Auth Proxy improvements - adds the option to use ldap groups for authorization in combination with an auth proxy - adds an option to limit where auth proxy requests come from by configure a list of ip's - fixes a security issue, session could be reused 2016-12-12 09:53:02 +01:00
Seuf ae27c17c68 Auth Proxy improvements
- adds the option to use ldap groups for authorization in combination with an auth proxy
- adds an option to limit where auth proxy requests come from by configure a list of ip's
- fixes a security issue, session could be reused
2016-12-12 09:43:17 +01:00
bergquist 06b4dacaa4 docs(changelog): add note about closing #5479 2016-12-12 08:37:29 +01:00
Carl Bergquist 73ec529688 Merge pull request #6897 from grafana/cli_db_commands
Enable the CLI to do change the grafana admin password in the database
2016-12-12 08:30:20 +01:00
Gabriel Nepomuceno cbf0d571f5 Removing task from other build sources 2016-12-10 09:00:58 +00:00
Gabriel Nepomuceno 2f46c56672 removing type validation because copy needs to be done first 2016-12-09 23:41:07 +00:00
Gabriel Nepomuceno 7ff07aa7b1 Revoming old files 2016-12-09 22:05:11 +00:00
Gabriel Nepomuceno a8ae0a5b79 fixing compilation of grunt 2016-12-09 21:53:00 +00:00
Gabriel Nepomuceno f3ebd2d849 upgrading bases and correcting identation missing tslint 2016-12-09 14:57:25 +00:00
Axel 2adbe3e13e Prettify duration value format (#6875)
* Prettify duration unit format

Format duration like "2 days, 19 hours, 48 minutes" and make Decimals useful e.g.
0 decimals: 2 days
2 decimals: 2 days, 19 hours, 48 minutes
3 decimals: 2 days, 19 hours, 48 minutes, 27 seconds

Previous code did some rounding that is now gone so numbers might be
different.

* Rewrite kbn.toDuration without moment.js

Because https://github.com/moment/moment/issues/3653

* Add tests for kbn.toDuration
2016-12-09 15:55:25 +01:00
bergquist 96e8ecfa7b feat(cli): adds command to reset admin password
closes #5479
2016-12-09 15:25:02 +01:00
bergquist cd85e1f651 Merge branch 'master' into cli_db_commands 2016-12-09 12:36:05 +01:00
bergquist ba7a990f86 tech: bump version in server cli 2016-12-09 12:30:36 +01:00
bergquist 02392e5189 docs(changelog): adds PR contributors name to release notes 2016-12-09 12:19:41 +01:00
bergquist 64f22e7037 docs(changelog): add note about closing #6356 2016-12-09 11:49:23 +01:00
bergquist cfb6033765 Merge branch 'elastic5_support' 2016-12-09 11:42:15 +01:00
bergquist 619c5c4f1b Merge branch 'master' into elastic5_support 2016-12-09 11:41:23 +01:00
bergquist ebec02ffae style(elastic): minor code style changes 2016-12-09 11:40:00 +01:00
bergquist 99c5f7d571 feat(elastic): remove support for ES 1.x 2016-12-09 11:34:19 +01:00
bergquist 873024b917 tech(elastic): use bool conditions for all es queries 2016-12-09 11:13:28 +01:00
Matt Toback e58b6989c2 Small refactor to make hover highlighting proper, added a title tag for the completed grafana step. (#6882) 2016-12-09 09:42:24 +01:00
Matt Toback f39f77692b Adjusted the active state to fix the faint line showing. Probably related to the font change going into 4.0 (#6886) 2016-12-09 09:41:54 +01:00
Carl Bergquist 20e4cb9a0b Merge pull request #6885 from utkarshcmu/patch-1
Fixed Create org API in docs
2016-12-09 08:53:33 +01:00
Utkarsh Bhatnagar db3ac79015 Fixed Create org API in docs 2016-12-08 12:08:04 -08:00
bergquist 6265afd8b6 docs: updat latest to 4.0.2 2016-12-08 15:17:13 +01:00
bergquist 7c3c8bc4c9 docs(changelog): add date for 4.0.2 release 2016-12-08 15:14:44 +01:00
bergquist 49827de278 docs: release 4.0.2 2016-12-08 15:05:37 +01:00
bergquist a90f650109 update package.json version to 4.0.2 2016-12-08 14:04:08 +01:00
bergquist f68350acbf docs(alerting): link fix to issue rather then commit 2016-12-08 14:01:59 +01:00
Torkel Ödegaard 22bf6420f1 Merge branch 'master' of github.com:grafana/grafana 2016-12-08 10:25:26 +01:00
Torkel Ödegaard 05772b30d7 feat(ux): completed work on getting started panel, #6466 2016-12-08 10:25:05 +01:00
Carl Bergquist 249b82d28b Merge pull request #6873 from dec5e/reference_typos
Fix some typos in Reference docs
2016-12-08 09:49:10 +01:00
Andrey Artemov c97e95227a Fix some typos in "Export & Import" reference 2016-12-08 10:34:53 +02:00
Andrey Artemov c94805d4c2 Fix typo in Singlestat page title 2016-12-08 10:34:31 +02:00
Torkel Ödegaard dee6b7d150 Merge branch 'master' into getting-started-panel 2016-12-08 08:51:40 +01:00
Matt Toback 6ae6a5d312 Polished some styles, updated issue 6466 2016-12-07 14:51:00 -05:00
bergquist 8ee85626f2 fix(api): return correct json info after updating datasource
closes #6869
2016-12-07 18:09:17 +01:00
bergquist c871212d6c docs(changelog): adds note about fixing avg() reducer bug 2016-12-07 15:58:03 +01:00
bergquist dd3060fdc3 feat(alerting): calculate avg of valid points 2016-12-07 15:55:37 +01:00
Torkel Ödegaard 924535c6d0 change(graph): changed null value graph option to default to null, closes #6868 2016-12-07 15:27:20 +01:00
bergquist 2bdd2a59cb test(alerting): improve naming for test scenario 2016-12-07 15:19:58 +01:00
Adrian Lopez 395b834a23 Better match for culumn inside tagsColumn 2016-12-07 12:23:57 +01:00
Torkel Ödegaard e082d78697 fix(elasticsearch): removed unused code 2016-12-07 12:07:56 +01:00
Torkel Ödegaard 7b68e6ea3b feat(elasticsearch): Added support for Missing option (bucket) for terms aggregation, refactoring PR #4244, thx @shanielh 2016-12-07 12:06:47 +01:00
bergquist dd432e671e docs(changelog): note about closing #6687 2016-12-07 11:28:18 +01:00
Carl Bergquist 0294446af9 Merge pull request #6856 from kylemcc/opsgenie-alerting
alerting: add support for OpsGenie
2016-12-07 11:23:54 +01:00
Carl Bergquist 2c7adccf12 Use cache for http.client in tsdb package. (#6833)
* datasource: move caching closer to datasource struct

* tsdb: use cached version of datasource http transport

closes #6825
2016-12-07 11:10:42 +01:00
vaibhavinbayarea 24172fca01 Added feature request "predict value" in moving averages pipeline agg (#5689)
issue-id: #5688
2016-12-07 10:47:46 +01:00
Matt Toback d28726be06 Moved ADD ROW to left to consolidate row actions along the same vertical area. (#6852) 2016-12-07 10:45:23 +01:00
Carl Bergquist b0679b610f Merge pull request #6857 from SaaldjorMike/typo
Fix docs typo
2016-12-06 23:36:55 +01:00
Mike Rostermund c5b29228ee Add missing char/typo 2016-12-06 22:26:43 +01:00
Kyle McCullough 4ef940482c alerting: add support for OpsGenie 2016-12-06 14:48:13 -06:00
utkarshcmu 6b26a0f91d Fixed hover position 2016-12-06 05:53:33 -08:00
utkarshcmu 13f0b32a8f Added sanitizer to help text 2016-12-06 05:24:03 -08:00
bergquist 6440d884db elastic: make sure old tests are for es2 2016-12-06 14:17:03 +01:00
utkarshcmu 034d84354e Fixed HelpText input box 2016-12-06 03:58:38 -08:00
utkarshcmu 42de27a2cb Added help text for users 2016-12-06 03:54:44 -08:00
Torkel Ödegaard 83afbd4262 Merge branch 'master' of github.com:grafana/grafana 2016-12-06 11:58:51 +01:00
Torkel Ödegaard e1b25b3999 changelog(): updated changelog with info on shared tooltip feature merged via PR #6274, closes #1578 2016-12-06 11:58:39 +01:00
Torkel Ödegaard fa393c282a feat(graph): refactoring shared tooltip PR #6274 2016-12-06 11:55:20 +01:00
bergquist 005a17d52f Merge branch 'master' of https://github.com/lpic10/grafana into lpic10-master 2016-12-06 10:15:36 +01:00
bergquist 464553a453 docs: explains how to use comment chars in passwords 2016-12-06 09:48:56 +01:00
Torkel Ödegaard 51165e76ba Merge branch 'shared_tooltip' of https://github.com/connection-reset/grafana into connection-reset-shared_tooltip 2016-12-06 09:32:22 +01:00
bergquist 8f1ed07275 metrics: 64bit fields should come first in structs
https://golang.org/pkg/sync/atomic/#pkg-note-BUG
2016-12-06 09:08:51 +01:00
bergquist 21353f4ba5 docs: adds note about closing #6779 2016-12-06 09:08:50 +01:00
Torkel Ödegaard 9bb440bc82 Merge branch 'master' of github.com:grafana/grafana 2016-12-06 09:02:51 +01:00
bergquist c17064fb44 fix(webdav): adds missing auth headers
closes #6779
2016-12-06 09:02:14 +01:00
Torkel Ödegaard 62269bb894 change(influxdb): always specify absolute time range in milliseconds, refactoring #6571 2016-12-06 08:56:01 +01:00
Torkel Ödegaard c6bb86d833 Merge branch 'master' of https://github.com/ryantxu/grafana into ryantxu-master 2016-12-06 08:38:29 +01:00
jifwin e73b82d54f Disable web-security for phantomjs rendering (#6469) 2016-12-06 08:37:36 +01:00
Ben RUBSON e51525dbde Only take bar series to calculate barWidth (#6756)
* Only take bar series to calculate barWidth

solves #6751

* Typo

* Typo

* Typo

* Typo

* Refactor

* Simplify
2016-12-06 08:36:23 +01:00
Mitsuhiro Tanda 5f6a3ecd56 (cloudwatch) don't expand variable when panel or row repeat is used (#6618)
* (cloudwatch) don't expand variable when panel or row repeat is used

* fix test
2016-12-06 08:16:41 +01:00
Mitsuhiro Tanda be26c017f6 (cloudwatch) percentile support (#6634)
* support extended statistics

* handle different response format for extended statistics
2016-12-06 08:12:30 +01:00
Torkel Ödegaard d56b9a720a feat(alerting): added confirm text when removing panel with alert rule 2016-12-06 08:11:21 +01:00
Adrian Muraru f91fcaf5cf Dashboard PNG export (#6644) 2016-12-06 08:05:13 +01:00
Torkel Ödegaard 167936f9b9 updated changelog 2016-12-06 07:43:39 +01:00
Torkel Ödegaard ee36234196 Merge branch 'v4.0.x' 2016-12-06 07:42:35 +01:00
Torkel Ödegaard f9fba0e935 fix(timerange): fixed time range zoom out shortcut, fixes #6837 2016-12-06 07:42:22 +01:00
Torkel Ödegaard 88e1d56bc2 fix(logging): added extra logging when default config file is not found (ie homepath is not correct), fixes #6829 2016-12-06 07:36:10 +01:00
Torkel Ödegaard 4c406dec2f cleanup(): removed unused (old) migrate stuff 2016-12-05 12:52:34 +01:00
Torkel Ödegaard aea3093d85 change(Timepicker): removed last 90 days to make room for Last 2 days, #6758 2016-12-05 11:52:00 +01:00
Jaime Soriano Pastor f2d5829944 Add 'Last 2 days' option to quick ranges (#6758) 2016-12-05 11:51:02 +01:00
Torkel Ödegaard 37c1a49dc9 updated changelog 2016-12-05 11:44:50 +01:00
Torkel Ödegaard 50022253bd Merge branch 'v4.0.x' 2016-12-05 11:44:02 +01:00
Torkel Ödegaard 890e5ce8ca feat(playlist): added support for kiosk mode & minor polish/fix, closes #6727 2016-12-05 11:43:51 +01:00
Torkel Ödegaard 80f7a6a896 updated changelog 2016-12-05 11:20:54 +01:00
Torkel Ödegaard 1f50c6d76f Merge branch 'v4.0.x' 2016-12-05 11:20:14 +01:00
Torkel Ödegaard cc46b81961 fix(rendering): fixed server side rendering issue when sertting enforce_domain to true, fixes #6769 2016-12-05 11:20:01 +01:00
Torkel Ödegaard c5ff1e4584 Merge branch 'v4.0.x' 2016-12-05 11:04:24 +01:00
Torkel Ödegaard a9c0f66cda fix(influxdb): Fix for Ad-Hoc Filters variable & changing dashboards, fixes #6821 2016-12-05 11:04:05 +01:00
Torkel Ödegaard e1d52902c1 Merge branch 'master' of github.com:grafana/grafana 2016-12-05 10:54:40 +01:00
Torkel Ödegaard d1feaaf4f3 Merge branch 'v4.0.x' 2016-12-05 10:54:01 +01:00
Torkel Ödegaard ab07667b69 fix(rendering): minor fix for server side rendering when using non default http addr setting and non default domain setting, #6813 2016-12-05 10:51:46 +01:00
silvestre-abruzzo 48a14cb4c6 Use correct domain in render.js (#6813)
Phantomjs is always rendering login page because domain is not considered. According to http://phantomjs.org/api/webpage/method/add-cookie.html a correct domain must be passed. Probably this change is now necessary due to https://github.com/grafana/grafana/issues/6660
2016-12-05 10:50:23 +01:00
bergquist b81e97c99c webhook: adds json content-type
closes #6822
2016-12-05 10:46:04 +01:00
bergquist 4a2a935c8f changelog: adds note about closing #6822 2016-12-05 10:45:22 +01:00
bergquist 87dbdb8300 webhook: adds json content-type
closes #6822
2016-12-05 10:44:31 +01:00
bergquist 1b68116922 changelog: add bugfix header 2016-12-05 09:42:31 +01:00
bergquist ea829988da changelog: add note about closing #6807 2016-12-05 09:39:20 +01:00
bergquist 0403f53b6f feat(webhook): adds alert rule message to webhook
close #6807
2016-12-05 09:34:35 +01:00
bergquist b88478a7e5 docs(readme): remove link to old CLA page 2016-12-03 03:46:51 +01:00
Carl Bergquist fbf2113904 Merge pull request #6795 from hvnsweeting/patch-1
Use space to separate multiple modes
2016-12-03 03:15:31 +01:00
bergquist 6c9cf87080 feat(alerting): calculate avg of valid points 2016-12-02 23:44:14 +01:00
bergquist c9b7f8603e tech(): replace spaces to handle input more graceful 2016-12-02 23:43:02 +01:00
bergquist 9dd6cf45ac feat(webhook): adds alert rule message to webhook
close #6807
2016-12-02 22:24:36 +01:00
bergquist 96cd13044b change to golang 1.7.4 2016-12-02 21:27:12 +01:00
bergquist f70d7ff3a3 fix(influxdb): align tsdb.influxdb with dataproxy
ref #6784
2016-12-02 21:10:29 +01:00
bergquist 368889828d update latest.json to 4.0.1 2016-12-02 21:10:11 +01:00
Torkel Ödegaard a5f7edbe40 Update CHANGELOG.md 2016-12-02 11:29:12 -05:00
Torkel Ödegaard bc0fdc1f8e Update CHANGELOG.md 2016-12-02 11:28:06 -05:00
bergquist 8134724b8a docs: update links to 4.0.1 2016-12-02 17:17:33 +01:00
bergquist f7dced3067 update to version 4.0.1 2016-12-02 16:33:00 +01:00
bergquist b4b7156f42 fix(webdav): adds missing auth headers
closes #6779
2016-12-02 16:20:15 +01:00
Carl Bergquist c206c04399 Merge pull request #6796 from hvnsweeting/patch-2
Update sample.ini
2016-12-02 16:10:39 +01:00
bergquist 04fa86fdde docs(changelog): note about closing #6759 2016-12-02 15:43:39 +01:00
stuart nelson bc69c8ef40 Add transport cache for reverse proxy (#6776)
* Add transport cache for reverse proxy
* Use updated at in cache
2016-12-02 15:39:57 +01:00
stuart nelson 9ed21c6a16 Add transport cache for reverse proxy (#6776)
* Add transport cache for reverse proxy
* Use updated at in cache
2016-12-02 15:39:28 +01:00
Viet Hung Nguyen c6e66ec15e Update sample.ini
Use space to separate multiple modes
2016-12-02 13:48:08 +07:00
Viet Hung Nguyen b00fc73242 Use space to separate multiple modes 2016-12-02 13:46:41 +07:00
fg2it d3e47e50c1 swap member declaration in StandardGauge to avoid problem with atomic on arm and x86-32 2016-12-01 21:26:54 +01:00
bergquist 158656f570 docs(changelog): add note about closing #6749 2016-12-01 21:23:55 +01:00
Carl Bergquist 6c03c64c79 Merge pull request #6768 from fg2it/fix6749
fix 6749 by swapping member in StandardGauge to avoid problem with atomic
2016-12-01 21:16:16 +01:00
Carl Bergquist ae171357fc Merge pull request #6783 from solugebefola/patch-1
typo?
2016-12-01 18:16:10 +01:00
Solar Olugebefola 1c234c6089 typo? 2016-12-01 11:54:07 -05:00
Axel Pirek e6c8e75d62 Make tooltip shareable like crosshair 2016-12-01 10:10:23 +01:00
fg2it 834e3f1c29 swap member declaration in StandardGauge to avoid problem with atomic on arm and x86-32 2016-11-30 21:57:18 +00:00
bergquist 09e49f0a17 docs: adds note about closing #5677 2016-11-30 00:10:29 +01:00
Carl Bergquist d11b17b8fe Merge pull request #5677 from bmundt/remove_columns
Added Hidden Column Style for Table Panel
2016-11-30 00:08:17 +01:00
bergquist 4543bfe5aa docs: add note about closing cloudwatch 2016-11-29 23:38:44 +01:00
Carl Bergquist 3c662ade8c Merge pull request #6698 from grafana/cloudwatch_configurable_keys
Cloudwatch configurable keys from config page.
2016-11-29 23:37:13 +01:00
bergquist 180940a378 fix(singlestat): align width for gauge settings 2016-11-29 23:25:45 +01:00
bergquist 0d41b1294a fix(singlestat): align width for gauge settings 2016-11-29 23:24:46 +01:00
bergquist 16f6339327 docs: add note about closing #6740 2016-11-29 23:20:48 +01:00
Carl Bergquist c2ed24b788 Merge pull request #6740 from dirk-leroux/new_aggregation_on_singlestat_panel
New aggregation on singlestat panel
2016-11-29 23:18:01 +01:00
bergquist aa14d9d893 docs: add note about closing #6411 2016-11-29 22:30:05 +01:00
bergquist 87824d2be7 Merge branch 'ichekrygin-victorops' 2016-11-29 22:28:39 +01:00
bergquist 83e90325c9 chore(victorops): remove unused code 2016-11-29 22:26:42 +01:00
bergquist a6ea2f4fdb Merge branch 'victorops' of https://github.com/ichekrygin/grafana into ichekrygin-victorops 2016-11-29 22:22:25 +01:00
bergquist bb6248a51a docs: remove link to CLA since we use CLA assistance 2016-11-29 21:51:51 +01:00
bergquist a3a07b7191 docs(changelog): add note about closing #6655 2016-11-29 21:43:31 +01:00
Carl Bergquist b47410af6a Merge pull request #6670 from tomkozlowski/feature/postgres-certs
generalized database connection cert support and added to postgres
2016-11-29 21:40:27 +01:00
bergquist 9f4d06e8e2 docs(changelog): add note about closing #5443 2016-11-29 21:24:45 +01:00
bergquist 253324fc32 style(sqlstore): remove comment 2016-11-29 21:24:45 +01:00
Carl Bergquist f6557f14b7 Merge pull request #6741 from dpavlos/fix_5443
[5443] Check if title is empty before save a new dashboard
2016-11-29 21:22:07 +01:00
bergquist 3b4e55216c docs(changelog): add note about fixing #6679 2016-11-29 21:14:37 +01:00
Carl Bergquist 5a0fc434f3 Merge pull request #6722 from dpavlos/fix_6679
[6679] Check if org exists before delete it
2016-11-29 21:12:02 +01:00
bergquist b00e9390d3 docs(v4): update docs for v4 2016-11-29 19:03:33 +01:00
bergquist a73bebbf3d tech(build): update publish script for 4.0.x release 2016-11-29 18:18:44 +01:00
bergquist aed695ebe0 tech(build): set master to 4.1.0 pre 2016-11-29 18:03:20 +01:00
bergquist 9143165580 tech(build): change windows build branch 2016-11-29 17:41:18 +01:00
Torkel Ödegaard 25a5fc465c fix(row): fixed dropping new panels onto panels, should split target panel 2016-11-29 11:38:02 -05:00
Torkel Ödegaard 7276b00fc7 fix(row): fixed dropping new panels onto panels, should split target panel 2016-11-29 11:37:06 -05:00
bergquist 567c2a1799 tech(build): update branch to package 2016-11-29 17:31:15 +01:00
bergquist 231492d443 tech(build): change windows build branch 2016-11-29 17:03:49 +01:00
bergquist 64f371a32d tech: upgrade package json to v4.0.0 2016-11-29 16:51:38 +01:00
bergquist 360516ed41 feat(metrics): change active alerts to guage 2016-11-29 16:46:25 +01:00
Torkel Ödegaard 7e831e10a2 updated version in grafana-server main.go 2016-11-29 10:41:31 -05:00
Pavlos Daoglou 7f7f080ad8 [5443] Check if title is empty before save a new dashboard 2016-11-29 12:25:20 +02:00
Dirk le Roux e0073d7e54 Fixed spelling error 2016-11-29 08:32:51 +02:00
Dirk le Roux 6412bd2f57 oAdded value type documentation to singlestat panel
Signed-off-by: Dirk le Roux <dirk.leroux@gmail.com>
2016-11-29 08:26:32 +02:00
Dirk le Roux 49dda7e5c1 first, delta, range passing unit tests
Signed-off-by: Dirk le Roux <dirk.leroux@gmail.com>
2016-11-29 08:26:31 +02:00
Ryan McKinley 0534d43a6e use ms when query less then 5 mins 2016-11-28 14:57:36 -08:00
Ryan McKinley 1ce0d81736 Merge remote-tracking branch 'grafana/master' 2016-11-28 13:38:18 -08:00
bergquist f7e8e9c9af docs(readme): bump golang version 2016-11-28 20:47:04 +01:00
Carl Bergquist 2bdb2f79ec fix(table): renderes empty date column as '-' (#6736)
* fix(table): renderes empty date column as '-'

closes #6728

* docs(changelog): add note about closing 6728
2016-11-28 14:42:43 -05:00
bergquist 2bdeb78885 style(docker): remove comments 2016-11-28 18:48:34 +01:00
bergquist 20df0aafc2 tech(docker): adds docker fig for elastic 5 2016-11-28 18:43:26 +01:00
bergquist ab2f109443 fix(config): error message for broken config file
closes #6731
2016-11-28 17:55:18 +01:00
Torkel Ödegaard a2d1cc1a46 fix(css): minor style fix 2016-11-28 09:39:07 -05:00
Pavlos Daoglou 0064331bbf [6679] Check if org exists before delete it 2016-11-28 00:09:01 +02:00
bergquist b2edcd8cfd tech(docs): use relref for links 2016-11-27 20:22:29 +01:00
bergquist ce64a0173c docs(datasource): add root datasource page 2016-11-27 20:05:35 +01:00
bergquist 3475ff2d81 docs(http): moves overview content to /http_api/
ref #6719
2016-11-27 17:09:56 +01:00
bergquist e3ad740b49 docs(changelog): add note about closing #6701 2016-11-27 16:56:31 +01:00
bergquist bdfb773a98 fix(alerting): fixes broken no_value evaluator
closes #6701
2016-11-27 16:53:29 +01:00
bergquist 583de8e0e0 docs(graph): remove unused headers 2016-11-27 16:10:16 +01:00
bergquist adc1bd3dea docs(graph): moves thresholds to display tab
closes #6703
2016-11-27 16:07:41 +01:00
bergquist 7bc1c3cc1c feat(cloudwatch): make it possible to reset keys
closes #6697
2016-11-24 16:37:33 +01:00
bergquist 3d21f06d5b tech(cloudwatch): store keys in secure json blob 2016-11-24 14:16:52 +01:00
bergquist 0ea6537916 tech(cloudwatch): refactoring 2016-11-24 14:00:05 +01:00
bergquist f7e12e5f93 test(cloudwatch): fixes failing tests 2016-11-24 14:00:05 +01:00
bergquist 1695aece0c feat(cloudwatch): add authtype dropdown to config page 2016-11-24 14:00:05 +01:00
bergquist 64784db870 feat(cloudwatch): adds access and secret key to edit config page 2016-11-24 14:00:05 +01:00
bergquist c3075a9bd1 docs(changelog): add note about solving sync problem for alerts 2016-11-24 13:59:52 +01:00
Torkel Ödegaard 2f354ed926 fix(getting started panel): some more work on this, #6466 2016-11-24 13:58:51 +01:00
Carl Bergquist 42f522fe97 Merge pull request #6692 from grafana/feature/tls-client-auth
Feature/tls client auth
2016-11-24 13:58:08 +01:00
Daniel Lee ad8f06f87f feat(changelog): adds TLS Client auth 2016-11-24 13:57:19 +01:00
bergquist 2bbe3d56bc docs(alerting): add info about alerting metrics 2016-11-24 13:45:24 +01:00
Daniel Lee 0618122bcd feat(httpsettings): add tls auth option
- Three text areas where the user can paste
in the CA Cert (optional), Client Cert
and Client Key.

- Tooltips for Auth checkboxes with brief
descriptions of what With Credentials and
With CA Cert are.

- Adds popover for TLS Auth header too.

- Aligns gf-form elements as labels and
checkboxes were not aligned before.

- Makes CA Cert optional as it is only
needed for self-signed certs.
2016-11-24 13:33:28 +01:00
Daniel Lee b6b53c0f4b fix(dataproxy): test with CA Cert 2016-11-24 13:22:25 +01:00
Daniel Lee 2893b25a05 feat(datasources): allow updating of tls certs
The tls files are stored as a json blob in the
SecureJsonData field. To update one file, the
json has to be fetched from the db first and
then updated with the cert file that has been
changed.

Also, a change to the dto with flags that are
used in the frontend to show if a file has
been uploaded. For example, if tlsClientKeySet
is set to true then means a file for the
client key is saved in the db. This is to
avoid sending any private data to the frontend.
2016-11-24 13:22:25 +01:00
Daniel Lee 387f8cc0c6 feat(dataproxy): TLS CA Cert for self-signed certs
For self-signed TLS Certificates, authentication
with InsecureSkipVerify set to false then this
error will occur:

x509: certificate signed by unknown authority

The solution is to allow the user to upload the
CA cert as well.
2016-11-24 13:22:25 +01:00
Daniel Lee c9b2c694f1 refactor(dataproxy): TLS Client Auth
Use a SecureJsonData field for TLS
Client Auth instead of 3 new db
fields. Same model as used for
PluginSettings.

Saves and encrypts the pem file
content rather than just saving
the paths to the cert and key.
This allows for uploading from
the Edit Datasource page in
Grafana.
2016-11-24 13:22:25 +01:00
Daniel Lee af07adb146 refactor(securejsondata): extract to class
Extract from pluginsettings class so that the
securejsondata type can be used in the other
classes. Encrypt and decrypt functions
extracted too.
2016-11-24 13:22:25 +01:00
Joe Lanford 56b7e2dfaf Added support for TLS client auth for datasource proxies (#5801) 2016-11-24 13:22:25 +01:00
Torkel Ödegaard 2233938ba7 Merge branch 'master' into getting-started-panel 2016-11-24 13:17:22 +01:00
Torkel Ödegaard ad7ae1b912 fix(graph): Fixed tooltip date header visible when x-mode was set to series, fixes #6364 2016-11-24 13:16:46 +01:00
bergquist 421c1eed82 fix(dashboard): fixes bug when saving dashboards 2016-11-24 11:22:13 +01:00
Torkel Ödegaard d9cf6a958b fix(unsaved changes): You now navigate to the intended page after saving in the unsaved changes dialog fixes #6675 2016-11-24 11:06:09 +01:00
Ben RUBSON 614bd7f1e8 Sort series by yaxis by default (#6683)
* Sort series by yxis by default

* Sort series by yxis by default

* Sort series by yxis by default
2016-11-24 10:24:49 +01:00
bergquist 6081c6cb61 docs(http_api): convert to new docs format 2016-11-24 10:16:24 +01:00
Carl Bergquist df2b2e3058 feat(alerting): validate alerts before saving dashboard (#6691)
ref #6576
2016-11-24 09:50:35 +01:00
Torkel Ödegaard 223f2320eb fix(streaming): clear data stream on subject completion 2016-11-23 17:12:30 +01:00
Torkel Ödegaard cf751c256b fix(graph): fixed order of graph tooltip when sort order was none, fixes #6648 2016-11-23 17:08:14 +01:00
Torkel Ödegaard ea5cb0d076 fix(server side rendering): Fixed address used when rendering panel via phantomjs and using non default http_addr config, fixes #6660 2016-11-23 15:35:43 +01:00
Torkel Ödegaard 773fb5d1ae fix(alerting): check if dashboard is saved before testing alert rule, fixes #6549 2016-11-23 14:55:10 +01:00
Pavlos Daoglou c365d52a80 [6486] Fix status code when adding an existing user to org (#6678) 2016-11-23 14:38:44 +01:00
Mitsuhiro Tanda d018d2a23f (prometheus) table support 2016-11-23 17:18:37 +09:00
bergquist 02dc51b1b6 docs(influxdb): typo 2016-11-23 07:15:34 +01:00
Carl Bergquist 78ce29b8f1 Merge pull request #6671 from peregrinogris/patch-2
Fix typo in Basic Concepts
2016-11-23 06:30:44 +01:00
Hernán Rodríguez Colmeiro e7e83a71a6 Fix typo in Basic Concepts 2016-11-22 21:47:59 -03:00
Tom Kozlowski c21ffcc6c9 generalized database connection cert support and added to postgres 2016-11-22 15:29:22 -08:00
bergquist 56156fcd7f feat(alerting): add median reducer to frontend 2016-11-22 14:35:26 +01:00
Torkel Ödegaard 2a33594c02 fix(templating): fixed duplicate button bug, fixes #6652 2016-11-22 14:20:24 +01:00
Torkel Ödegaard 34790e1fab fix(dashboard): minor fix to schema upgrade when schemaVersion is not correct, fixes #6650 2016-11-22 14:20:24 +01:00
bergquist 6882dcfb99 feat(alerting): add backend support for median reducer 2016-11-22 14:09:35 +01:00
Mitsuhiro Tanda 51f80affe3 (cloudwatch) update aws-sdk-go to v1.5.8 (#6658)
* (cloudwatch) upgrade aws-sdk-go v1.5.8

* (cloudwatch) remove non-required aws-sdk-go part

* add go-ini
2016-11-22 13:38:11 +01:00
bergquist 50811c80ea fix(alerting): fixes bug that prevents noData from triggering
closes #6631
2016-11-22 11:47:52 +01:00
bergquist d73620f304 docs(issue_template): add note about alerting 2016-11-22 08:31:45 +01:00
bergquist 41a1ec29e7 docs(readme): add link to whats new in grafana 4 2016-11-21 14:01:41 +01:00
Torkel Ödegaard a3d5b4bf25 Update CHANGELOG.md 2016-11-21 11:51:20 +01:00
Torkel Ödegaard 092f0c4b62 docs(): fixed windows link 2016-11-21 10:58:45 +01:00
Torkel Ödegaard a5c0295a0e docs(): updated doc download links 2016-11-21 10:18:43 +01:00
Torkel Ödegaard c643466d57 bumped version to v4-beta2 2016-11-21 09:51:59 +01:00
bergquist 2b6013ce81 fix(notifications): failed image upload should not stop notification
closes #6638
2016-11-21 09:47:59 +01:00
Torkel Ödegaard 6fa4b8c0b6 Merge branch 'master' of github.com:grafana/grafana 2016-11-21 09:42:46 +01:00
Torkel Ödegaard 8d80812601 Merge branch 'issue-6566' of https://github.com/benrubson/grafana into benrubson-issue-6566 2016-11-21 09:39:35 +01:00
Torkel Ödegaard c1a15648c7 Merge branch 'master' of github.com:grafana/grafana into getting-started-panel 2016-11-21 09:00:40 +01:00
benrubson e71114f4fb Come back to #6287 for graph_tooltip.js
as it is an only one loop solution
2016-11-19 09:12:10 +01:00
benrubson 9797845460 Typo 2016-11-18 19:14:12 +01:00
benrubson 0034b6ede7 Highlight correct point when series has null values 2016-11-18 18:49:20 +01:00
benrubson 1eb0ea3450 Correctly stack series with null and missing values 2016-11-18 18:14:40 +01:00
benrubson becb6303e5 Revert #6287 for graph_tooltip.js 2016-11-18 17:50:54 +01:00
Torkel Ödegaard 1dc581bdfa ux(gettingstarted): progress on getting started panel, #6466 2016-11-18 17:42:14 +01:00
bergquist 5dea0fda51 fix(settings): remove nil pointer exception 2016-11-18 16:43:14 +01:00
benrubson 850d39fc50 Revert #6287 for jquery.flot.stack.js 2016-11-18 16:32:00 +01:00
Torkel Ödegaard fd512457d8 Merge remote-tracking branch 'origin/master' into getting-started-panel-css2 2016-11-18 16:31:54 +01:00
Torkel Ödegaard 0c9001c7ae ux(gettingstarted): progress on getting started panel, #6466 2016-11-18 16:31:19 +01:00
bergquist 1b0005a9e5 feat(mqe): add support for app and host alias 2016-11-18 11:40:38 +01:00
bergquist 61bb9cbc13 test(alerting): fixes broken unit test 2016-11-18 10:53:27 +01:00
Ryan McKinley 7958615097 Use ms rather than second precision 2016-11-17 09:21:25 -08:00
bergquist a3b0fbcaba fix(influxdb): fixes broken tag rendering for influxdb alerting
closes #6626
ref #6523
2016-11-17 15:50:49 +01:00
Torkel Ödegaard 7ce33c31ec Merge branch 'master' of github.com:grafana/grafana 2016-11-17 15:50:08 +01:00
Torkel Ödegaard b9cfb19ab8 changelog(): added entry for PR #6579 2016-11-17 15:50:00 +01:00
Torkel Ödegaard e34bf9a1fa Merge branch 'utkarshcmu-or_alerting' 2016-11-17 15:49:52 +01:00
Torkel Ödegaard 62e8a039a1 refactor(alerting): refactoring PR for OR conditions, #6579 2016-11-17 15:48:15 +01:00
bergquist 3ea66ebe3f fix(alerting): remove possible divide by zero panic
ref #6599
2016-11-17 15:20:14 +01:00
Torkel Ödegaard 457ae74343 Merge branch 'or_alerting' of https://github.com/utkarshcmu/grafana into utkarshcmu-or_alerting 2016-11-17 14:43:24 +01:00
Torkel Ödegaard 98d1748e43 fix(templating): work on fixing exporting issues when using templating variables, like data source variables, and panel repeats, requires more work #6189 2016-11-17 12:32:11 +01:00
Torkel Ödegaard 9d5928ddd6 feat(templating): don't persist template variable options when variable has refresh enabled, closes #6586 2016-11-17 11:38:06 +01:00
Torkel Ödegaard eafe0d6bfa fix(templating): fixed issue when adding template variable, fixes #6622 2016-11-17 11:28:33 +01:00
utkarshcmu aae33b36dd Added tests for firingEvaluation string 2016-11-17 01:41:23 -08:00
Torkel Ödegaard 196fdbfd31 fix(dashboard): fixed issue when dragging new panel to drop zone 2016-11-17 10:31:37 +01:00
utkarshcmu fc82dac868 Added braces to single condition firingEvaluation string 2016-11-17 01:30:50 -08:00
utkarshcmu 690868c837 Added firingEvalution to Rule test 2016-11-17 01:28:17 -08:00
Torkel Ödegaard a45fdfdd3f fix(dashboard): minor fixes, and restored in-activity timer to 1min 2016-11-17 10:11:59 +01:00
bergquist 5c153f0383 Merge branch 'master' into alerting_mqe 2016-11-17 09:57:56 +01:00
bergquist 0a0f558c48 style(mqe): improve code 2016-11-17 08:52:27 +01:00
bergquist 23387bd39b feat(mqe): simplify timestamp parsing 2016-11-17 08:42:09 +01:00
ichekrygin f6b70c7d82 Fix formatting 2016-11-16 17:30:42 -08:00
ichekrygin acc729131a Add VictorOps Test. 2016-11-16 16:14:02 -08:00
ichekrygin 8f0d51171d Resolve rebase w/ upstream conflicts.
Remove: `Alert on Exec Error` (no longer needed)
Add: `ruleUrl` to VictorOps message body.
2016-11-16 16:13:33 -08:00
ichekrygin bbca9861fb Fix return on nil and cleanup debug messages 2016-11-16 14:02:34 -08:00
ichekrygin b46cbc5fbe Add option to alert on ExecutionError 2016-11-16 14:02:34 -08:00
ichekrygin 4ca304b756 Change VictorOps fa from fa-exclamation-triangle -> fa-pagelines 2016-11-16 14:02:34 -08:00
ichekrygin 1e558e3936 Fix user-facing text 2016-11-16 14:02:34 -08:00
ichekrygin b0620a9d4b Add VictorOps alert notification capability 2016-11-16 14:02:34 -08:00
Torkel Ödegaard 42167a65c6 testdata(): added test graph for null stacking scenario, #6566 2016-11-16 19:00:23 +01:00
Torkel Ödegaard f52c6aafe7 docs(): minor update to centos docs about font packages needed for phantomjs 2016-11-16 18:49:14 +01:00
Torkel Ödegaard 4581bb4a7a fix(singletat): Support repeated template variables in prefix/postfix, fixes #6595 2016-11-16 18:44:39 +01:00
Torkel Ödegaard e6776f71d9 cleanup(sass): removed tight-form styles 2016-11-16 18:26:39 +01:00
Torkel Ödegaard d7e8753c59 cleanup(): removed unused gfbox style 2016-11-16 18:08:45 +01:00
Torkel Ödegaard 079b0ef44a change(alerting): delete alert rule from panel model when duplicating panel 2016-11-16 18:03:00 +01:00
Torkel Ödegaard a50178eab1 ux(tweak): minor polish to date picker styling 2016-11-16 17:56:42 +01:00
Torkel Ödegaard f64385cfc9 ux(tweak): minor polish to date picker styling 2016-11-16 17:53:56 +01:00
Torkel Ödegaard 465451c289 cleanup(): removed unused uio-angular tab component 2016-11-16 17:47:37 +01:00
Torkel Ödegaard 18e965c775 fix(error handling): fixed server side error handling page 2016-11-16 17:41:44 +01:00
bergquist 9572f086ae feat(mqe): add timerange to query 2016-11-16 17:09:34 +01:00
Torkel Ödegaard e3564d12a1 fix(404): fixed 404 page 2016-11-16 17:09:00 +01:00
Dan Cech c980efd470 fix up sass lint warnings (#6603) 2016-11-16 17:08:38 +01:00
Dan Cech eacb7c8aba Merge pull request #6584 from tomkozlowski/bugfix/oauth-login-bearer-token
explicitly set oauth2 token to Bearer Type
2016-11-16 10:35:32 -05:00
Torkel Ödegaard e7a30ac464 fix(units): fixed issue with data rate bit units, fixes #6602 2016-11-16 16:29:10 +01:00
Tom Kozlowski a353c8d1bb added explicitly setting token as Bearer Type 2016-11-16 09:55:14 -05:00
bergquist fa8213d8d5 feat(mqe): send http requests 2016-11-16 15:28:31 +01:00
Torkel Ödegaard 4fa995eafa ux(view/tv mode): treat tab change as user activity, resets in activity timer 2016-11-16 14:44:55 +01:00
bergquist f1897b7e96 feat(mqe): add response parser 2016-11-16 14:42:43 +01:00
Torkel Ödegaard 9c7f8268dc fix(build): fixed failing unit test 2016-11-16 14:39:17 +01:00
Torkel Ödegaard 171335bfef fix(ux): fixed dropzone display issues, fixes #6598 2016-11-16 14:28:52 +01:00
bergquist c6ad0cc5ec test(mqe): basic test for response parser 2016-11-16 13:00:25 +01:00
bergquist 113020aabe feat(mqe): support basic aliases 2016-11-16 11:04:15 +01:00
bergquist e12a4f6b46 docs(notifications): fixes typo 2016-11-16 10:55:47 +01:00
Mitsuhiro Tanda 9740752c1e (cloudwatch) long retention support (#6547) 2016-11-16 10:50:33 +01:00
Matt Toback 10cf32f835 Removed green border from OK alerts. Makes dashboards too busy, competes for attention where action is unnceessary (#6555) 2016-11-16 10:50:01 +01:00
bergquist 430104aaac feat(mqe): add support for wildcard series 2016-11-16 10:03:22 +01:00
bergquist fa92dfb7b2 feat(mqe): add support for apps in where clause 2016-11-16 09:54:45 +01:00
Torkel Ödegaard f91a833e6a fix(panel): set initial transparency state at first link 2016-11-16 09:44:16 +01:00
bergquist ab7263579f Merge branch 'master' into alerting_mqe 2016-11-16 09:28:26 +01:00
bergquist cbe8af967d docs(api): add docs about creating new org
close #6588
2016-11-16 09:06:32 +01:00
utkarshcmu f46c4c88ca Added OR condition in docs 2016-11-15 22:43:09 -08:00
Ben RUBSON a4de6da9a0 Correct series highlight (#6578)
solves issue #6573
2016-11-15 18:59:17 +01:00
bergquist 4739608ffb tests(mqe): add query builder 2016-11-15 18:37:34 +01:00
utkarshcmu 8d0bcd23f8 Added tests for checking nested operators 2016-11-15 08:07:05 -08:00
utkarshcmu dfb1b1918c Implemented operator based firiing in backend 2016-11-15 06:35:25 -08:00
bergquist b9d709ab27 feat(alerting): improve error logging for extracting alerts
ref #6576
2016-11-15 11:47:46 +01:00
Torkel Ödegaard 05c5a09f63 docs(): updated changelog 2016-11-15 08:46:30 +01:00
utkarshcmu b2db2b26dd Added OR to alert_tab 2016-11-14 18:36:22 -08:00
Ryan McKinley 04356f31d2 missing space 2016-11-14 14:56:11 -08:00
Ryan McKinley 3588b9732f round the seconds 2016-11-14 13:40:33 -08:00
Carl Bergquist 6e94ccea07 Merge pull request #6569 from nicr9/patch-1
docs(datasources/influxdb): Fix broken image link
2016-11-14 17:25:52 +01:00
Nic Roland 0cdf05ae5d docs(datasources/influxdb): Fix broken image link
Twas missing a leading `/`.
2016-11-14 16:04:33 +00:00
bergquist 1bdda76ba9 tests(mqe): parse mqe query model 2016-11-14 15:03:49 +01:00
bergquist c973241435 feat(mqe): add token request 2016-11-14 14:00:35 +01:00
Torkel Ödegaard 62ff85e774 docs(): fixed ldap link 2016-11-14 11:34:58 +01:00
bergquist 4fdfee739a fix(influxdb): add support for regex measurments
closes #6560
2016-11-14 08:48:19 +01:00
bergquist 118e2a6364 WIP: more boilerplate 2016-11-13 13:51:54 +01:00
bergquist a87fd11f26 feat(stats): add alerts to global admin stats 2016-11-11 14:04:38 +01:00
bergquist ad97db937c feat(stats_usage): add stats about alerts 2016-11-11 13:57:11 +01:00
Carl Bergquist 08429d9a08 Merge pull request #6546 from huydx/master
Fix typo (password strenght -> password strength)
2016-11-11 10:31:04 +01:00
huydx f5a804a558 Fix typo (password strenght -> password strength) 2016-11-11 18:02:58 +09:00
Andrew McDonald b98f817d68 Fix for cloudwatch datasource requesting too many datapoints (#6544)
The range checking in _getPeriod appeared to be using a different variable than the period that had just been calculated for its bounds checks.
2016-11-11 08:54:44 +01:00
bergquist e04d27c0b0 fix(influxdb): return internal influxdb errors
ref #6523
2016-11-11 08:47:53 +01:00
Carl Bergquist b824fa1916 Merge pull request #6538 from grafana/alertlist_only_from_dashboard
feat(alertlist): make it possible to filter on alerts from current da…
2016-11-10 16:19:12 +01:00
bergquist a51de8e987 tech(conf): remove dragoo :( 2016-11-10 16:15:55 +01:00
bergquist abb8f33d77 feat(alertlist): make it possible to filter on alerts from current dashboard 2016-11-10 16:07:13 +01:00
bergquist f924b241ae tech(influxdb): refactor query builder
trying to reduce the amounts of moving parts for influxdb
2016-11-10 14:38:07 +01:00
Torkel Ödegaard 18a37a9eef ux(getting started): struggleing witch cleaning up the css, #6466 2016-11-10 14:21:37 +01:00
bergquist a948dfe514 fix(influxdb): fixes broken raw query usage 2016-11-10 14:18:10 +01:00
Torkel Ödegaard 575828f1e9 Merge branch 'getting-started-panel' of github.com:grafana/grafana into getting-started-panel 2016-11-10 13:25:18 +01:00
Torkel Ödegaard de74bf0c33 Merge branch 'master' into getting-started-panel 2016-11-10 13:24:10 +01:00
Torkel Ödegaard 9f7d0862e8 docs(): minor docs fix 2016-11-10 13:08:32 +01:00
Carl Bergquist a825e63a19 Merge pull request #6515 from grafana/influxdb_alias_seriename
[Influxdb] Backend support for seriename alias
2016-11-10 12:56:53 +01:00
bergquist ecba23e883 Merge branch 'master' into influxdb_alias_seriename 2016-11-10 12:22:17 +01:00
Torkel Ödegaard 6767bdd76d fix(graph): fixed issue log base scale on right y axis, option was not applied at all, also issue with log scale and max value calculation fixed, fixes #6534 2016-11-10 12:04:55 +01:00
Torkel Ödegaard 316d754a21 fix(ui/browser): fixed border not showing in safari, fixes #6530 2016-11-10 11:31:27 +01:00
bergquist 70b9ba2573 tech(build): switch to golang 1.7.3
tls/cipher fixes
https://github.com/golang/go/issues?q=milestone%3AGo1.7.3
2016-11-10 11:30:18 +01:00
bergquist 4f3c8c6663 fix(influxdb): add default operator
ref #6523
2016-11-10 11:21:38 +01:00
Torkel Ödegaard 71eb0f3278 fix(graph): fixed issue with bar width when used in series override, fixes #6528 2016-11-10 10:50:48 +01:00
Ben RUBSON 6495ba155a Correct timeStep in case of missing values (#6526)
* Correct timeStep in case of missing values

* Comment
2016-11-10 10:20:27 +01:00
Ben RUBSON 2443326386 Add some comments about some previous modifications (#6533) 2016-11-10 10:19:42 +01:00
bergquist ef08a243c5 fix(influxdb): fixes possible nil pointer
closes #6531
2016-11-10 08:23:58 +01:00
bergquist bd3259d07a feat(mqe): init commit 2016-11-09 15:55:47 +01:00
bergquist 6a8138904e fix(shortcuts): CTRL on windows or linux 2016-11-09 14:48:51 +01:00
bergquist 82e1d3f6aa feat(influxdb): disable debug logging in appmode 2016-11-09 14:48:05 +01:00
Torkel Ödegaard fff26086d5 docs(): updated install links with beta links as well 2016-11-09 13:53:20 +01:00
Torkel Ödegaard 1d4cace849 fix(testdata): fixed query in default grafana data source 2016-11-09 12:52:56 +01:00
bergquist f0a0e647a0 feat(influxdb): backend support for alias by segment
ref #6510
2016-11-09 12:45:59 +01:00
Torkel Ödegaard d1bedfc1d1 updated version to beta1 2016-11-09 12:10:03 +01:00
Torkel Ödegaard bfed566ea8 changelog(): updated with entry for #2912 and #6287, closes #2912 2016-11-09 11:37:36 +01:00
Torkel Ödegaard a9c6bdc197 panel(graph): stacking can now handle null values, #6287 2016-11-09 11:34:34 +01:00
Torkel Ödegaard 485980eebf Merge branch 'issue-2912' of https://github.com/benrubson/grafana into benrubson-issue-2912 2016-11-09 11:17:04 +01:00
Torkel Ödegaard 33664b0a7e docs(): minor docs change 2016-11-09 11:14:04 +01:00
Torkel Ödegaard 2164bbd447 ux(tv mode): added 1 second delay animation 2016-11-09 10:59:06 +01:00
Torkel Ödegaard fb57bf77da ux(getting started): progress on getting started panel and persited help flag states, #6466 2016-11-09 10:41:39 +01:00
bergquist 97271514fb feat(influxdb): cleanup influxdb query editor options 2016-11-09 10:30:03 +01:00
bergquist c897d39d5e feat(influxdb): add support for serie alias replacement
ref #6510
2016-11-09 10:22:11 +01:00
bergquist 24a3a100ed feat(influxdb): add alias to query 2016-11-09 10:05:12 +01:00
Leandro Piccilli 717a96ab8d Fix raw document query on ES 5.x 2016-11-08 22:18:59 +01:00
Leandro Piccilli a5ee705b89 Merge branch 'master' of https://github.com/grafana/grafana 2016-11-08 22:18:30 +01:00
Torkel Ödegaard 652eb057cf change(graph): change default line width from 2 to 1 2016-11-08 20:57:17 +01:00
Torkel Ödegaard 20d789cb94 docs(): fix title 2016-11-08 20:57:16 +01:00
Torkel Ödegaard d717e0cf13 docs(): minor spelling fix 2016-11-08 20:57:16 +01:00
bergquist 029e52f5a1 docs(pagerduty): update docs regarding pagerduty 2016-11-08 20:41:02 +01:00
bergquist eb34855adb feat(pagerduty): add support for auto resolve
closes #6513
2016-11-08 20:38:38 +01:00
Carl Bergquist 0d729ae392 Merge pull request #6512 from utkarshcmu/pagerduty_bug
Send test notification fixed
2016-11-08 20:30:41 +01:00
utkarshcmu 610ea090dc Send test notification fixed 2016-11-08 11:22:03 -08:00
bergquist 5542b0ab9e tech(pagerduty): sync calls should be using context 2016-11-08 20:05:43 +01:00
bergquist b5c96d2685 style(influxdb): fixes broken layout 2016-11-08 20:02:55 +01:00
bergquist 98a7bf181a tech(influxdb): close body reader 2016-11-08 19:19:49 +01:00
Torkel Ödegaard 5f2cb8e193 Merge branch 'master' into getting-started-panel 2016-11-08 16:23:01 +01:00
Torkel Ödegaard d92bb677df docs(): fix title 2016-11-08 16:15:34 +01:00
Torkel Ödegaard 4c891e3758 docs(): minor spelling fix 2016-11-08 15:06:07 +01:00
Torkel Ödegaard fd09f17cd3 docs(): alerting docs, #6490 2016-11-08 14:53:28 +01:00
bergquist 8713dd8221 tech(docker): pin elastic to 2.4.1 for dev 2016-11-08 14:31:59 +01:00
Utkarsh Bhatnagar e642dce027 Fixed import dashboard bug (#6480) 2016-11-08 14:03:04 +01:00
Matt Toback b8ad86fabd Alert pulse tweak (#6508)
* Added faint tint of red to alerting panels, started working on animation. more to come

* Finally happy with pulse animation. Ready to merge
2016-11-08 14:02:45 +01:00
bergquist 309391cb79 docs(alerting): not only graphite 2016-11-08 11:24:39 +01:00
bergquist 5445e47fd5 docs(alerting): typo 2016-11-08 11:24:19 +01:00
bergquist 1f2b8044b2 docs(notifications): format as table 2016-11-08 11:14:35 +01:00
Torkel Ödegaard b658f38036 docs(): added what new in v4 article and initial draf of alerting docs, #6490 2016-11-08 11:09:10 +01:00
bergquist 8ca18b511f docs(alerting): add docs for alert notifications 2016-11-08 10:58:59 +01:00
Torkel Ödegaard dea5fd385f ux(alerting): minor wording change on alert tab 2016-11-08 09:34:52 +01:00
Torkel Ödegaard 49af12f69f Merge branch 'master' of github.com:grafana/grafana 2016-11-08 09:31:19 +01:00
Carl Bergquist a7be3b91fd Merge pull request #6499 from utkarshcmu/last
Added last function for alerting conditions
2016-11-08 09:10:35 +01:00
utkarshcmu 841fb74b39 Reversed loop for last function 2016-11-07 23:16:57 -08:00
utkarshcmu 74632b5e98 Added last function for alerting conditions 2016-11-07 23:16:57 -08:00
bergquist 5bbdd99d35 tech(notifications): remove async webhook 2016-11-08 08:06:42 +01:00
bergquist 66f257e382 tech(pagerduty): make api call sync 2016-11-08 07:51:19 +01:00
bergquist 7bc80d0374 tech(pagerduty): declare url as constant 2016-11-08 07:50:58 +01:00
bergquist 6dd076efc1 Merge branch 'alerting_pagerduty' of https://github.com/utkarshcmu/grafana into utkarshcmu-alerting_pagerduty 2016-11-08 07:48:20 +01:00
Carl Bergquist bdcff9d15c Merge pull request #6501 from utkarshcmu/invalid_state
Removed invalid alerting state from the UI
2016-11-08 07:00:55 +01:00
utkarshcmu a7e67f3bdd Removed invalid alerting state 2016-11-07 17:43:13 -08:00
Carl Bergquist 9479364600 Merge pull request #6481 from msound/update-github-auth-documentation
Update github auth docs
2016-11-07 20:42:05 +01:00
Carl Bergquist f7f64fbe95 Merge pull request #6495 from rogerswingle/add-govcloud
Add AWS Govcloud Region
2016-11-07 20:36:38 +01:00
Torkel Ödegaard 901e670db4 docs(): minor tweak 2016-11-07 19:58:30 +01:00
Roger Swingle 69ff13adce add govcloud 2016-11-07 13:56:29 -05:00
utkarshcmu 5549d8658a Fixed description message 2016-11-07 07:27:31 -08:00
utkarshcmu f8d1eb11a9 Removed ExecError state 2016-11-07 07:12:43 -08:00
utkarshcmu 4b53ea0a56 Fixed pagerduty tests 2016-11-07 07:08:52 -08:00
utkarshcmu 638d3bcb42 Removed NoData option 2016-11-07 07:08:51 -08:00
utkarshcmu de0fa3d479 Added pagerduty tests 2016-11-07 07:08:51 -08:00
utkarshcmu df8cd764b2 Added trigger options with Pagerduty 2016-11-07 07:08:51 -08:00
utkarshcmu 139bbecc10 Added Pagerduty basic alerting 2016-11-07 07:08:51 -08:00
Torkel Ödegaard a100836bb4 docs(): Added pages for alerting docs, added keyboard shortcuts doc article, #6490 2016-11-07 15:18:27 +01:00
Carl Bergquist 3607316920 Merge pull request #6489 from bergquist/reduce_notification_states
Reduce alerting states
2016-11-07 15:18:07 +01:00
bergquist b2d8e83c7d fix(alert_tab): better execution state description 2016-11-07 14:54:42 +01:00
bergquist 56340bfdfb fix(influxdb): fixes bug when using regexps/numbers in tags
closes #6488
2016-11-07 14:26:20 +01:00
bergquist d7f11c304c tech(alerting): set prev state when creating eval context 2016-11-07 13:01:54 +01:00
bergquist 489f087fbd feat(alerting): reduce states. Make exeuction result configurable.
ref #6444
2016-11-07 12:42:39 +01:00
bergquist 16e7bfc622 docs(changelog): add note about closing #6292 2016-11-07 08:10:36 +01:00
Carl Bergquist d670f1b959 Merge pull request #6479 from utkarshcmu/playlist_bug
Removed playlist item when dashboard is deleted
2016-11-07 08:00:57 +01:00
bergquist f0b591b89b feat(alerting): extract logic state updates and notifications
ref #6444
2016-11-07 07:57:34 +01:00
Torkel Ödegaard b88791135f sasslint fix 2016-11-06 18:05:01 +01:00
Torkel Ödegaard 907fb9c1be ux(dashboard): fix for dropzone width when resizing another panel 2016-11-06 17:41:17 +01:00
Mani Soundararajan db77dfea7a Update github auth docs
In Github's "allowed organizations" scenario, it makes sense to have
`allow_sign_up` to be `true` as most administrators will expect their
org's github users to be able to sign in without further steps like
creating a local user first.
2016-11-06 20:48:14 +05:30
Torkel Ödegaard 2d19af601a fix(alerting): various alerting fixes 2016-11-06 15:40:02 +01:00
Torkel Ödegaard 05c124bb1e docs(changelog): correct changelog 2016-11-06 11:07:52 +01:00
utkarshcmu c737704eeb Removed playlist item when dashboard is deleted 2016-11-06 01:49:43 -08:00
Torkel Ödegaard 8db40b25db ux(dashboard): final tweaks to view mode and kiosk mode, better animation for view mode, and kiosk mode can be entered via kiosk url parameter, #6476 2016-11-06 10:15:36 +01:00
Torkel Ödegaard bd996a4810 ux(viewmode): refining view mode #6476 2016-11-05 21:05:12 +01:00
Torkel Ödegaard 3df4375e39 docs(changelog): updated changelog with new ux improvements 2016-11-05 14:28:40 +01:00
Torkel Ödegaard d38de2cc8b ux(view/kiosk mode): added view mode and kiosk mode, #6476 2016-11-05 14:23:37 +01:00
Torkel Ödegaard 0d82fb71ad ux(keybindings): updated look of dashboard keybindings help modal, #6465 2016-11-05 12:19:52 +01:00
Torkel Ödegaard aaa174a091 ux(dashboard): minor fix so hide controls hide panel resize handles 2016-11-05 08:32:16 +01:00
Torkel Ödegaard 2b81b204aa docs(): fixing image urls in docs 2016-11-04 20:29:17 +01:00
Torkel Ödegaard 3cc4a194a9 ux(keybindings): polish help modal with keybindings, #6465 2016-11-04 17:19:03 +01:00
Torkel Ödegaard 4ab095b051 fix(ux): fixed issue with row menu gliding over header, or in realting extending outside it's bound and not getttin the menu background 2016-11-04 15:35:32 +01:00
Carl Bergquist 741faa2299 Merge pull request #6468 from utkarshcmu/changelog_entry
Added OpenTSDB nested templating fix entry to CHANGELOG
2016-11-04 15:01:46 +01:00
utkarshcmu a78db041ea Added OpenTSDB nested templating fix to CHANGELOG 2016-11-04 06:57:26 -07:00
Carl Bergquist 8bc0462877 Merge pull request #6467 from utkarshcmu/slack_mention
Added Slack mention feature
2016-11-04 14:14:32 +01:00
utkarshcmu dc3a62da83 Added slack tests , fixed webhook tests 2016-11-04 06:05:44 -07:00
utkarshcmu 2f60929d1e Added slack mention functionality 2016-11-04 06:05:44 -07:00
Torkel Ödegaard 6fa89456d6 build(): updated glob node package 2016-11-04 13:58:06 +01:00
Torkel Ödegaard 2da2d5df56 Merge branch 'master' of github.com:grafana/grafana 2016-11-04 12:15:08 +01:00
Torkel Ödegaard c99f4cb9c5 ux(dashboard): minor cleanup 2016-11-04 12:14:43 +01:00
Torkel Ödegaard 2fa7100c3b ux(dashboard): lots of tweaks and polish to row menu, added remove X to add panel and row option views, #6442 2016-11-04 11:43:49 +01:00
Ryan Bak 7165c866c2 Add blank default options for constant templates (#6460)
Restores ability to change constant templates without going into
templating menu
2016-11-04 11:41:39 +01:00
TerraTech 05d24020b1 settings.html: Fixup filename for custom.ini (#6463) 2016-11-04 11:41:12 +01:00
Carl Bergquist 691956bd33 Merge pull request #6363 from Noah-Heil/patch-1
Added two hints to help newer users
2016-11-04 11:12:20 +01:00
bergquist f0d9d133c6 tech(slack): format code using gofmt 2016-11-04 07:55:15 +01:00
Matt 616e9ce5f6 Changed panel-handle cursor to proper 2 directional 2016-11-03 22:56:39 -04:00
Matt cf248a503b Added panel name to individual add panel item to show full name when long 2016-11-03 17:49:54 -04:00
Matt 80f8c0712c Merge branch 'v4ux' of https://github.com/grafana/grafana into v4ux 2016-11-03 17:41:54 -04:00
Matt 308cc9d9f6 Thinned out fonts for row headers, sits much nicer in the dashboard 2016-11-03 17:41:35 -04:00
Torkel Ödegaard abf1f6a163 ux(dashboard): added back hide controls toggle and shortcut, #6442 2016-11-03 22:39:59 +01:00
Torkel Ödegaard d0513d3a54 ux(dashboard): changed name of delete row to remove row, #6442 2016-11-03 22:32:04 +01:00
Torkel Ödegaard 0da60a8bb2 ux(dashboard): minor tweak to row menu animation, it hides in a better way now after click #6442 2016-11-03 22:29:53 +01:00
Torkel Ödegaard 98be1734fa ux(dashboard): refining new row slide out menu, #6442 2016-11-03 22:14:29 +01:00
Torkel Ödegaard d917f69255 Merge branch 'v4ux' of github.com:grafana/grafana into v4ux 2016-11-03 20:32:45 +01:00
Torkel Ödegaard 82592f0c13 ux(help): began work on new help modal 2016-11-03 20:32:36 +01:00
Matt 4e15e61b39 Added vertical ellipses, played with box shadows and borders and such. Ellipses need to fade to Opacity 0 when menu is open. 2016-11-03 15:12:39 -04:00
bergquist 2d7bb4a9f3 fix(tsdb): broken build :( 2016-11-03 19:20:53 +01:00
bergquist b578d06e4a chore(notification): improve log message 2016-11-03 18:04:50 +01:00
bergquist 1afe0e90f9 fix(tsdb): fixes broken legend buidler for prometheus
closes #6456
2016-11-03 18:04:09 +01:00
bergquist 0059beb85d chore(tsdb): remove commented code 2016-11-03 17:34:57 +01:00
bergquist 4af420f759 tech(alerting): refactor how evalhandler uses conditions 2016-11-03 17:31:36 +01:00
Carl Bergquist 262b806193 Merge pull request #6455 from utkarshcmu/opentsdb_template_fix
Fixed multi-value nested templating for opentsdb
2016-11-03 17:11:52 +01:00
Torkel Ödegaard 3e712178cc ux(dashboard): began removing build mode and adding new slide out row menu 2016-11-03 15:50:11 +01:00
Torkel Ödegaard f91e067235 ux(dashboard): keybinding changes / new, #6442 2016-11-03 15:14:44 +01:00
Torkel Ödegaard 8ea2d3f19c ux(dashboard): removed getting started stuff from dashlist panel, #6442 2016-11-03 13:24:01 +01:00
Torkel Ödegaard e80241b5f4 ux(dashboard): minor tweaks 2016-11-03 13:19:40 +01:00
Torkel Ödegaard f1137e4d20 ux(dashboard): removed green row icon gain, replaced with collapse icon, #6442 2016-11-03 11:30:25 +01:00
Carl Bergquist 61c48aecc2 [Alertlist] Set max-height to respect row height (#6454)
* feat(alertlist): max-height to respect row height

closes #6417

* feat(alertlist): use pre calculated panel.height instead

* style(alertlist): rearrange variable order
2016-11-03 11:01:21 +01:00
utkarshcmu 89cf32b160 Made quotes consistent 2016-11-03 01:22:24 -07:00
utkarshcmu 849ac9441a Fixed multi-value nested templating for opentsdb 2016-11-03 01:18:54 -07:00
bergquist c138b04c5e feat(alerting): avoid double logging 2016-11-03 07:25:00 +01:00
bergquist ff5d4e8e0c fix(alerting): temp fix for broken AND condition
This should be refactored. lets return condition results instead
of setting new value on the evalContext. The condition execution
should only be able to update its own state.

closes #6449
2016-11-03 07:18:39 +01:00
Carl Bergquist 89a3d023ce Merge pull request #6453 from utkarshcmu/alert_message_typo
Log bad alert config and fixed alert message typo
2016-11-03 07:12:36 +01:00
Carl Bergquist bb7f03c91e Merge pull request #6446 from utkarshcmu/graphite_alerting_fix
Fixed intervalFormat for Graphite Alerting
2016-11-03 06:58:51 +01:00
utkarshcmu fc91231104 Fixed failing tests 2016-11-02 22:31:59 -07:00
utkarshcmu d009c6b953 Log bad alert config 2016-11-02 18:22:24 -07:00
utkarshcmu 942de5497e Fixed alert message typo 2016-11-02 18:13:11 -07:00
Torkel Ödegaard 075c722527 ux(dashboard): worked on single row edit mode, #6442 2016-11-02 22:24:08 +01:00
Matt Toback 15e369ec02 First pass of getting started panel for home dashboard 2016-11-02 17:21:11 -04:00
bergquist d1d7c240f9 tech(mailer): dont use deprecated method 2016-11-02 22:11:59 +01:00
Torkel Ödegaard e23f898418 ux(dashboard): minor tweaks and polish, added g a shortcut for go to alerting list 2016-11-02 22:08:17 +01:00
Torkel Ödegaard cdea420285 ux(dashboard): fixes for changing panel tabs, #6442 2016-11-02 21:45:46 +01:00
Carl Bergquist 377d9f4a78 Merge pull request #6452 from utkarshcmu/tooltip_bug
Fixed the tooltip message for slack notifier
2016-11-02 20:46:05 +01:00
utkarshcmu 2b28cf1ff1 Fixed the tooltip message for slack notifier 2016-11-02 12:42:33 -07:00
utkarshcmu 33ee85ede9 Commented strange behavior of tests 2016-11-02 11:11:06 -07:00
Torkel Ödegaard 47aae7f1f2 ux(dashboard): added more shortcusts to v/edit panel, #6442 2016-11-02 17:03:14 +01:00
Torkel Ödegaard 95e7ead89b ux(dashboard): varius dashboard ux fixes and keybinding improvements, press 'e' while hovering over panel will open dashboard in edit mode, pressing 'd' will remove panel, #6442 2016-11-02 15:16:48 +01:00
Torkel Ödegaard 19509d1e7a ux(dashboard): minor fix, #6442 2016-11-02 13:49:12 +01:00
Torkel Ödegaard 40ea014fa8 ux(dashboar): added shortcut for build mode, switched keybinding lib to mousetrap, supports sequences so also added for Go to home dashboard, open search with starred dashbords prefiltered, go to profile, #6442 2016-11-02 12:55:58 +01:00
Torkel Ödegaard 3c1435253d feat(ux dashboard editmode): added shortcut to setting menu, #6442 2016-11-02 11:05:28 +01:00
utkarshcmu a4a2e35bb2 Verified interval format function and gofmt check 2016-11-02 02:07:08 -07:00
bergquist d4bc92b267 feat(tsdb): default tsdb httpclient 2016-11-02 08:51:34 +01:00
utkarshcmu 2088363bf9 Added tests for graphite alerting 2016-11-02 00:00:18 -07:00
utkarshcmu 1e8beb8983 Fixed intervalFormat for Graphite Alerting 2016-11-01 17:55:45 -07:00
bergquist 9b28bf25a4 docs(cli): add info about how to install specific plugin version
closes #6434
2016-11-01 18:35:15 +01:00
Carl Bergquist e659eb745d Merge pull request #6420 from utkarshcmu/alerting_initial_state
Alerts not sent when state is changed from "initialized" to "ok"
2016-11-01 18:30:14 +01:00
Torkel Ödegaard 8980f481f7 fix(ux dashboard): panel height fix to reduce jumpiness when loading dashboard 2016-11-01 16:11:26 +01:00
Torkel Ödegaard 8eee4d8e6b fix(dashboard): fixed white theme for new dashboard row look / dash edit mode, #6442 2016-11-01 16:06:49 +01:00
utkarshcmu 7490c49f60 Alert un paused to pending state 2016-11-01 07:58:38 -07:00
Torkel Ödegaard f3090d8cd4 fix(dashboard): fixed issue with resizing panel, #6442 2016-11-01 15:33:20 +01:00
utkarshcmu d9f2519916 Renamed Initialized to Pending 2016-11-01 07:30:55 -07:00
Torkel Ödegaard 18056e53cc ux(dashboard): Fixing broken unit test made by changes for dash edit mode, #6442 2016-11-01 14:35:35 +01:00
Torkel Ödegaard 786afda4c3 ux(dashboard): edit mode fixes 2016-11-01 13:43:05 +01:00
bergquist 578507ae77 tech(cli): add default settings for transport 2016-11-01 08:58:44 +01:00
Carl Bergquist 4b8d9cac6f Merge pull request #6437 from dmvk/feature/grafana-cli-proxy
Take grafana-cli proxy settings from env
2016-11-01 08:53:23 +01:00
bergquist 39f9db8650 Merge branch 'utkarshcmu-slack_notifier' 2016-11-01 08:48:26 +01:00
bergquist 63e2337f6c feat(alerting): change placeholder to info-popover 2016-11-01 08:46:31 +01:00
David Moravek c6257b30c1 Take grafana-cli proxy settings from env 2016-10-31 23:14:48 +01:00
utkarshcmu 95117a0bc9 Added message parsing functionality 2016-10-31 14:55:21 -07:00
utkarshcmu 80fdd830de Added override default recipient functionality 2016-10-31 14:46:51 -07:00
Torkel Ödegaard 48a54edd85 ux(dashboard): improving drag and drop behavior! 2016-10-30 19:37:50 +01:00
Torkel Ödegaard 09a19d8ecb ux(dashboard): progress on ghost empty space panel 2016-10-30 18:02:46 +01:00
Torkel Ödegaard ca1f06f18f hunting memory leaks 2016-10-30 17:11:19 +01:00
Torkel Ödegaard 4d420a0c33 refactor(): dashboard row model and hunting down memory leak 2016-10-30 15:14:18 +01:00
Torkel Ödegaard 57cbefdf0a working on empty space / dropzone ghost panel 2016-10-30 12:05:11 +01:00
Torkel Ödegaard d98191ad65 Merge remote-tracking branch 'origin/row-tabs' into dash-edit-mode 2016-10-30 11:09:09 +01:00
Matt caaeb8e468 Added move row up and down arrows 2016-10-29 09:15:58 -04:00
Torkel Ödegaard 703eda489e ux(row): fixed panel footer hook border 2016-10-29 13:56:47 +02:00
Torkel Ödegaard c6757bed72 ux(dashboard): new row tabs look 2016-10-29 13:51:16 +02:00
Torkel Ödegaard bda5cdcb2f ux(dash edit mode): fix for row height when collapsed 2016-10-29 13:14:37 +02:00
Torkel Ödegaard 591f6536f8 feat(ux): trying to simplify display rules for edit mode / row actions 2016-10-29 13:10:20 +02:00
Torkel Ödegaard 3be9e8e022 Merge branch 'dash-edit-mode' of github.com:grafana/grafana into dash-edit-mode 2016-10-29 11:51:18 +02:00
Torkel Ödegaard 2fbe8cde8a Merge branch 'master' of github.com:grafana/grafana into dash-edit-mode 2016-10-29 11:50:57 +02:00
utkarshcmu dcaae47e96 Fixed tests 2016-10-28 14:54:55 -07:00
utkarshcmu 4c64e45a59 Added initalized state to alerts 2016-10-28 14:44:45 -07:00
Matt d9f99eb501 Added fadeIn animation to non-build mode 2016-10-28 17:09:33 -04:00
Matt 51f55cf6f1 Beginnings of changes to row edits 2016-10-28 16:12:20 -04:00
Torkel Ödegaard e170e47e7c ux(dashboard): minor updates 2016-10-28 16:41:48 +02:00
Torkel Ödegaard 3fc6f6d730 ux(dashboard): minor fixes 2016-10-28 16:37:13 +02:00
Torkel Ödegaard 366650e1ae ux(dashboard): fixed scss issue 2016-10-28 16:30:16 +02:00
Torkel Ödegaard be99c3e20a updates to dashboard edit mode 2016-10-28 16:26:53 +02:00
Torkel Ödegaard 30789308d7 minor change 2016-10-28 14:49:34 +02:00
Torkel Ödegaard 155cce959f more polish on edit mode 2016-10-28 14:38:48 +02:00
Torkel Ödegaard e215ba821c ux(): edit mode polish 2016-10-28 14:13:11 +02:00
Torkel Ödegaard f1a44ad090 ux(): progress on row ux 2016-10-28 13:36:27 +02:00
Eric Uldall 658fc1a67a added hosted domain suppport to google oauth login (#6372) 2016-10-28 12:00:47 +02:00
seanclerkin 7acdbde8f0 Cloudwatch: add support for Aurora specific RDS metrics (#6378) 2016-10-28 12:00:22 +02:00
Hans Kristian Flaatten b5eaa5ea59 Add missing closing " in Docker README (#6413) 2016-10-28 11:55:47 +02:00
Torkel Ödegaard 517ebfaf6d Merge branch 'dash-edit-mode' of github.com:grafana/grafana into dash-edit-mode 2016-10-27 22:11:08 +02:00
Torkel Ödegaard f8395666e6 minor update 2016-10-27 22:11:00 +02:00
Torkel Ödegaard 9c50893221 progress on new design 2016-10-27 21:51:57 +02:00
Leandro Piccilli c9a69c3ed9 Merge branch 'master' of https://github.com/grafana/grafana 2016-10-27 19:00:23 +02:00
Leandro Piccilli 538e1fbc64 Fix templating using query 2016-10-27 18:59:24 +02:00
Matt b58c38a5db Refactored to be a proper list, added x button in upper right. Before cleaning up the CSS, want trent to set some eyes on it and make it look better. 2016-10-27 11:36:46 +02:00
Matt 4633da47ef Merge branch 'dash-edit-mode' of https://github.com/grafana/grafana into dash-edit-mode 2016-10-26 17:52:41 +02:00
Matt e7f5b76570 Added styles and new markup for dashlist panel 2016-10-26 17:52:37 +02:00
Torkel Ödegaard c609586ff0 ux(dashboard): making progress on new add panel experiance 2016-10-26 17:42:39 +02:00
Torkel Ödegaard f1f923abb9 build fix 2016-10-26 14:31:47 +02:00
Torkel Ödegaard 113a772e33 ux(dashboard): add panel stuff 2016-10-26 12:19:18 +02:00
Torkel Ödegaard 280709327c updated 2016-10-25 17:33:22 +02:00
Torkel Ödegaard 7b0eb6d0bb feat(dashboard): progress on dash edit mode 2016-10-25 16:36:40 +02:00
Utkarsh Bhatnagar b382d17e34 Fixed alerting bug for mysql (#6375) 2016-10-25 14:52:20 +02:00
Torkel Ödegaard 5e1f1c0989 updated 2016-10-25 12:12:59 +02:00
Torkel Ödegaard b45bd07032 ux(dashboard): when saving dashbord with default new dashboard title show Save As Dialog, #6099 2016-10-25 11:11:21 +02:00
Torkel Ödegaard 8a715cd122 using gf-form in row header 2016-10-25 10:47:13 +02:00
Torkel Ödegaard d1cc890ed3 Merge branch 'master' into dash-edit-mode 2016-10-24 14:57:30 +02:00
Torkel Ödegaard 556547b316 ux(panel resize): snap to even 12ths spans 2016-10-24 14:57:13 +02:00
Torkel Ödegaard d6c07d242c Merge branch 'master' into dash-edit-mode 2016-10-24 14:51:35 +02:00
Torkel Ödegaard 4db723ea81 ux(panel resize): snap to even 12ths spans 2016-10-24 14:40:46 +02:00
Torkel Ödegaard 6fb81f54bb ux(): minor fix 2016-10-24 14:12:19 +02:00
Torkel Ödegaard 01627b3a68 feat(ux): dashboard edit mode progress 2016-10-24 13:50:38 +02:00
Utkarsh Bhatnagar 10a42cc98c CHANGELOG entry (#6362) 2016-10-24 11:11:44 +02:00
Noah Heil 56ccd80cce Added two hints to help newer users
I spent a couple of hours trying to figure out why the cloudwatch datasource was not working and the "internal error" notice was not helpful. So I added some hints so that people who are a little newer to linux/aws/grafana wont have to suffer like I did.
2016-10-24 03:05:16 -06:00
Utkarsh Bhatnagar 86ca7ddda4 Added explicitTags support for OpenTSDB>=2.3 (#6361) 2016-10-24 09:15:19 +02:00
Torkel Ödegaard 29e834e74b feat(UX): revived dash-edit-mode branch, #6099 2016-10-23 10:05:31 +02:00
Torkel Ödegaard 1bb8192a38 Merge branch 'master' into dash-edit-mode 2016-10-23 10:03:55 +02:00
Torkel Ödegaard 42961ef8a0 fix(dashbard): fixed issue confirmig when saving a dashboard with conflict 2016-10-22 12:34:18 +02:00
Torkel Ödegaard 8735a84685 Merge branch 'master' of github.com:grafana/grafana 2016-10-22 11:51:48 +02:00
Torkel Ödegaard 8bb2f11505 Merge branch 'alerting_keeplast' 2016-10-22 11:51:16 +02:00
Carl Bergquist bc90e6ce46 Alerting: Keep last state on no data (#6354)
* feat(alerting): add support to keep last state on no data

closes #6332

* refactoring(alerting PR #6354): added new option type for NoData option so AlertStateType does not have to contain invalid state, #6354
2016-10-22 10:56:04 +02:00
Torkel Ödegaard a2e14f56e4 refactoring(alerting PR #6354): added new option type for NoData option so AlertStateType does not have to contain invalid state, #6354 2016-10-22 10:54:50 +02:00
Torkel Ödegaard 4999fff29b fix(alerting): fixed email notification so it splits email address multiple ways, fixes #6353 2016-10-22 10:24:31 +02:00
Torkel Ödegaard b32bbbd1a2 fix(influxdb): enforce database restriction, fixes #6352 2016-10-22 10:03:02 +02:00
Torkel Ödegaard 401c67d136 fix(dashboard): re-render panels when leaving fullscreen mode, fixes #6312 2016-10-22 09:51:18 +02:00
Torkel Ödegaard 1581bf8d5b fix(docs): added api_url to configuration docs, fixes #6351 2016-10-22 08:51:32 +02:00
bergquist 6e65c93203 fix(cli): improve error handling 2016-10-21 16:03:02 +02:00
bergquist 2c7dbde06a feat(alerting): recover from panic 2016-10-21 14:46:58 +02:00
bergquist ad56f67ad1 feat(alerting): add support to keep last state on no data
closes #6332
2016-10-21 14:00:20 +02:00
Torkel Ödegaard 96008c9738 Squashed commit of the following:
commit 4113ed00782590187d19dd2f8cbae683f164142c
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Fri Oct 21 10:47:35 2016 +0200

    docs(): minor fix for docs index page

commit 45478d120571519462fac905aadeab5954696690
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Thu Oct 20 14:28:21 2016 +0200

    updated

commit c9c1c1d5a462f85e8001a45218f24102583d7aee
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Thu Oct 20 14:27:34 2016 +0200

    docs(): updated image refs

commit 5fa0f27963968d77bbbbb7edd973847ea72135e3
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Wed Oct 19 14:33:04 2016 +0200

    docs is almost done

commit 6b988c90cb08563e2c27212338c2947e69f6fcc3
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Tue Oct 18 20:45:28 2016 +0200

    almost done

commit 17757c21ed813892ddb1f289f2e52613caf7bcef
Author: Torkel Ödegaard <torkel@grafana.org>
Date:   Tue Oct 18 16:45:48 2016 +0200

    making progress on docs

commit f06c815991dd81b8893912a6da04a17b80b63fda
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Tue Oct 18 14:30:55 2016 +0200

    progress on new docs

commit 5197237426252623de2d8b9cc22ddbbdbb240763
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Tue Oct 18 13:25:26 2016 +0200

    making progress

commit 33e2b6b617f16f65878141cf11e54b2817a2ea96
Merge: de385e5 ecb4a99
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Tue Oct 18 12:17:58 2016 +0200

    Merge branch 'new-docs' of github.com:grafana/grafana into new-docs

commit ecb4a99dd54aa39f17d9bf4d7e132a389812f8fd
Author: Torkel Ödegaard <torkel@grafana.org>
Date:   Tue Oct 18 10:39:59 2016 +0200

    keep urls for now

commit de385e56d86b071cf2150ccf9f1aa06ec5187277
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Mon Oct 17 17:56:18 2016 +0200

    more progress

commit 8469ebc239ab2316cbbc01862e5026737f272f00
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Mon Oct 17 17:08:06 2016 +0200

    progress on new docs

commit e755f656b12534cfcb23bad11f1fa696e43f7428
Merge: 4644a35 35cce3b
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Mon Oct 17 12:21:27 2016 +0200

    Merge branch 'new-docs' of github.com:grafana/grafana into new-docs

commit 4644a35102555204787e91041b50dcbfe0f7a213
Merge: 25c4bef 977cdd5
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Mon Oct 17 12:21:11 2016 +0200

    Merge branch 'master' of github.com:grafana/grafana into new-docs

commit 35cce3bef802fac020a53693b02c112a91a096fc
Author: Torkel Ödegaard <torkel@grafana.org>
Date:   Mon Oct 17 09:31:17 2016 +0200

    progress on #6170

commit 25c4bef629de7d77218ba95cc3bd25fb50bb19d6
Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
Date:   Sun Oct 16 15:05:30 2016 +0200

    fix for osx

commit 6c6b52f975630be87da23dd51beafaecb820cec2
Author: Torkel Ödegaard <torkel@grafana.org>
Date:   Sun Oct 16 12:56:39 2016 +0200

    progress on new docs

commit 6a09633981ab26191d5542dbe3a788846ac6b73d
Author: Torkel Ödegaard <torkel@grafana.org>
Date:   Sat Oct 15 11:39:49 2016 +0200

    progress on new docs

commit 7d533fbc23e41b86fd1ba9c955dd17ae1ad977e5
Author: Torkel Ödegaard <torkel@grafana.org>
Date:   Mon Oct 10 09:25:12 2016 +0200

    making progress on new docs site

commit 50392ce98edfa201977716e92e4a86f9d48ae386
Author: Torkel Ödegaard <torkel@grafana.org>
Date:   Sun Oct 9 20:02:28 2016 +0200

    feat(new docs): progress on new docs site

commit 81a3d3d0952d3a5d790412e90d01ac5a247e0686
Author: Torkel Ödegaard <torkel@grafana.org>
Date:   Fri Oct 7 07:52:11 2016 +0200

    new docs site experiment

commit 704adc98664665b3624087ab38ce29fc9da005f1
Author: Torkel Ödegaard <torkel@grafana.org>
Date:   Sat Oct 1 20:46:53 2016 +0200

    new docs poc
2016-10-21 11:01:34 +02:00
Carl Bergquist 5520454523 Merge pull request #6344 from roidelapluie/cuu
Allow to set current on graph panel
2016-10-21 09:30:48 +02:00
bergquist 5bf5ed68e1 tech(notifications): replace internal email code 2016-10-21 09:06:03 +02:00
bergquist f77799837e feat(alerting): support for attached graphs in alert notifications
closes #6183
2016-10-21 09:06:03 +02:00
bergquist ded5a0a9d5 tech(alerting): remove unused code 2016-10-21 09:05:54 +02:00
Carl Bergquist 206a6b0a47 Merge pull request #6346 from cglewis/master
fix cla link; formatting and grammar fixes
2016-10-21 08:57:14 +02:00
cglewis 3931e0b743 fix cla link; formatting and grammar fixes 2016-10-20 13:08:12 -07:00
Julien Pivotto d1eb7e5fcd Allow to set current on graph panel
Refs #6335

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2016-10-20 21:13:32 +02:00
Carl Bergquist 1ce0b8fe25 Merge pull request #6333 from utkarshcmu/alerting_typo
Fixed typo
2016-10-20 11:26:02 +02:00
utkarshcmu b989b08781 Fixed typo 2016-10-20 02:22:37 -07:00
Eric Uldall eda442dbf9 added support to login user oauth user by email only (#6330)
* added support to login user oauth user by email only

* added sql handler

* fixed model method name from GetUserByEmail to GetUserByEmailQuery

* fixed variable declaration typo
2016-10-20 06:45:10 +02:00
bergquist 9badb051ba fix(changelog): typo 2016-10-20 06:38:45 +02:00
bergquist f2cbfece2c feat(notification): add helptext for using multiple email addresses 2016-10-19 17:04:17 +02:00
bergquist 6ea0f0120e feat(notifications): switch to ; seperator
using \n caused problems with the json deserialisation.

closes #6326
2016-10-19 16:34:12 +02:00
bergquist 3ac38dfe70 Merge branch 'alerting_opentsdb' 2016-10-19 13:16:16 +02:00
bergquist 2df8c649b7 Merge branch 'master' into alerting_opentsdb 2016-10-19 13:15:22 +02:00
bergquist 5fbab038e8 fix(opentsdb): can always return false 2016-10-19 13:14:42 +02:00
Torkel Ödegaard a826591eed Merge branch 'master' of github.com:grafana/grafana 2016-10-19 13:14:34 +02:00
Carl Bergquist 497eca0190 Merge pull request #6325 from utkarshcmu/alerting_opentsdb
Implmented targetContainsTemplate for OpenTSDB
2016-10-19 13:07:33 +02:00
utkarshcmu 62895114e1 Implmented targetContainsTemplate for OpenTSDB 2016-10-19 03:54:41 -07:00
bergquist 4c2f2eeb58 feat(opentsdb): add mock method for detecting targets with template values 2016-10-19 11:45:39 +02:00
bergquist 20bfe443fe feat(prometheus): trim labelname lookup key
closes #6300
2016-10-19 08:57:58 +02:00
bergquist b2d5b920f5 feat(alerting): allow editor to modify notifications
closes #6314
2016-10-19 08:01:31 +02:00
Carl Bergquist a1e97b0067 Merge pull request #6290 from utkarshcmu/alerting_opentsdb
Opentsdb alerting feature completed, ready for testing
2016-10-19 07:50:40 +02:00
Eric Uldall 9468ddeed5 Issues/6317 empty google login (#6318)
* added Login property to google_oauth model

* fixed spacing

* fixed google_oauth syntax error, missing comma before newline

* set noexpandtab for commit
2016-10-19 07:43:32 +02:00
utkarshcmu 333a853948 Fixed for loop and append 2016-10-18 08:48:06 -07:00
bergquist d1eceedf55 feat(webhook): add httpmethod to webhook
closes #6255
2016-10-18 16:50:16 +02:00
bergquist 9429434cb5 feat(influxdb): use database auth if provided
closes #6310
2016-10-18 15:12:04 +02:00
Mitsuhiro Tanda a8dd44918b support future time range 2016-10-18 19:39:04 +09:00
bergquist 2b55cf609c tech(build): include sha1 as artifact 2016-10-18 11:42:25 +02:00
bergquist d016fc1da1 tech(build): create sha files for windows build 2016-10-18 10:54:17 +02:00
Carl Bergquist 860865bd55 Merge pull request #6303 from mtanda/cw_region
(cloudwatch) add region
2016-10-18 08:48:44 +02:00
Mitsuhiro Tanda 888619d74e (cloudwatch) add region 2016-10-18 12:28:20 +09:00
utkarshcmu 10d581dd0a Added unit tests for query parsing 2016-10-17 14:51:51 -07:00
utkarshcmu 2374d09877 Fixed query parsing bugs 2016-10-17 14:50:53 -07:00
bergquist 97008f90c4 tech(build): semicölöns 2016-10-17 15:19:00 +02:00
bergquist 75a1ff1037 tech(build): dont override arch for windows 2016-10-17 15:09:35 +02:00
bergquist 0abc22f272 tech(build): make artifact path less strict 2016-10-17 14:35:09 +02:00
mkm85 977cdd5933 Fix cloudwatch multivalue (#6282)
* Fixed missing contains variable problem

* allow All option to be used in cloudwatch templating
2016-10-17 11:33:28 +02:00
bergquist b6d112f8d7 tech(build): appveyor formating 2016-10-17 09:34:58 +02:00
bergquist 6c7e227d2f Merge branch 'master' of github.com:grafana/grafana 2016-10-17 09:29:29 +02:00
Paul Traylor a45a487ad3 Update query for "Rule Eval Duration" (#6294)
This query was changed to use seconds in https://github.com/prometheus/prometheus/commit/f69e668fc468dfa2feb13603237810b8d748d87e
2016-10-17 08:37:59 +02:00
utkarshcmu ace81760ea Added tests file for writing tests 2016-10-16 12:10:13 -07:00
utkarshcmu b7744b4928 Added tags and filters params to alerting 2016-10-16 10:55:07 -07:00
utkarshcmu 35f93f4117 Added rate params to alerting 2016-10-16 05:20:58 -07:00
utkarshcmu cc0a39f816 Added downsampling params to alerting 2016-10-16 04:12:13 -07:00
benrubson 807bc5eb47 Add time back to result array 2016-10-16 01:09:00 +02:00
benrubson 9792bd7b08 Typo 2016-10-16 00:46:56 +02:00
benrubson 604dcbc6b2 Missing values, corect tooltip 2016-10-16 00:30:50 +02:00
benrubson 07bf4c0b82 Missing values, keep interpolation 2016-10-16 00:29:15 +02:00
benrubson 04a276dc2c Missing values, correctly highlight last point 2016-10-15 16:51:18 +02:00
benrubson 8d5269dea7 Typo 2016-10-15 13:17:11 +02:00
benrubson 43129aa563 Missing values, correct graph specs 2016-10-15 13:10:19 +02:00
benrubson c976448f6a Missing values, stack null & missing values 2016-10-15 13:07:41 +02:00
benrubson 2cdd097b3a Missing values, correct timeStep 2016-10-15 11:43:36 +02:00
Ben RUBSON d1e8418c74 Correct tooltip timestamp (#6283)
Corrects #6275, follows #6211
2016-10-15 08:02:07 +02:00
Torkel Ödegaard c1567ae595 fix(build): fixes #6284 2016-10-15 08:00:48 +02:00
Torkel Ödegaard 04c23ef322 fix(SIGHUP): ignore SIGHUP syscall, fixes #6276 2016-10-14 14:23:22 +02:00
Torkel Ödegaard 30645a6d3d refactor(alerting): initial step for seperating alerting and dash model, #6273 2016-10-14 13:06:29 +02:00
bergquist 466e62968e tech(build): publish artifacts to s3 2016-10-14 10:37:31 +02:00
bergquist ec4260e14f tech(build): remove commented build steps 2016-10-14 10:26:08 +02:00
bergquist 5e0fa0f0ad feat(opentsdb): context aware http requests 2016-10-14 10:21:47 +02:00
bergquist 6d6d6d90fc Merge branch 'utkarshcmu-alerting_opentsdb' into alerting_opentsdb 2016-10-14 10:15:43 +02:00
bergquist f44e360b0d fix(opentsdb): fmt 2016-10-14 10:15:30 +02:00
Torkel Ödegaard 4c26c55fea fix(api): minor change to how pause alert was done 2016-10-14 09:58:22 +02:00
Torkel Ödegaard 46bab0bb37 feat(alerting): remove annotations when deleting alert, closes #6244 2016-10-14 09:43:30 +02:00
Torkel Ödegaard c9d7eb0a7a feat(alerting): added clear history button to alert state history view, #6244 2016-10-14 09:33:42 +02:00
bergquist fe24e6c8a8 Merge branch 'alerting_opentsdb' of https://github.com/utkarshcmu/grafana into utkarshcmu-alerting_opentsdb 2016-10-14 09:19:42 +02:00
bergquist 455df7f0a0 Merge branch 'master' into alerting_opentsdb 2016-10-14 09:17:35 +02:00
bergquist aeb0c5cb53 Merge branch 'master' into interval 2016-10-14 09:15:04 +02:00
bergquist f4e0a9245e feat(influxdb): choose highest interval value 2016-10-14 09:14:13 +02:00
utkarshcmu 4247e92e87 Resolved conflicts 2016-10-14 00:01:36 -07:00
utkarshcmu 06f2047ced OpenTsdb alerting works with metric query 2016-10-13 23:49:28 -07:00
bergquist 998df2a1ac feat(opentsdb): add alerting support to plugin.json 2016-10-13 23:49:27 -07:00
bergquist b8ec1ce9a2 tech(tsdb): add basic skeleton for alerting 2016-10-13 23:49:27 -07:00
bergquist fb99d9d680 feat(build): remove dist from artifact path 2016-10-14 07:05:36 +02:00
bergquist b2acc7cf03 feat(build): build zipfile before creating artifact 2016-10-13 17:51:09 +02:00
Carl Bergquist 0793811b7e Merge pull request #6192 from polynomial/fix_typo
fix(docs): duplicate word data in Graph Panel
2016-10-13 17:17:49 +02:00
bergquist da2aaf7095 feat(build): trigger windows build after successfull CI build 2016-10-13 17:11:04 +02:00
Carl Bergquist 7bdedff89c feat(plugins): make sure windows data plugin path is absolute (#6264) 2016-10-13 15:36:35 +02:00
Torkel Ödegaard 44f064392d feat(alerting): different colored lines/icons for alert annotations based on state, #6244 2016-10-13 15:22:54 +02:00
mdadm fa492c6828 fixed scoping issue with certPool variable (#6261) 2016-10-13 13:38:55 +02:00
bergquist 4144eacc24 feat(influxdb): start parsing interval parameters 2016-10-13 11:42:51 +02:00
bergquist 1506df8c11 feat(alerting): parse the interval value from the panel 2016-10-13 11:19:44 +02:00
Carl Bergquist c0596d0dd0 Merge pull request #6257 from utkarshcmu/opentsdb_lodash
Opentsdb queries fixed without alias but with tags/filters
2016-10-13 07:34:00 +02:00
utkarshcmu 6638605fd1 Removed console.log 2016-10-12 13:47:40 -07:00
utkarshcmu cc3b928708 Opentsdb queries broken if no alias is uses with tags/filters 2016-10-12 13:32:37 -07:00
bergquist 2e4ca64783 fix(cli): improve error handling
closes #6256
2016-10-12 22:31:28 +02:00
Torkel Ödegaard 0f2fa33daf docs(changelog): added fix for #4393 to the changelog 2016-10-12 13:17:30 +02:00
Uros Meglic e1739b6025 (fix)elasticsearch: IP addresses don't survive terms aggregation (#4393) (#6246) 2016-10-12 13:14:57 +02:00
Carl Bergquist ce60efea8a Merge pull request #6249 from txisme/master
Fixed latest builds URL
2016-10-12 13:06:38 +02:00
txisme 2fc7957485 Fixed latest builds URL 2016-10-12 11:27:21 +01:00
bergquist 5a39bf5c58 fix(alert_tab): dont add dup notifications to repeater
closes #6233
2016-10-12 11:27:49 +02:00
Torkel Ödegaard 0bae12e4ae change(graph): Changed default for stack hover value 2016-10-12 11:21:23 +02:00
bergquist c0829903ba fix(alerting): scope variable was updated
closes #6228
2016-10-12 09:46:32 +02:00
Torkel Ödegaard b8b577eafb fix(spelling): minor spelling fix in alerting code 2016-10-12 09:17:48 +02:00
bergquist 5a91d45f3f fix(influxdb): broken unittests 2016-10-12 07:43:30 +02:00
Torkel Ödegaard 1b8a81d4ba fix(alerting): fixed reducer change issue, fixes #6241 2016-10-12 07:04:53 +02:00
Torkel Ödegaard 3d593492c9 fix to text panel and transparent mode 2016-10-12 07:04:53 +02:00
marcv81 150d21800c Do not pass Authorization header in Grafana.net proxy (#6243) 2016-10-12 06:54:33 +02:00
bergquist 885e0366c5 feat(influxdb): support raw queries in alerting
ref #6231
2016-10-11 18:53:09 +02:00
bergquist ccee1b3f96 fix(alerting): fix bug with unhandled error
closes #6239
2016-10-11 17:37:07 +02:00
bergquist 0d4b00df95 feat(alerting): add template validation for influxdb
closes #6230
2016-10-11 16:03:00 +02:00
Torkel Ödegaard 2e21613be7 fix(templating): fixed issues with dynamic dashboard srv (panel/row) repeats, fixes #6237 2016-10-11 15:17:47 +02:00
Corentin Chary 4df379f90c Do not align refresh time (#6178)
When you have a lot of dashboards, all of them
end up refreshing their dashboards at the exact
same time, which isn't particulary good for your
TSDB backend.
2016-10-11 13:57:53 +02:00
Ben RUBSON f7124f1638 Patch: 4 tooltip bugs (#6211)
* Order tooltip by yaxis by default

solves #6174

* typo

* Avoid sorting multiple times

and evaluate series.yaxis.n as it may not exist.

* typo

* typo

* typo

* Tooltip values loose their format when reordered

solves #6208

* Hover the correct point

* Make tooltip sort happy with hidden series
2016-10-11 13:53:49 +02:00
Uros Meglic dc680a41c8 fix(elasticsearch): Query editor allows to remove last group by (#5692) (#6223) 2016-10-11 13:41:13 +02:00
Torkel Ödegaard cace1d6b8f change(plugin page): changed tab order on plugin page, closes #6123 2016-10-11 13:40:16 +02:00
Torkel Ödegaard 73fc659011 fix(graph): fixed issue with old threshold to new threshold model migration, fixes #6236 2016-10-11 13:22:46 +02:00
Torkel Ödegaard f1905a8485 fix(alerting): fixed issue with using nested queries in graphite query used in alerting rule, fixes #5996 2016-10-11 12:50:11 +02:00
bergquist 446bde2421 Merge branch 'pause_alert_rules'
closes #6135
2016-10-11 10:54:58 +02:00
bergquist c6cf7647ff feat(alerting): pausing alerts requires alert id 2016-10-11 10:53:24 +02:00
Carl Bergquist be2054fe51 Merge pull request #6229 from nijanthanh/cloudwatch_ApplicationELB_UnHealthyHostCount_fix
(cloudwatch) Fix UnHealthyHostCount metric of ApplicationELB
2016-10-11 10:36:19 +02:00
bergquist 3162e680c2 tech(notifiers): improve logging for notifications
ref #6228
2016-10-11 10:15:41 +02:00
Torkel Ödegaard 7b70e0ff3a fix(UI): fixed 3 UI bugs, fixes #6225 2016-10-11 09:51:43 +02:00
bergquist 8b0c29b104 Merge branch 'master' into pause_alert_rules 2016-10-11 09:46:48 +02:00
bergquist 4bbc2108f9 feat(alerting): add pause button to alert list 2016-10-11 09:45:38 +02:00
Nijanthan Hariharan 2b8404e178 (cloudwatch) Fix UnHealthyHostCount metric of ApplicationELB
The UnHealthyHostCount metric of ApplicationELB for cloudwatch datasource did not work because the capitalization was wrong - it was UnhealthyHostCount instead of UnHealthyHostCount.
Here is the AWS documentation listing the metric name - http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudwatch-metrics.html#load-balancer-metrics-alb
2016-10-11 13:10:57 +05:30
Dan Cech 6b16fcea52 Oauth2 Updates (#6226)
* break out go and js build commands

* support oauth providers that return errors via redirect

* remove extra call to get grafana.net org membership

* removed GitHub specifics from generic OAuth

* readded ability to name generic source

* revert to a backward-compatible state, refactor and clean up

* streamline oauth user creation, make generic oauth support more generic
2016-10-11 08:51:44 +02:00
bergquist 804797245d feat(alerting): make it possible to pause from alert tab 2016-10-11 08:40:38 +02:00
Torkel Ödegaard d4fd1c82e3 fix(alerting): added step any to alert threshold input fields, fixes #6205 2016-10-10 19:47:16 +02:00
Dan Cech 519100f1bd Merge pull request #6217 from ericpp/oauth_add_state_param
Added a state parameter for all OAuth requests
2016-10-10 09:58:35 -04:00
bergquist f3825263d4 feat(alerting): add pause button in alert list 2016-10-10 15:17:14 +02:00
Carl Bergquist b0d154d5aa Merge pull request #6221 from grafana/alerting_influxdb
Alerting support for influxdb
2016-10-10 14:32:47 +02:00
bergquist 264590a9c2 feat(alerting): add paused api endpoint 2016-10-10 14:26:09 +02:00
bergquist 19427b59f9 feat(alerting): do not enqueue paused rules 2016-10-10 13:29:10 +02:00
bergquist 04f417a423 feat(alerting): enabled by default. configurable elert engine
closes #6210
2016-10-10 13:09:16 +02:00
bergquist 8d96262106 chore(tsdb): tidy up code 2016-10-10 11:58:06 +02:00
bergquist b841e649ab Merge branch 'master' into alerting_influxdb 2016-10-10 11:38:29 +02:00
bergquist f609623abd style(influxdb): tidy up code 2016-10-10 11:34:52 +02:00
bergquist 95b9f472d1 tech(influxdb): remove unused logging 2016-10-10 11:17:00 +02:00
bergquist f919d04e3c docs(tsdb): improve fill comment 2016-10-10 09:52:53 +02:00
bergquist 0bfb94dc6f feat(tsdb): add interval calculator 2016-10-10 09:45:33 +02:00
Torkel Ödegaard 918481909c fix(metricsegment): fixed issue with metric segment, fixes #6212 2016-10-08 10:23:30 +02:00
Torkel Ödegaard b65642564a poc for new metric segment 2016-10-08 10:06:47 +02:00
Eric Perrino 81443bf8b4 Added a state parameter for all OAuth requests 2016-10-08 01:22:32 -05:00
Torkel Ödegaard 913f17ee8a fix(plugin dashboards): fixed issue with plugin dashboard list, fixes #6215 2016-10-07 16:04:58 +02:00
bergquist 4fafefd66a feat(influxdb): proper support for group by tags 2016-10-07 15:09:54 +02:00
bergquist e499e8850c fix(influxdb): fix for timerange 2016-10-07 11:33:17 +02:00
bergquist 0633e2c03f feat(influxdb): add real support for time ranges 2016-10-07 11:23:37 +02:00
bergquist e36f9fa795 Merge branch 'master' into alerting_influxdb 2016-10-07 10:45:05 +02:00
bergquist a3c91450d5 tech(config): add log.filters to default and sample 2016-10-07 10:39:01 +02:00
Torkel Ödegaard a5cbfc8b98 fix(opentsdb): fixed opentsdb issue, fixes #6206 2016-10-07 08:57:40 +02:00
Eric Perrino d3b0905899 Added allow_sign_up setting to auth.ldap to be able to disable automatic user creation for LDAP logins (#6191) 2016-10-07 08:49:58 +02:00
Wolfram Kroll 7e6595acaf hint about how to override settings from default section (#6181) 2016-10-07 08:48:57 +02:00
bergquist 522d40fa26 fix(influxdb): support mulitple tags 2016-10-06 18:51:17 +02:00
bergquist 87650c150b feat(influxdb): add tags to serie names 2016-10-06 18:47:59 +02:00
bergquist b0addbd7cb feat(influxdb): support multi row results 2016-10-06 15:30:09 +02:00
Torkel Ödegaard dacfa6b978 fixed issue in metric_segment 2016-10-06 15:09:02 +02:00
bergquist d8aa38fafe tech(influxdb): refactor and cleanup 2016-10-06 14:16:26 +02:00
bergquist ab8751767c feat(influxdb): send request and parse response 2016-10-06 12:51:45 +02:00
bergquist b519d5e92c feat(docker): update docker-compose for influxdb 2016-10-06 12:50:06 +02:00
Torkel Ödegaard 04a5ad529c generate sha1 for package files, fixes #913 2016-10-06 10:53:42 +02:00
Torkel Ödegaard cc1452277b added testdata scenario for null data and stacking, also updated testdata dashbord, #2912 2016-10-06 10:53:42 +02:00
bergquist 887ca40455 feat(influxdb): add support for policies 2016-10-05 20:57:28 +02:00
bergquist 4387d20222 feat(influxdb): render select and groupby 2016-10-05 20:36:05 +02:00
bergquist 9968fa5bc5 feat(influxdb): add query part definitions 2016-10-05 16:59:33 +02:00
bergquist 8588bb386c feat(influxdb): add conditions property to tag 2016-10-05 16:57:32 +02:00
Peter Dave Hello bf4c3f3ae6 optimize png images using zopflipng (#6197) 2016-10-05 15:57:50 +02:00
bergquist c7abd3ba4e feat(influxdb): add querypart renderers 2016-10-05 14:42:06 +02:00
bergquist d0e6a9559e feat(influxdb): add query part model 2016-10-05 10:56:34 +02:00
bergquist 92121ea656 feat(alerting): add nop uploader
ref #6183
2016-10-05 07:34:48 +02:00
Benjamin Smith 39769ea65b fix(docs): duplicate word data in Graph Panel 2016-10-04 12:40:34 -07:00
bergquist 946e0bf32e feat(influxdb): parse query json 2016-10-04 21:28:05 +02:00
bergquist e556df5b49 feat(tsdb): add draft implementation for influxdb 2016-10-04 16:25:33 +02:00
bergquist d726f49a8c fix(notification): broken test notifications
ref #6159
2016-10-03 17:03:21 +02:00
bergquist 5a201cfd35 tech(tsdb): abort batch procces when context closes 2016-10-03 14:33:47 +02:00
bergquist d889415c4b tech(tsdb): rename context to query 2016-10-03 14:32:04 +02:00
bergquist 653a0502c4 tech(tsdb): add jsondata to tsdb datasource struct 2016-10-03 14:31:33 +02:00
bergquist 1606b74fce tech(opentsdb): add init ref for opentsdb 2016-10-03 10:59:09 +02:00
bergquist f4a834f84b fix(opentsdb): add context to opentsdb executor 2016-10-03 10:37:49 +02:00
bergquist 8368a4a88a Merge branch 'master' into alerting_opentsdb 2016-10-03 10:36:33 +02:00
bergquist 6f1a9f4f2e Merge branch 'mtanda-cloudwatch_interval' 2016-10-03 10:32:07 +02:00
bergquist f4b5fa4d6a Merge branch 'master' into mtanda-cloudwatch_interval 2016-10-03 10:32:00 +02:00
bergquist 96ca69c5a9 tech(cloudwatch): extract method 2016-10-03 10:31:07 +02:00
Carl Bergquist c38f6ff182 Make alerting notifcations sync (#6158)
* tech(routines): move the async logic from notification to alerting notifier

* tech(notification): reduce code dupe

* fix(notification): dont touch the response unless its an error

* feat(alerting): make alerting exeuction async but flow sync

* tech(alerting): remove commented code

* tech(alerting): remove unused code

* tech(alerting): fix typo

* tech(alerting): implement Context on EvalContext

* tech(alerting): wait for all alerts to return

* feat(alerting): dont allow alert responses to cancel

* Revert "feat(alerting): dont allow alert responses to cancel"

This reverts commit 324b006c96.

* feat(alerting): give alerts some time to finish before closing down
2016-10-03 09:38:03 +02:00
bergquist 6b7015799c Merge branch 'cloudwatch_interval' of https://github.com/mtanda/grafana into mtanda-cloudwatch_interval 2016-10-03 08:51:33 +02:00
bergquist 36f0bf0e1e chore(web): Improve error message for invalid SSL configuration 2016-10-03 08:47:36 +02:00
Leandro Piccilli 0000065053 Merge branch 'master' of https://github.com/grafana/grafana 2016-10-02 16:59:25 +02:00
Torkel Ödegaard 4a116ad4ad fix(build): fixed failing unit test 2016-10-01 17:36:56 +02:00
Torkel Ödegaard 4ec2377e09 fix(notifications): added form validation and restored Send Test button which was always hidden, #6159 2016-10-01 17:14:45 +02:00
Torkel Ödegaard c6cf6d4655 fix(api): fixed issue with api content-type in api success messages, fixes #6160 2016-10-01 16:52:52 +02:00
HeroCC 72f81b3b2a Make Slack Logo link to Slack (#6165) 2016-10-01 16:50:56 +02:00
miao 1f5a68aab1 Modify basic introductions of docs and make it exact (#6166) 2016-10-01 16:50:09 +02:00
Torkel Ödegaard a6918617ff feat(api): fixed minor issue with error message when trying to create duplicate datasource, fixes #6164 2016-10-01 16:41:27 +02:00
Torkel Ödegaard 4f2263552c feat(alerting): updated look for alerting panel, #6136 2016-10-01 16:32:13 +02:00
bergquist 91b180168e tech(notifications): remove unused filter markup 2016-10-01 15:51:08 +02:00
Torkel Ödegaard aa78114440 fix(alerting): fixed icon for ok state in panel header, #6136 2016-09-30 17:39:05 +02:00
Torkel Ödegaard 7c339f0794 feat(alerting): show alertin state in panel header, closes #6136 2016-09-30 17:37:47 +02:00
bergquist 1226beba31 feat(opentsdb): add alerting support to plugin.json 2016-09-30 16:50:50 +02:00
Torkel Ödegaard 2c4524bbfd fix(logging): minor logging fix 2016-09-30 13:25:54 +02:00
Torkel Ödegaard 2908c6a80b fix(metricsegment): added min width for inputs for metric segment and value select components 2016-09-30 13:13:28 +02:00
Torkel Ödegaard fe4a0a98c1 fix(alerting): added confirm modal in UI, when deleting alert 2016-09-30 13:00:16 +02:00
Torkel Ödegaard 24a25453f6 fix(server): shutdown logging fixes 2016-09-30 10:18:19 +02:00
Torkel Ödegaard 5ec86a9ef4 fix(build): fixed broken build, unreachable code in migrator.go 2016-09-30 09:23:26 +02:00
Torkel Ödegaard 86b546c21d refactor(main): refactoring main grafana server / startup code 2016-09-30 08:36:20 +02:00
Torkel Ödegaard 2b8177e3e5 fix(migration): fix for sqlstore migration, the execution of the migration and recording of the success of it was not done in same transaction, fixes #5315 2016-09-30 07:49:40 +02:00
Torkel Ödegaard 0ab2113fab docs(config): added missing smtp config section, fixes #6155 2016-09-30 07:40:58 +02:00
bergquist b66d94343e tech(tsdb): add basic skeleton for alerting 2016-09-30 07:35:48 +02:00
Torkel Ödegaard 50d146e82c fix(docs): fixed influxdb docs and mention of InfluxDB version, #6027 2016-09-29 14:53:50 +02:00
Torkel Ödegaard 5a1a80bcdd feat(templating): adding missing label property to query variable defaults, fixes #6150 2016-09-29 14:46:59 +02:00
bergquist 1a062c52fa fix(notifications): handle none configured image uploader
ref #6152
2016-09-29 14:31:19 +02:00
Torkel Ödegaard 88ec307f3e fix(graph panel): fixed issue with graph axis labels 2016-09-28 21:39:51 +02:00
Alexander Zobnin c2856926aa fix(graph): fix X axis value selection. (#6145) 2016-09-28 21:29:51 +02:00
Torkel Ödegaard 75311e0626 feat(alerting): removed old init package 2016-09-28 21:27:24 +02:00
Torkel Ödegaard 5f5bbfbda5 Merge branch 'master' of github.com:grafana/grafana 2016-09-28 21:12:37 +02:00
Torkel Ödegaard 80eb82420e fix(cleanup): check if images dir exists 2016-09-28 21:12:25 +02:00
Torkel Ödegaard c28d004731 Merge branch 'go_routines' 2016-09-28 21:06:07 +02:00
Torkel Ödegaard 71e2c6f6ef refactor(backend): refactoring management of go routines in backend 2016-09-28 21:06:00 +02:00
Dan Cech 6d7061dcaf fix typo in config loader 2016-09-28 13:10:31 -04:00
Torkel Ödegaard 2750c8a801 feat(config): changed name of allow_user_login_pass to disable_login_form, changed the section of the config option to [auth], impacts merged PR #5423 2016-09-28 15:27:08 +02:00
Torkel Ödegaard 3e657357e5 Merge branch 'gnet-oauth' 2016-09-28 15:11:03 +02:00
Torkel Ödegaard e5fc4332cd feat(oauth): refactoring PR #6077 2016-09-28 15:10:50 +02:00
bergquist bc634f20d5 Merge branch 'master' into go_routines 2016-09-28 13:58:14 +02:00
bergquist 7a6501640f tech(log): fixes extra param logging 2016-09-28 13:57:19 +02:00
bergquist 991539e410 style(go_routines): improve variable naming 2016-09-28 13:35:24 +02:00
Torkel Ödegaard 5ccdbf01fd merge with master 2016-09-28 13:02:15 +02:00
Torkel Ödegaard 10e63e5dd2 Merge branch 'master' of github.com:grafana/grafana 2016-09-28 12:17:16 +02:00
Torkel Ödegaard 15299c2ac0 fix(govendor): added new null package 2016-09-28 12:15:47 +02:00
Torkel Ödegaard 599fe49944 fix(templating): fix to datasource variable, was not updated on dashboard load, added unit test for case as well 2016-09-28 12:12:38 +02:00
Mitsuhiro Tanda 593863fb9e (prometheus) check time range (#6137) 2016-09-28 11:54:25 +02:00
Torkel Ödegaard 68370ba2bc feat(testdata): added alert dashboard 2016-09-28 10:44:21 +02:00
Torkel Ödegaard a4648607bb feat(testdata): added csv test data scenario 2016-09-28 10:37:30 +02:00
Torkel Ödegaard 8d5857661e refactor(tsdb): changed tsdb time series model to use null.Float instead of pointers 2016-09-28 09:15:48 +02:00
Torkel Ödegaard 63caedb094 Merge branch 'master' of github.com:grafana/grafana 2016-09-28 08:09:51 +02:00
Torkel Ödegaard 460160cfa4 feat(testdata): added test case for ms resolution data 2016-09-28 08:08:46 +02:00
Torkel Ödegaard 22e8885690 feat(testdata): progress on test data stuff 2016-09-27 18:36:00 +02:00
Torkel Ödegaard 3ecd96e682 feat(testdata): lots of work on new test data data source and scenarios 2016-09-27 18:17:39 +02:00
bergquist 34b31aeef8 tech(goroutines): sync state between different go routines 2016-09-27 16:47:17 +02:00
bergquist 8e89173095 tech(log): fixes extra param logging 2016-09-27 16:06:06 +02:00
Torkel Ödegaard ade8aa5b92 feat(graph): refactorings 2016-09-27 14:47:04 +02:00
Torkel Ödegaard 34f15d92d0 feat(testdata): worked on testdata app 2016-09-27 14:39:51 +02:00
bergquist 262e7193a3 feat(alerting): keep proccessing results even if one response panics 2016-09-27 11:16:55 +02:00
bergquist 071f2205e1 tech(tsdb): ops <o> 2016-09-27 11:13:13 +02:00
bergquist 46d4f817e3 tech(graphite): return error if statuscode is not ok 2016-09-27 10:09:56 +02:00
Torkel Ödegaard 81cb4a740b refactor(graph): progress on graph panel work 2016-09-26 17:25:29 +02:00
bergquist 6a699d13c4 docs(configuration): add note about snapshot configuration 2016-09-26 14:46:03 +02:00
bergquist 7585e9a930 docs(changelog): add note about closing #4087 and #2172 2016-09-26 14:41:13 +02:00
bergquist dbb7852f21 feat: purge old files and snapshots
closes #4087
closes #2172
2016-09-26 14:33:40 +02:00
Torkel Ödegaard 40e6317b7b feat(graph): refactoring 2016-09-26 14:04:13 +02:00
Torkel Ödegaard acfde82c0a refactor(graph): js -> typescript refactoring 2016-09-26 13:55:42 +02:00
bergquist 1a32ab64b6 tech(renderer): improve renderOpts names 2016-09-26 11:07:36 +02:00
bergquist effd2098ee feat(alerting): fixes broken image renderer 2016-09-26 10:51:45 +02:00
bergquist 887e236bce fix(rule): fixes rule reading bug 2016-09-26 10:01:33 +02:00
bergquist 8cd9225eb6 feat(alerting): increase timeout to 15s 2016-09-26 08:45:55 +02:00
Torkel Ödegaard 5682520603 feat(graph): more work on graph panel and support for non time series 2016-09-24 13:08:58 +02:00
Torkel Ödegaard cd270f14a2 feat(graph): more work on graph panel and support for non time series 2016-09-23 17:12:10 +02:00
Dan Cech 501e67a657 use semver when comparing grafana and plugin versions (#6108) 2016-09-23 14:38:59 +02:00
Torkel Ödegaard 3bbc940b88 Merge branch 'master' into graph-panel-non-timeseries 2016-09-23 14:22:44 +02:00
Torkel Ödegaard 9a94072c1d Merge branch 'master' of github.com:grafana/grafana 2016-09-23 12:30:20 +02:00
Torkel Ödegaard 175c651e65 fix(server side rendering): Fixed issues with server side rendering for alerting & for auth proxy scenarios, fixes #6115, fixes #5906 2016-09-23 12:29:53 +02:00
bergquist 99c77e7df8 tech(plugins): increase timeout 2016-09-23 09:56:42 +02:00
bergquist e5c64732f1 fix(sql): Add boolstr to all dialects
closes #6116
2016-09-23 09:36:15 +02:00
bergquist 521b5cf014 tech(build): make sure build.go setup works fine
ref #6113
2016-09-23 06:51:37 +02:00
Carl Bergquist 696a5f6a80 Merge pull request #6113 from replay/fix_context_dependency
Fix context dependency
2016-09-23 06:43:32 +02:00
Carl Bergquist 66fe886755 Merge pull request #6112 from replay/fix_typo
fix typo
2016-09-23 06:42:59 +02:00
Mauro Stettler f7dfcb4401 Merge branch 'master' of github.com:grafana/grafana into fix_context_dependency 2016-09-22 21:13:53 +01:00
Mauro Stettler cb0f19f8d4 fix context dependency 2016-09-22 21:13:08 +01:00
Carl Bergquist 7bfef0ced8 Merge pull request #6111 from grafana/pluginreadme
allow non-admin users to view plugin readme
2016-09-22 21:12:44 +01:00
Torkel Ödegaard bb77caa369 Merge branch 'master' of github.com:grafana/grafana 2016-09-22 21:49:57 +02:00
Torkel Ödegaard e36cdac594 fix(templating): fixed issue with templating when initalizing variables without any existing value 2016-09-22 21:49:41 +02:00
Mauro Stettler b063cf0a6e fix typo 2016-09-22 20:44:57 +01:00
Carl Bergquist d6a0ec85c4 Merge pull request #6111 from grafana/pluginreadme
allow non-admin users to view plugin readme
2016-09-22 19:51:47 +02:00
Dan Cech 2c3dd84ebb allow non-admin users to view plugin readme 2016-09-22 13:46:11 -04:00
bergquist 5817948341 Merge branch 'alert_prometheus' 2016-09-22 19:27:35 +02:00
bergquist d711c0ed35 Merge branch 'master' into alert_prometheus 2016-09-22 19:27:24 +02:00
bergquist a49c21df3a fix(png-renderer): increase timeouts 2016-09-22 19:24:18 +02:00
Torkel Ödegaard f2f3115749 feat(graph panel): more progress on graph panel and non time series data support 2016-09-22 16:47:37 +02:00
Torkel Ödegaard 6cd4db12c7 feat(graph panel): refactoring axes tab options into it's own component 2016-09-22 16:19:44 +02:00
bergquist 76b8cff445 fix(gnet): remove trailing , 2016-09-22 16:17:22 +02:00
Torkel Ödegaard 23246605b0 feat(graph panel): working on adding non time series support to graph panel 2016-09-22 16:05:20 +02:00
Torkel Ödegaard f3d4a97f49 Merge branch 'master' into graph-panel-non-timeseries 2016-09-22 14:03:06 +02:00
Torkel Ödegaard 0fc7405b95 fix(elasticsearch): for query template variable when looking up terms without query, no longer relies on elasticsearch default field, fixes #3887 2016-09-22 12:05:03 +02:00
Torkel Ödegaard f79600b352 fix(internal metrics): removed local dev code 2016-09-22 11:54:47 +02:00
Torkel Ödegaard e336fb3d60 fix(smtp mailer): added timeout of 10 seconds to smpt mailer, fixes #2989 2016-09-22 11:51:39 +02:00
Torkel Ödegaard 936146768f fix(snapshots): fixed issue with viewing embedded/solo/png panel from snapshot without login, fixes #3769 2016-09-22 11:46:58 +02:00
Torkel Ödegaard 3ed7ab93c5 added small info text to plugins list page, #5176 2016-09-22 11:32:27 +02:00
Torkel Ödegaard 6574dfacfb feat(internal metrics): added some total stats to metrics reporting, closes #5865 2016-09-22 11:16:19 +02:00
Torkel Ödegaard 8c05a125dc fix(build): updated build.go setup 2016-09-22 10:33:43 +02:00
Torkel Ödegaard d8df421b43 fix(build): fixed issues with optimized build, fixes #6096 2016-09-22 10:22:16 +02:00
Torkel Ödegaard 39af588a94 fix(playlist): fixed sorting issue with playlist playback, fixes #5467 2016-09-22 10:06:03 +02:00
Torkel Ödegaard 598ac0e815 docs(http api): Clarified issue with admin http api docs, fixes #5834# 2016-09-22 09:09:12 +02:00
Torkel Ödegaard 2752dbd13a feat(templating): minor fixes to recent refactorings 2016-09-22 09:00:15 +02:00
Torkel Ödegaard 6257ae094c feat(sqlstore): added index for dashboard_id in dashboard_tag table, fixes #5868 2016-09-21 21:32:51 +02:00
Torkel Ödegaard d65fbcbb42 fix(graphite): fixed minor graphite lexer issue when nodes begin with octal syntax and end with dash identifier, fixes #6049# 2016-09-21 20:04:09 +02:00
Dan Cech 248ed2672f remove 'Github' from oauth login error messages 2016-09-21 09:42:06 -04:00
Dan Cech b387c1291d Merge branch 'master' into gnet-oauth
Conflicts:
	pkg/api/login_oauth.go
2016-09-21 09:39:35 -04:00
Torkel Ödegaard 9e26a4cfcb fix(templating): fixed unique filter after regex pass, fixes #6086 2016-09-21 15:30:11 +02:00
Torkel Ödegaard b4111d78e1 fix(security): fixed login issue that was a potential for social engineering, fixes #6014 2016-09-21 15:03:14 +02:00
Torkel Ödegaard 4a1693196c fix(mixed datasource): fixed issue when exporting dashboard using mixed data source, fixes #6032 2016-09-21 14:57:19 +02:00
Torkel Ödegaard 46ab09ed60 feat(links): fixed styling for dashboard links 2016-09-21 14:20:59 +02:00
bergquist b856d7e193 fix(prometheus): remove timerange from context 2016-09-21 13:55:42 +02:00
bergquist ae7345b04d style(prometheus): remove commented test 2016-09-21 13:46:26 +02:00
bergquist c084145cba refactor(prometheus): add timerange to alert context 2016-09-21 13:46:10 +02:00
Torkel Ödegaard dc3b614749 fix(submenu): fixed issue with submenu and annotation display, and annotation issue in table panel 2016-09-21 13:45:26 +02:00
bergquist af551b8825 refactor(tsdb): remove toUnix from timerange 2016-09-21 13:41:25 +02:00
bergquist 9534a04d3d fix(prometheus): only accept matrix result 2016-09-21 13:30:41 +02:00
bergquist ee0f1a0f36 feat(prometheus): handle more errors 2016-09-21 13:17:36 +02:00
Torkel Ödegaard d0b75cdb66 fix(templating): fixed issue with regex in query variable introduced by yesterdays big merged refactoring of template variable system 2016-09-21 11:38:59 +02:00
bergquist 3e73be8d2e feat(prometheus): improve error handling 2016-09-21 11:31:56 +02:00
Torkel Ödegaard 8b90eedb35 feat(table): table options tab form layout changes 2016-09-21 11:23:39 +02:00
bergquist 4c88db3e43 feat(prometheus): add support for legend formatting 2016-09-21 11:17:29 +02:00
Torkel Ödegaard 7c10af012e feat(singlestat): slight layout changes to options tab 2016-09-21 10:56:17 +02:00
Torkel Ödegaard 7b7ba46f12 fix(styleguide): fixed theme switching in style guide 2016-09-21 09:10:25 +02:00
Torkel Ödegaard 4f892ab9bf Merge branch 'master' of github.com:grafana/grafana 2016-09-21 09:03:57 +02:00
Torkel Ödegaard a01836e86d feat(adhoc filters): basic implementation for ad hoc filters for elasticsearch, #6038 2016-09-21 08:48:49 +02:00
Alexander Zobnin 392976981c fix(table panel): update Table Panel options tab styles. (#6087) 2016-09-21 07:40:12 +02:00
bergquist 43d8bd5a25 feat(prometheus): initial support for prometheus 2016-09-21 07:01:53 +02:00
Dan Cech 630a8ed8aa support setting default org role when adding user via grafana.net auth 2016-09-20 12:36:36 -04:00
Torkel Ödegaard 1b02632de8 fix(jslint): fixed lint issue 2016-09-20 17:36:20 +02:00
Dan Cech da95a23080 remove 'Github' from oauth login error messages 2016-09-20 11:36:13 -04:00
Torkel Ödegaard 0906312046 Merge branch 'adhoc-filters' 2016-09-20 17:34:57 +02:00
Torkel Ödegaard 15423e6e51 feat(adhoc filters): initial base mvp for adhoc filters are donecloses #6038 2016-09-20 17:34:38 +02:00
Torkel Ödegaard dfe0f91105 feat(adhoc): adhoc filters progress 2016-09-20 16:29:48 +02:00
Dan Cech dcd96c90e2 add grafana.net auth section to defaults.ini, normalize section heading line lengths 2016-09-20 10:09:20 -04:00
Alexander Zobnin 159a8bf734 fix(singlestat): update singlestat options tab styles. (#6084) 2016-09-20 15:29:10 +02:00
Torkel Ödegaard 6e429b8575 feat(adhoc filters): good progress on ad hoc filters and sync from to url, #6038 2016-09-20 11:57:43 +02:00
Alexander Zobnin 20f7eee8cc fix(graph): increase Y min and max range when series values are the same, (#6082)
fixes #6070, #6050.
2016-09-20 11:38:18 +02:00
Alexander Zobnin e926b01185 Bug fixes for flexible Y-Min and Y-Max settings (#6066)
* fix(flexible_y-min/max): fixed negative values support and added tests for this.

* fix(flexible_y-min/max): fixed issue with Y-Min and Y-Max values stored as numbers.
	Issue: panels with configured Y-Min and Y-Max don't display anything
		   after upgrade.
2016-09-20 11:23:31 +02:00
bergquist d2fb660557 fix(cli): remove unused logging 2016-09-20 10:10:27 +02:00
Carl Bergquist 630adfaf2b Merge pull request #6068 from fg2it/cross
Cross build support
2016-09-20 10:03:06 +02:00
bergquist ec452dd704 docs(conf): remove internal options since its not working atm 2016-09-20 08:18:15 +02:00
bergquist 21fcb2c643 Merge branch 'mtanda-cloudwatch_expand_template' 2016-09-20 08:14:01 +02:00
bergquist 46866add7e docs(changelog): add note about closing #5003 2016-09-20 08:13:53 +02:00
Mitsuhiro Tanda 71b5007ec7 refactor 2016-09-20 11:04:23 +09:00
Mitsuhiro Tanda 07cce5f6bd refactor 2016-09-20 11:04:23 +09:00
Mitsuhiro Tanda 481cc01242 (cloudwatch) add test for expand templater variables 2016-09-20 11:04:23 +09:00
Mitsuhiro Tanda 540436e9d5 inject templateSrv 2016-09-20 11:04:23 +09:00
Mitsuhiro Tanda 490141da82 (cloudwatch) expand multi select template variable 2016-09-20 11:03:35 +09:00
Dan Cech f5e2d61aef Merge branch 'master' into gnet-oauth 2016-09-19 16:48:40 -04:00
Dan Cech fc17ed351c support logging in with grafana.net credentials 2016-09-19 16:48:07 -04:00
Leandro Piccilli 128de86d49 Merge branch 'master' of github.com:grafana/grafana 2016-09-19 20:12:02 +02:00
Torkel Ödegaard cb522d58cd feat(templating): back to be able to continue work on ad hoc filters, #6048 2016-09-19 18:41:42 +02:00
Torkel Ödegaard 7a6fb70026 feat(templating): progress on variable system refactoring, #6048 2016-09-19 18:32:09 +02:00
Torkel Ödegaard 9d6ecc6361 feat(templating): progress on variable system refactoring, #6048 2016-09-19 18:06:36 +02:00
Steven Arnott 6e4ed4debd Altered DB for Prefix (#6062) 2016-09-19 17:12:43 +02:00
Torkel Ödegaard 945b5ee3cf feat(templating): progress on variable system refactoring, #6048 2016-09-19 17:03:36 +02:00
bergquist 87be56a4f0 fix: add goconvey to vendor 2016-09-19 16:22:39 +02:00
bergquist 3f00834f25 tech: remove unused dependencies 2016-09-19 15:21:53 +02:00
Torkel Ödegaard 8a796c5b4b feat(templating): progress on variable system refactoring, #6048 2016-09-19 15:15:15 +02:00
Torkel Ödegaard 5ded88fa4d feat(templating): progress on variable system refactoring, #6048 2016-09-19 11:34:08 +02:00
bergquist 1cb45c3416 fix(alertlist): better description 2016-09-19 10:11:33 +02:00
Torkel Ödegaard 524f505664 tech(templating): refactoring, updated dashboardSrv to typescript 2016-09-19 10:08:05 +02:00
bergquist 0bde2ae689 fix(alertlist): remove timerange checkbox option 2016-09-19 10:07:53 +02:00
fg2it 0984edd8b2 avoid copy of go dep. from vendor/ for release 2016-09-19 08:03:35 +02:00
fg2it 699c515369 enforce unconditional copy 2016-09-18 11:45:46 +00:00
fg2it c669de1169 add options to support cross build 2016-09-18 10:07:12 +00:00
fg2it 62a2f80f10 add option for grunt release 2016-09-18 09:13:00 +00:00
fg2it 174ea11b1c avoid copy of go dep. from vendor/ for release 2016-09-18 09:03:47 +00:00
Torkel Ödegaard 5ce3e40cc9 feat(templating): more work on new variable handling code, #6048 2016-09-17 15:27:53 +02:00
Torkel Ödegaard 4188c46f83 feat(templating): more work on new variable handling code, #6048 2016-09-17 11:28:45 +02:00
Torkel Ödegaard 46ebae7304 feat(templating): progress on template system rewrite #6048 2016-09-16 16:50:30 +02:00
bergquist 05d43999dc feat(alertlist): add support for time range lockdown
closes #5981
2016-09-16 15:55:38 +02:00
bergquist 77783c02cd fix(alerting): dont log null series
closes #6025
2016-09-16 14:59:54 +02:00
Torkel Ödegaard 7e8b279895 feat(templating): good progress on new variable update code, #6048 2016-09-16 10:48:03 +02:00
Torkel Ödegaard 852fd66c4c Update debian.md 2016-09-16 10:42:15 +02:00
Alexander Zobnin 4fa22e2158 Refactor: flexible Y-Min and Y-Max settings (#6051)
* Feature: Flexible Y-Min and Y-Max settings.

Y-Min and Y-Max is now string.
New usage for both Y-Min and Y-Max (Where X is a real number):
  >X Y-Max/Y-Max is auto if data is above X else X
  <X Y-Max/Y-Min is auto if data is below X else X
  =X Y-Max/Y-Min is scaled to current value +/- X
  ~X Y-Max/Y-Min is caled to average value +/- X

Example: Y-Min: <100 Y-Max: >200
If all points are within 100 and 200: Y-Min is 100 and Y-Max is 200
If some points are above 200: Y-Min is 100 and Y-Max is auto
If some points are below 100: Y-Min is auto and Y-Max is 200
if some points are below 100 and above 200: Y-Min and Y-Max is auto

Tests for new settings added

* Use parseFloat instead of implicit conversion

* feat(flexible_y-min/max): refactor.

* feat(flexible_y-min/max): added more tests.
2016-09-15 21:03:54 +02:00
bergquist a95808a7c3 docs(build): update required go version to 1.7 2016-09-15 16:29:25 +02:00
cmartin0077 f91f74be04 fix(influxdb) autocomplete measurement while typing, fixes #4278 (#5931) 2016-09-15 16:11:38 +02:00
bergquist 3c92f78ee7 feat(cli): add grafana version header to all request against grafana.net 2016-09-15 16:01:06 +02:00
Torkel Ödegaard 0f4a9f1ed1 feat(templating): began refactoring variables into rich behavioral classes 2016-09-15 14:53:36 +02:00
bergquist 3c966caa23 feat(cli): download all plugin dependencies 2016-09-15 14:38:11 +02:00
bergquist fc67ab1dce tech(build): add build grafana-server and cli to CI 2016-09-15 13:52:41 +02:00
bergquist dd70c535ed tech(build): upgrade ci build to 1.7.1 2016-09-15 13:43:37 +02:00
bergquist dede58915d Merge branch 'go_vendor' 2016-09-15 13:25:50 +02:00
bergquist 6be48269e2 tech(build): update build docs 2016-09-15 13:09:33 +02:00
bergquist d3a5d5c058 tech(build): update makefile 2016-09-15 13:02:16 +02:00
bergquist bda1f6493c tech(scripts): move benchmark script into /scripts 2016-09-15 13:00:26 +02:00
bergquist 283172e78c tech(build): remove unused file 2016-09-15 12:59:25 +02:00
bergquist 6489571179 move circle trigger to /scripts 2016-09-15 12:57:41 +02:00
bergquist 4afd7a5ef1 tech(build): update circle ci to build using vendor folder 2016-09-15 11:32:32 +02:00
Zihao Yu 6d843e3db5 update github oauth docs (#6042) 2016-09-15 11:29:03 +02:00
Torkel Ödegaard 94e5001c0e feat(templating): making progress on adhoc template variable, #6038 2016-09-15 09:18:28 +02:00
Alexander Zobnin 3be84b00d5 ES nested fields autocomplete (#6043)
* Re-create PR #4527 from @arcolife:
fixes #4526 - add nested support to fieldname autocomplete; Also:
    - update _mapping to first use given time range
      for deducting index mapping, then fallback to
      today's date based index name

* (elasticsearch): refactor getFields() method.

* (elasticsearch): add tests for getFields() method.

* (elasticsearch): fixed _get() method (tests was broken after @arcolife commit).
2016-09-15 07:30:08 +02:00
Torkel Ödegaard 83b9db51e3 feat(templating): great progress on adhoc filters, #6038 2016-09-14 17:36:28 +02:00
bergquist 6253476c73 tech(build): move dependencies to vendor folder 2016-09-14 16:14:27 +02:00
bergquist 4e567b5f02 feat(alert): order alerts by name.. instead of nothing. 2016-09-14 14:51:31 +02:00
bergquist a23b7f1371 fix(alerting): add missing evaldata field to set state command 2016-09-14 14:35:05 +02:00
bergquist 31892ed73c style(alertlist): remove unused code 2016-09-14 14:21:56 +02:00
bergquist 9dd8b3b408 wip 2016-09-14 14:12:19 +02:00
Torkel Ödegaard 0a44add6c9 feat(adhoc fiters): began work on ad-hoc filters, refactored submenu filters to use gf-form styles, #6038 2016-09-14 11:21:02 +02:00
bergquist d0f9623037 feat(alertlistpanel): support state filter
ref #5981
2016-09-14 10:49:05 +02:00
bergquist b49a642ca5 feat(alerting): extract method for join eval matches 2016-09-14 10:49:05 +02:00
bergquist d02f29fb02 feat(alertlist): basic alert list panel
ref #5981
2016-09-14 10:49:05 +02:00
Torkel Ödegaard babab7677c tech(lib upgrade): fixed issue with angular 1.5.8, so can revert revert of upgrade, that is we are no on latest angularjs, #6022 2016-09-14 10:45:56 +02:00
Torkel Ödegaard c594f9f2ad fix(lodash): corrected checked in lodash version 2016-09-14 10:13:33 +02:00
Torkel Ödegaard 649d9f9177 tech(lodash): upraded lodash to 4.15.0, closes #6021 2016-09-14 09:17:10 +02:00
Torkel Ödegaard 0fa0066cd9 tech(lodash): began migration work 2016-09-13 22:10:44 +02:00
Torkel Ödegaard 2146e69a11 revert angularjs upgrade 2016-09-13 21:26:28 +02:00
Torkel Ödegaard fffa26b876 tech(lib upgrade): updated jquery to 3.1, fixes #6034 2016-09-13 20:42:28 +02:00
Torkel Ödegaard 25139c77b9 tech(update angularjs): updated angularjs to 1.5.9 2016-09-13 20:33:49 +02:00
Torkel Ödegaard f5809c0209 fix(build): trying to fix build 2016-09-13 20:14:18 +02:00
Torkel Ödegaard 9cd517780f Merge branch 'master' of github.com:grafana/grafana 2016-09-13 16:25:48 +02:00
Torkel Ödegaard 8c30babdf1 feat(alerting): fixed build issues 2016-09-13 16:24:00 +02:00
Torkel Ödegaard 3af891d023 feat(alerting): restored alert history 2016-09-13 16:13:41 +02:00
Torkel Ödegaard b0c7e61ef8 feat(alerting): removed severity 2016-09-13 15:09:55 +02:00
wvl a73424d6af Secure Elasticsearch datasources a bit (#6031)
Instead of allowing users to access the
entire cluster, apply some sane restrictions.

Change-Id: Ib2e93722bf2e39d700d4afa713ff49ec556f2fdf
2016-09-13 15:04:21 +02:00
bergquist 6a723dff37 feat(notifications): set default value to false for new notifications 2016-09-13 14:25:48 +02:00
Torkel Ödegaard 6375418d8c Merge branch 'alerting' into grafana-annotations 2016-09-13 09:38:12 +02:00
Mitsuhiro Tanda 1264a1b3a6 (cloudwatch) add metrics/dimensions (#6020) 2016-09-13 09:08:33 +02:00
Jouni Kuusisto e53b815956 Enable "With Credentials" for InfluxDB datasource (#6018) 2016-09-13 08:57:39 +02:00
Carl Bergquist 52dc2db769 Merge pull request #6008 from rubycut/patch-1
Increase datasource limit to 1000 #3910
2016-09-13 08:38:07 +02:00
bergquist 3ba3d9d445 docs(changelog): add note about closing #2839 2016-09-13 08:14:43 +02:00
bergquist f7abf01efb Merge branch 'mtanda-template_sort' 2016-09-13 08:12:23 +02:00
bergquist 03fb152d4b tech(templates): extract sort method 2016-09-13 08:11:04 +02:00
bergquist 9c5436c648 feat(templating): set default sort order 2016-09-13 07:39:30 +02:00
bergquist e348822190 Merge branch 'template_sort' of https://github.com/mtanda/grafana into mtanda-template_sort 2016-09-13 07:16:34 +02:00
Carl Bergquist 1c7b76cb43 Merge pull request #6013 from mtanda/cloudwatch_kinesis_analytics
(cloudwatch) add metrics/dimensions
2016-09-12 17:03:25 +02:00
Mitsuhiro Tanda f998b86ade (cloudwatch) add metrics/dimensions 2016-09-12 23:47:31 +09:00
bergquist 157ab1ba36 fix(setting): broken code 2016-09-12 14:57:37 +02:00
bergquist 811b7188c4 docs(config): add docs for how to run grafana behind a reverse proxy 2016-09-12 14:47:21 +02:00
bergquist d7bf70a77b tech(tsdb): remove skip ssl setting. should be based on datasource settings 2016-09-12 13:37:00 +02:00
bergquist 6c5860d3e8 feat(metrics): measure proxy requests 2016-09-12 13:29:31 +02:00
Rubycut 501f89e829 Increase datasource limit to 1000 #3910 2016-09-12 10:45:17 +02:00
bergquist eb673fd16d fix(middleware): typo 2016-09-12 10:11:55 +02:00
Torkel Ödegaard 014b70ded9 fix(graph): fixed showing rendering error in inspector, fixes #5995 2016-09-10 12:00:33 +02:00
Torkel Ödegaard 7aab4a4a59 fix(table): fixed issue with using mixed data source in table panel, fixes #5999 2016-09-10 09:57:25 +02:00
Chen Chenglong 7b1c374f64 support connect ldap server with starttls (#5969)
* support connect ldap server with starttls

* add more doc for start_tls option
2016-09-10 09:40:56 +02:00
bergquist 4edb31723c fix(metrics): ignore datasource proxy requests 2016-09-09 13:53:50 +02:00
bergquist e7b56c6389 tech(metrics): move all request counters into one middleware 2016-09-09 13:28:19 +02:00
Torkel Ödegaard 4a2f2fba73 feat(alerting): show panel specific alert annotations, #5694 2016-09-09 11:30:55 +02:00
bergquist 583790e650 fix(alering): the crocdile turned on me > <
closes #5855
2016-09-09 07:42:07 +02:00
Carl Bergquist 51d2534f6a Merge pull request #5994 from mtanda/prometheus_fix_legend_template
(prometheus) fix template variable expansion in legend
2016-09-08 18:37:27 +02:00
Mitsuhiro Tanda 9d09e5bbd0 (prometheus) fix template variable expansion in legend 2016-09-09 00:46:04 +09:00
bergquist aa80b52c07 feat(alerting): make it possible to skip ssl verification for alerting https requests 2016-09-08 16:29:31 +02:00
bergquist 7b9099ef93 fix(query): requires all that all series are empty to set NoDataFound 2016-09-08 14:33:10 +02:00
Torkel Ödegaard 0ac4ece00d feat(annotations): refactoring annotations srv to typescript, #5990 2016-09-08 14:31:30 +02:00
bergquist 9511f89a22 fix(alerting): fixes bug in query conditions 2016-09-08 13:28:41 +02:00
Torkel Ödegaard 23de094a81 feat(alerting/annotations): fixed broken test 2016-09-08 13:22:30 +02:00
bergquist bec099cd84 tech: remove unused files 2016-09-08 11:41:56 +02:00
Torkel Ödegaard b8081b29fd Merge branch 'master' into grafana-annotations 2016-09-08 11:26:55 +02:00
Torkel Ödegaard d60bd77658 feat(annotations): added support to show grafana stored annotations in graphs, #5982 2016-09-08 11:25:45 +02:00
bergquist 3c9432b7e9 fix(metrics): default updateSince to ms 2016-09-08 10:48:11 +02:00
bergquist acf74cdacc fix(alerting): change execution time to ms 2016-09-08 10:45:10 +02:00
bergquist 5f934e0238 feat(emails): move bg color to main table 2016-09-08 09:59:51 +02:00
bergquist 21c5b543fb feat(profile): hide orgs list when it only contains one org 2016-09-08 09:03:29 +02:00
bergquist 592ae5a39a tests(alerting): fixes broken tests. pointers and stuff 🤷 2016-09-07 17:05:41 +02:00
bergquist 30f36fe2c4 docs(changelog): add note about merging #4718 2016-09-07 15:24:38 +02:00
bergquist f56d45ac56 feat(alerting): include default notifications in alert tab 2016-09-07 15:13:24 +02:00
bergquist c769148701 Merge branch 'emails' 2016-09-07 13:52:16 +02:00
bergquist 62372978e4 style: convert tabs to spaces 2016-09-07 13:51:17 +02:00
bergquist 59cb51dc6f test(emails): update fake data model 2016-09-07 13:47:57 +02:00
bergquist 9595916a5f feat: right align value metrics 2016-09-07 13:47:21 +02:00
bergquist 712061ab4f test(alerting): fixes broken unit tests 2016-09-07 11:45:38 +02:00
bergquist 166df66f66 docs(go): update go dep to 1.6 2016-09-07 11:28:22 +02:00
bergquist f26824049f Merge branch 'master' into emails 2016-09-07 11:19:52 +02:00
bergquist 374016b9b5 Merge branch 'kfitzpatrick-custom-github-style-oauth' 2016-09-07 11:07:30 +02:00
bergquist 10b3ee362c docs(oauth): add generic_auth to docs 2016-09-07 11:06:59 +02:00
bergquist 53dddf1a8f fix(oauth): remove github refs from generic auth 2016-09-07 10:55:46 +02:00
bergquist 3b6820ef03 feat(oauth): create struct for generic oauth and add config values 2016-09-07 10:34:56 +02:00
Torkel Ödegaard 0d083bad14 Merge branch 'master' of github.com:grafana/grafana
Conflicts:
	pkg/components/imguploader/s3uploader.go
2016-09-07 10:14:36 +02:00
Torkel Ödegaard 50b41130ca feat(alerting): fixed s3 upload issue, progress on alerting on null/missing data, updated ini package to get the support for line continuations 2016-09-07 10:11:00 +02:00
bergquist d1a7a23c84 test(imageupload): add more specific tests
torkels commit will fix this unit test :)
2016-09-07 10:05:01 +02:00
bergquist 4646723cbb Merge branch 'custom-github-style-oauth' of https://github.com/kfitzpatrick/grafana into kfitzpatrick-custom-github-style-oauth 2016-09-07 08:15:44 +02:00
Torkel Ödegaard fc8f0721cd Merge branch 'master' of github.com:grafana/grafana
Conflicts:
	pkg/services/alerting/eval_context.go
2016-09-06 20:40:49 +02:00
Torkel Ödegaard fbae6abb3c feat(alerting): progress on handling no data in alert query, #5860 2016-09-06 20:40:12 +02:00
bergquist 2e8d5ca519 docs(changelog): add note about updating systemd description 2016-09-06 17:32:18 +02:00
Carl Bergquist a02bef7d94 Merge pull request #5971 from cicku/master
Update systemd unit's description to be more understandable
2016-09-06 17:11:46 +02:00
Christopher Meng 6afb456bef Update systemd unit's description to be more understandable
Signed-off-by: Christopher Meng <i@cicku.me>
2016-09-06 16:29:15 +02:00
bergquist 04690ca920 feat(alerting): add support for retries
ref #5855
2016-09-06 15:09:49 +02:00
bergquist 0d7a871223 style(alerting): remove blank lines 2016-09-06 14:57:15 +02:00
bergquist 22805ce56b fix(alert_tab): fix broken alert history 2016-09-06 14:42:34 +02:00
bergquist 55b560a4a8 feat(alerting): filter notifications based on severity
closes #5851
2016-09-06 14:27:48 +02:00
Torkel Ödegaard b1ed641d73 fix(graph): fixed issue with duplicate metric calls when doing full page reload of graph in edit/view mode 2016-09-06 09:20:34 +02:00
Torkel Ödegaard 6b17cdbca6 feat(alerting): Save As removes alerts from panels, closes #5965 2016-09-06 09:14:11 +02:00
bergquist 2ca7284a56 tech(notifications): splitt into 3 queries
closes #5883
2016-09-06 08:43:15 +02:00
bergquist c893e5d241 feat(notifications): add support for default notifications
ref #5883
2016-09-05 21:35:37 +02:00
bergquist eb0396ad95 chore(tsdb): remove some logging 2016-09-05 21:35:24 +02:00
bergquist 015423b233 tech(gitignore): ignore vscode folder 2016-09-05 21:35:24 +02:00
Carl Bergquist b501590a75 fix(.editorconfig): correct spelling of indent_style
Unleash the fucking fury
2016-09-05 17:38:55 +02:00
bergquist d11bc57c37 feat(notifications): make it possible to send test alert notifications
closes #5847
2016-09-05 14:45:15 +02:00
Torkel Ödegaard 4c5461d4ba feat(alerting): alerting scheduling distribution, only distibutes it on seconds for now, not sub second distribution, #5854 2016-09-05 14:26:08 +02:00
Torkel Ödegaard e2f5bf1666 feat(alerting): fixed confirm delete dashboard issue 2016-09-05 13:38:25 +02:00
Torkel Ödegaard 395213abd7 feat(graph panel): more refactoring of #5917 2016-09-05 11:46:16 +02:00
Torkel Ödegaard 31642b472c refactoring(graph panel): #5917 2016-09-05 11:07:41 +02:00
Torkel Ödegaard 36252602af Merge branch 'master' into graph-panel-non-timeseries 2016-09-05 09:58:07 +02:00
bergquist daea38060f feat(notifications): redirect to notification list after creation. 2016-09-05 08:27:12 +02:00
Carl Bergquist 002cfb09cb Merge pull request #5953 from kobtea/fix/ng-ctrl
fix typo
2016-09-05 07:56:57 +02:00
Carl Bergquist ae2fe11166 Merge pull request #5957 from tdi/master
Changed EBS to ELB
2016-09-05 07:54:03 +02:00
Dariusz Dwornikowski 1b283d052b Changed EBS to ELB 2016-09-02 20:49:28 +02:00
Hiroaki Kobayashi 3645fb371c fix typo 2016-09-02 15:22:04 +09:00
bergquist 1955defc43 fix(api): add missing jsonData field to dto
The field is available on the dto so I guess is should be used.
Otherwise we should remove the field rather then not setting it.

ref #5944
2016-09-01 17:21:13 +02:00
bergquist 86aea89214 style(tsdb): extract some methods 2016-09-01 13:03:15 +02:00
bergquist d73547c0dc feat(tsdb): add missing content type and join url using path 2016-09-01 11:12:35 +02:00
bergquist 3d3365f242 tech(graphite): add more logging 2016-09-01 10:09:13 +02:00
bergquist 94389a3a44 tech(tsdb): improve logging for graphite client 2016-09-01 09:38:43 +02:00
bergquist 29b60329cc stupid stupid stupid me 2016-09-01 09:17:57 +02:00
bergquist 000eb669df tech(build): change min go version to 1.6 2016-09-01 08:13:48 +02:00
bergquist 7ddd625e9d feat(alerting): add slack/email support for execution errors 2016-08-31 15:55:01 +02:00
bergquist 4619a05f43 feat(alerting): save execution error message to annotations 2016-08-31 14:06:54 +02:00
bergquist c624f3d470 fix(alerting): measure state result instead of severity 2016-08-31 11:55:35 +02:00
bergquist e493015f54 fix(alerting): replace one hack with another hack 2016-08-31 10:10:39 +02:00
bergquist 53a9dec407 feat(alerting): move timestamp to new row
ref #5850
2016-08-31 09:48:58 +02:00
bergquist a5d49c9820 docs(config): add note about poodle vulnerabillity in <3.0
closes #3483
2016-08-31 08:34:15 +02:00
Trent White 00f82010f8 tweaked alert example to see if there were any visual changes 2016-08-30 12:11:00 -04:00
Trent White 852a8b77e4 table tweak 2016-08-30 12:04:26 -04:00
bergquist 1a70e69447 mark second td as last 2016-08-30 15:23:59 +02:00
bergquist ae428b9177 docs(changelog): add note about cli fix 2016-08-30 13:49:50 +02:00
bergquist 645293e590 fix(cli): improve error message for upgrade-all
closes #5885
2016-08-30 13:47:42 +02:00
bergquist b55b7cde4b fix(alerting): remove error message when model is valid again
closes #5921
2016-08-30 13:36:13 +02:00
bergquist 11a4ff0f8a feat(alerting): add basic UI for history in alert tab
ref #5850
2016-08-30 13:22:59 +02:00
bergquist 650a87dc05 feat(alerting): add alert history api endpoint
ref #5850
2016-08-30 09:32:56 +02:00
bergquist 1f1d232ea6 tech(githooks): remove symlink bash script 2016-08-30 07:48:15 +02:00
Trent White 90873cfe76 getting tables to behave on mobile 2016-08-29 16:55:19 -04:00
bergquist a2525f77d9 fix(config): comment sample value 2016-08-29 21:14:47 +02:00
bergquist ff9b95f4b3 docs(changelog): adds note about closing #5827 2016-08-29 16:24:23 +02:00
Carl Bergquist 47438ad9b9 Merge pull request #5926 from cmartin0077/5827-add-elapsed-influxdb
feat(influxdb) add elapsed(), fixes #5827
2016-08-29 16:21:59 +02:00
bergquist 9c92d8c4e9 fix(circle-ci): change to ubuntu 14 for CI 2016-08-29 16:12:42 +02:00
chrismartin0077 88ca695361 feat(influxdb) add elapsed(), fixes #5827 2016-08-29 07:05:10 -07:00
Carl Bergquist 7d4cc098a8 Merge pull request #5924 from cmartin0077/master
feat(api) HEAD response, fixes #3854
2016-08-29 15:54:21 +02:00
bergquist c0697b99d6 fix(alerting): adds support for basic auth
closes #5897
2016-08-29 15:50:11 +02:00
chrismartin0077 0050707134 feat(api) HEAD response, fixes #3854 2016-08-29 06:07:44 -07:00
cmartin0077 9c08d7aef5 fix(influxdb) fix tag value autocomplete with upper case values, fixes #5399 (#5919) 2016-08-29 13:03:54 +02:00
Torkel Ödegaard 9d69eaf07b Merge branch 'issue-5812-x-axis' of https://github.com/alexanderzobnin/grafana into graph-panel-non-timeseries 2016-08-27 09:53:10 +02:00
paulroche 5ba6bab237 redact provider_config (#5915) 2016-08-27 09:50:35 +02:00
Trent White ab4f06bc54 redesign email template 2016-08-26 14:25:39 -04:00
Alexander Zobnin 1bdd24ab9e Graph panel: fix merge conflicts introduced by alerting branch, issue #5812. 2016-08-26 21:22:46 +03:00
Alexander Zobnin 7a6d32138b Graph panel: refactor, issue #5812. 2016-08-26 20:47:12 +03:00
Alexander Zobnin 06af566f3f Graph panel: initial elastic raw document format support, issue #5812. 2016-08-25 22:03:42 +03:00
Trent White 35b90afdd0 initial styling 2016-08-24 17:41:29 -04:00
bergquist 5d821d3492 style(cli): minor fix 2016-08-24 20:27:41 +02:00
bergquist c087445d51 feat(cli): add db command to cli. 2016-08-24 15:46:26 +02:00
Alexander Zobnin d23e9fa3c3 Graph panel: table format support improvements, issue #5812. 2016-08-23 20:44:58 +03:00
Carl Bergquist 5b9366a9c3 tech(docker): update prometheus config 2016-08-23 11:50:17 +02:00
bergquist d0ca4ca3cd chore(alerting): remove unused files 2016-08-22 17:01:23 +02:00
bergquist 0cbedb4473 chore(api): remove commented endpoints 2016-08-22 16:56:28 +02:00
bergquist b8ccb82382 Merge branch 'alerting' 2016-08-22 16:10:36 +02:00
bergquist 7095a9d7e1 Merge branch 'master' into alerting 2016-08-22 15:31:33 +02:00
bergquist 3b8bba3e9f feat(alerting): add more fields to webhook 2016-08-22 15:11:27 +02:00
bergquist 1ff21b3ee8 docs(example): remove old properties 2016-08-22 14:55:16 +02:00
bergquist f3d6035c59 feat(alerting): add alerts for notification edits 2016-08-22 14:49:40 +02:00
Carl Bergquist 90388710af Merge pull request #5874 from mtanda/cw_api_gateway
(cloudwatch) add api gateway metrics/dimensions
2016-08-22 14:36:40 +02:00
Carl Bergquist 1c25d22f9e Merge pull request #5875 from mtanda/prometheus_time
(prometheus) refactor time calculation
2016-08-22 14:25:52 +02:00
bergquist 457eb91c2f docs(alerting): example dashboards 2016-08-22 13:30:57 +02:00
bergquist 77f9c24050 feat(alerting): add support for count reducer 2016-08-22 13:25:31 +02:00
bergquist 26c6437846 Merge branch 'master' into alerting 2016-08-22 12:27:08 +02:00
bergquist 69de3bcfc7 chore(example): remove example file and add links 2016-08-22 12:26:26 +02:00
bergquist 5a33679470 fix(alerting): remove has no value condition 2016-08-22 12:20:07 +02:00
Mitsuhiro Tanda d9fe41cc8d (prometheus) refactor time calculation 2016-08-20 22:51:33 +09:00
Mitsuhiro Tanda 6bd2bb04a7 (cloudwatch) add api gateway metrics/dimensions 2016-08-20 21:57:20 +09:00
bergquist 3077f992bb docs(changelog): add note about closing #5613 2016-08-19 15:19:08 +02:00
Carl Bergquist 9fdda0e269 Merge pull request #5613 from ctrochalakis/group_by_nodes
feat(graphite): added groupByNodes func def, closes #5612
2016-08-19 15:16:40 +02:00
bergquist 8d49b66dae Merge branch 'Scalingo-database_url' 2016-08-19 14:53:38 +02:00
bergquist aeb1b99648 docs(changelog): add note about closing #5456 2016-08-19 14:51:09 +02:00
bergquist 92a52ccdf7 docs(conf): add more info about using database.url 2016-08-19 14:48:40 +02:00
bergquist c663e32ea8 Merge branch 'database_url' of https://github.com/Scalingo/grafana into Scalingo-database_url 2016-08-19 13:15:44 +02:00
Alexander Zobnin c683c7a448 Graph panel: initial support for table format, issue #5812. 2016-08-18 21:59:28 +03:00
bergquist e415412691 feat(alerting): add image for howto popup
closes #5784
2016-08-18 18:36:58 +02:00
bergquist d3421c671c fix(alerting): make sure xorm can reset execution_error 2016-08-18 17:25:32 +02:00
bergquist 28ac05b1d1 docs(changelog): add filter for org switcher
closes #2609
2016-08-18 15:52:14 +02:00
bergquist 6d60d125d3 Merge branch 'Othyus-filter_orgs' 2016-08-18 15:48:47 +02:00
bergquist e3bbf96b37 Merge branch 'filter_orgs' of https://github.com/Othyus/grafana into Othyus-filter_orgs 2016-08-18 15:48:01 +02:00
Alexander Zobnin 284a6ee629 Graph panel: rename X axis modes, issue #5812. 2016-08-18 15:34:32 +03:00
bergquist def4632f08 test(alerting): add falsification test 2016-08-18 14:13:39 +02:00
bergquist cbe7f8b697 feat(config): add ascii dragon to sample.ini 2016-08-18 14:13:02 +02:00
bergquist d28df71c3b feat(alerting): add support for "no_value" evaluator 2016-08-18 11:44:25 +02:00
Torkel Ödegaard 09cdf3e9e1 feat(alerting): show execution errors in alert list 2016-08-18 11:37:35 +02:00
Torkel Ödegaard 5cf9711862 feat(alerting): added eval match to test results 2016-08-18 11:22:24 +02:00
Torkel Ödegaard 2f953d75a6 Merge branch 'alerting' of github.com:grafana/grafana into alerting 2016-08-18 10:07:45 +02:00
Torkel Ödegaard 9028d4899f feat(alerting): alert list fixes 2016-08-18 10:07:31 +02:00
bergquist 631acc2bf9 feat(alerting): only show available queries in alert query 2016-08-18 10:02:17 +02:00
Torkel Ödegaard 9b5a7b5ef6 feat(alerting): added alert howto text, closes #5784 2016-08-18 09:58:20 +02:00
Torkel Ödegaard 902314d3a1 Merge branch 'alerting' of github.com:grafana/grafana into alerting 2016-08-18 09:04:00 +02:00
Torkel Ödegaard 75a6c2b612 feat(alerting): added validation that checks valid data source and checks for template variables in graphite query, #5841 2016-08-18 09:03:46 +02:00
beejeebus 998ed097d3 Update aws-sdk from v1.0.0 to v1.4.1, fixes #5763. (#5813) 2016-08-18 08:19:53 +02:00
Roman Vynar d086f5d398 Align step with interval passed to Prometheus query using rate() (#5839) 2016-08-18 08:19:32 +02:00
bergquist 6d080904fa tech(alerting): empty string does not update database 2016-08-17 22:13:27 +02:00
bergquist 4154a4066f feat(alerting): handle all results, even due they have errors
DON'T SWALLOW THE ERR CARL
2016-08-17 22:12:08 +02:00
bergquist 158ce06167 fix(alerting): cleanup alerting example dashboard 2016-08-17 17:21:57 +02:00
Torkel Ödegaard eabba50bbf Merge branch 'alerting' of github.com:grafana/grafana into alerting 2016-08-17 15:49:18 +02:00
Torkel Ödegaard 2e7cb04490 feat(alerting): some final changes to alert list #5784 2016-08-17 15:48:58 +02:00
Torkel Ödegaard 63a283b4bc feat(alerting): working on alert state filters for alert list 2016-08-17 11:00:00 +02:00
bergquist 7d1e5b6374 tech(alerting): remove old crit/warn properties from dashboard 2016-08-17 10:53:24 +02:00
bergquist d8cfe22318 tech(alerting): add example dashboard with many alerts 2016-08-17 10:35:48 +02:00
Torkel Ödegaard da59d6547f Merge branch 'alerting' of github.com:grafana/grafana into alerting 2016-08-17 10:03:57 +02:00
Torkel Ödegaard 05697d5ecd Merge branch 'master' into alerting
Conflicts:
	conf/sample.ini
2016-08-17 10:03:33 +02:00
Torkel Ödegaard 6fae5a3b4e Merge branch 'v3.1.x' 2016-08-17 10:02:08 +02:00
Torkel Ödegaard 093563ac37 fix(metrics): restored prefix default to prod.grafana.. 2016-08-17 10:01:55 +02:00
Torkel Ödegaard f9b628ad0e Merge branch 'v3.1.x'
Conflicts:
	conf/defaults.ini
	conf/sample.ini
	pkg/metrics/graphite.go
	pkg/metrics/graphite_test.go
2016-08-17 09:53:46 +02:00
Torkel Ödegaard 2b2b64865b Merge branch 'master' of github.com:grafana/grafana 2016-08-17 09:42:52 +02:00
Torkel Ödegaard 159ea69e5d fix(OpenTSDB): correct content-type, fixes #4965 2016-08-17 09:42:40 +02:00
bergquist 6497b307c4 feat(alerting): save execution error upon state changed 2016-08-17 09:27:29 +02:00
bergquist 9915f15ed0 feat(alerting): adds sql layer for saving execution errors 2016-08-17 07:49:14 +02:00
Nozomi Anzai 157435a61c Fix to check white list when the frontend tries to connect DB 2016-08-17 14:33:59 +09:00
Torkel Ödegaard 0951da9c89 Merge branch 'v3.1.x' of github.com:grafana/grafana into v3.1.x 2016-08-16 22:31:51 +02:00
Torkel Ödegaard a5f0f508ea feat(inspector): fixed error handling, showing response body when data proxy returns text/html body 2016-08-16 22:31:26 +02:00
Torkel Ödegaard 434332f02d feat(alerting): changed fontsize in alert list 2016-08-16 21:26:54 +02:00
Alexander Zobnin 93515d0ffc Graph panel: display only bars in histogram mode, issue #5812. 2016-08-16 21:53:53 +03:00
Alexander Zobnin 113173be3d Graph panel: preserve series options (colors and other), issue #5812. 2016-08-16 21:12:35 +03:00
Alexander Zobnin 63886598e9 Graph panel: add value option (min, max, avg, etc), issue #5812. 2016-08-16 19:43:14 +03:00
Alexander Zobnin e39e5f9a9b Graph-panel: Add initial histogram option, issue #5812. 2016-08-16 18:45:57 +03:00
Torkel Ödegaard 15c11fdb54 Merge branch 'alerting' of github.com:grafana/grafana into alerting 2016-08-16 16:51:24 +02:00
Torkel Ödegaard 0b7fa3c19d feat(alerting): minor progress on alert list, #5784 2016-08-16 16:50:36 +02:00
bergquist de714e3398 tech(docker): add default db for postgres 2016-08-16 15:54:13 +02:00
bergquist c7cb93a33a style(alerting): improve codestyle for evaluators 2016-08-16 12:44:31 +02:00
bergquist fb7f2ae2e2 feat(alerting): adds within_range and outside_range evaluators
closes #5829
2016-08-16 12:37:07 +02:00
bergquist b5d92b6191 test(alerting): fix broken tests 2016-08-16 12:37:07 +02:00
Torkel Ödegaard 6b90587d27 feat(alerting): fixing failing go unit test 2016-08-16 10:22:16 +02:00
Torkel Ödegaard 65ce01fbff feat(alerting): fixing failing typescript build 2016-08-16 10:09:07 +02:00
Torkel Ödegaard fe9d591b28 Merge branch 'alerting' of github.com:grafana/grafana into alerting
Conflicts:
	pkg/services/sqlstore/migrations/alert_mig.go
2016-08-16 09:54:06 +02:00
Torkel Ödegaard f934081bcb feat(alerting): making progress on alerting list, #5784 2016-08-16 09:52:45 +02:00
Alexander Zobnin 7588ee974d Working on non time series X-axis feature. 2016-08-15 22:46:34 +03:00
bergquist aaabdbe33b feat(alerting): make post execution fields nullable 2016-08-15 20:26:36 +02:00
bergquist 2c2157f3b0 fix(alerting): rename events to evalMatches 2016-08-15 20:17:32 +02:00
Claudius Zingerli 08932b8ebc InfluxDB data source: Removed 'required' attribute from User/Password (#5820) 2016-08-15 17:56:46 +02:00
Torkel Ödegaard 9f29c54170 Merge branch 'query_part_refactor' into alerting
Conflicts:
	pkg/services/sqlstore/migrations/alert_mig.go
	pkg/services/sqlstore/migrations/heartbeat_mig.go
2016-08-15 17:54:42 +02:00
Torkel Ödegaard d8d951c810 feat(alerting): can now change reducer 2016-08-15 17:53:44 +02:00
Torkel Ödegaard 1418cbbd8b feat(query_part): refactoring query part 2016-08-15 17:20:45 +02:00
Torkel Ödegaard 0392fde34e feat(alerting): doing schema changes 2016-08-15 15:12:43 +02:00
bergquist 3195209878 tech(circle): rearrange build order 2016-08-15 14:01:20 +02:00
Torkel Ödegaard befca9bb2f feat(query parts): refactoring query part component to support actions 2016-08-15 13:51:55 +02:00
bergquist f7a9102523 feat(metrics): improve graphite settings
Fixes the broken support for overriding settings with ENV variables.
closes #5769
2016-08-15 09:59:55 +02:00
bergquist cf6736d480 fix(metrics): add ending dot for graphite prefix 2016-08-15 09:58:32 +02:00
bergquist 41790c6709 fix(metrics): hide none existing metrics settings 2016-08-15 09:58:23 +02:00
bergquist ebecc5e5a0 fix(metrics): make metrics cfg backwards compatible 2016-08-15 09:57:49 +02:00
Torkel Ödegaard 2c1b893c55 feat(metrics): minor fix for internal metrics fix PR #5758 2016-08-15 09:57:23 +02:00
bergquist 0524d0c625 fix(metrics): replaces . with _ in instance name
closes #5739
2016-08-15 09:57:00 +02:00
bergquist 2b2e015d62 feat(cli): add default plugin folder for MAC OS
closes #5806
2016-08-15 09:18:56 +02:00
Torkel Ödegaard cd9bd5be17 Update CHANGELOG.md 2016-08-15 09:15:20 +02:00
bergquist 7ce13ef075 docs(changelog): add note about fixing #5806 2016-08-15 09:13:49 +02:00
bergquist 7a913f77d3 feat(cli): add default plugin folder for MAC OS
closes #5806
2016-08-15 08:54:35 +02:00
bergquist 4d0982a21c Merge branch 'master' into alerting 2016-08-15 07:58:30 +02:00
Torkel Ödegaard 0ea3458f69 Merge branch 'v3.1.x'
Conflicts:
	public/app/features/dashboard/dynamic_dashboard_srv.ts
2016-08-14 14:47:14 +02:00
Torkel Ödegaard 58df60f670 fix(templating): another fix for repeating panels and having old panels/scoped vars stuck after switching repeat variable, fixes #5795 2016-08-14 14:45:49 +02:00
Julian Einwag cbf0e77add fix repeat panels (#5796) 2016-08-14 13:59:16 +02:00
Torkel Ödegaard 1eca0d7c53 docs(): updated docs 2016-08-14 13:58:04 +02:00
Torkel Ödegaard 76e4b7ce3b Merge branch 'master' of github.com:grafana/grafana 2016-08-14 13:51:09 +02:00
Julian Einwag deb245f526 fix repeat panels (#5796) 2016-08-14 13:50:49 +02:00
Mitsuhiro Tanda 7a1011ac39 (cloudwatch) support ApplicationELB (#5802) 2016-08-14 13:21:17 +02:00
Torkel Ödegaard 8499d32d0f Merge branch 'master' of github.com:grafana/grafana 2016-08-14 13:18:55 +02:00
Torkel Ödegaard d894c13718 fix(graph): fixed issue with tooltip introduced in recent commit 2016-08-14 13:18:23 +02:00
Torkel Ödegaard 46ea3ed971 fix(godep): fixed godep dependency 2016-08-13 13:07:55 +02:00
bergquist fb7a6c0764 feat(alerting): list all series in alert email 2016-08-13 12:50:51 +02:00
Carl Bergquist a530df8449 Merge pull request #5809 from kou/patch-1
Update the number of ways
2016-08-13 12:18:01 +02:00
bergquist c4e905474a feat(alerting): improve email notifications layout 2016-08-13 11:24:03 +02:00
Kouhei Sutou 46630df88d Update the number of ways 2016-08-13 14:12:29 +09:00
Torkel Ödegaard 74dbd7fb36 feat(alerting): disable visual thresholds while alert is enabled 2016-08-12 13:19:06 +02:00
Torkel Ödegaard 7242dc2ebe feat(thresholds): hide threshold handles when second y axis is shown 2016-08-12 10:50:31 +02:00
Torkel Ödegaard 597103a1f2 Merge branch 'alerting' of github.com:grafana/grafana into alerting 2016-08-12 10:32:58 +02:00
Torkel Ödegaard 06210a4a22 feat(thresholds): refactoring and adding many unit tests 2016-08-12 10:32:46 +02:00
bergquist 1dcae464fe chore(notifications): remove commented test 2016-08-12 10:17:21 +02:00
bergquist 16e75a3036 feat(alerting): add alert message to slack integration 2016-08-12 10:12:04 +02:00
bergquist e7613b8bc0 fix(metrics): typo 2016-08-12 08:15:53 +02:00
bergquist 2fa97427eb fix(metrics): add ending dot for graphite prefix 2016-08-12 08:06:54 +02:00
Leandro Piccilli f844cd844b Fix for annotations query on ES 5.x 2016-08-11 22:24:58 +02:00
Torkel Ödegaard 895cff78b6 feat(thresholds): more work on thresholds, within and outside types no work 2016-08-11 22:22:15 +02:00
Torkel Ödegaard 7a5dda9e7c Merge branch 'alerting' of github.com:grafana/grafana into alerting 2016-08-11 21:33:29 +02:00
Torkel Ödegaard 6793eed6c5 feat(thresholds): dragging thresholds works again 2016-08-11 21:32:59 +02:00
Torkel Ödegaard 224ceb0ae5 feat(thresholds): updated design for grab handles 2016-08-11 21:22:40 +02:00
bergquist 937726499f feat(alerting): add global usage metrics for alerting
closes #5786
2016-08-11 21:12:46 +02:00
Torkel Ödegaard 89ca15f3a1 feat(thresholds): lots of progress on thresholds 2016-08-11 18:25:41 +02:00
bergquist ae15de119f Merge branch 'master' into alerting 2016-08-11 17:01:35 +02:00
bergquist f07b2ac446 fix(metrics): hide none existing metrics settings 2016-08-11 17:00:09 +02:00
bergquist cb6fd4ca78 test(alerting): fixes broken unit test 2016-08-11 16:55:08 +02:00
bergquist 99e99922b4 feat(alerting): add support for uploading images to webdav.
closes #5770
2016-08-11 16:48:54 +02:00
Torkel Ödegaard 72a67b39f1 feat(thresholds): more work thresholds 2016-08-11 15:18:21 +02:00
Torkel Ödegaard 6881db87bb Merge branch 'alerting' into thresholds_v3 2016-08-11 10:31:39 +02:00
Torkel Ödegaard 8878a55dc6 Merge branch 'master' into alerting 2016-08-11 10:31:15 +02:00
Torkel Ödegaard da6ac07b1d Merge branch 'v3.1.x' 2016-08-11 10:29:48 +02:00
Torkel Ödegaard 0d26bc63ae fix(graphite): minor fix/improvement to graphite error handling when doing metric exploration in query editor, fixes #5778 2016-08-11 10:29:28 +02:00
Torkel Ödegaard 780ec92dd8 fix(docs): fixed plugins docs, fixes #5777 2016-08-11 07:39:34 +02:00
Jeremy Bingham 7150571e60 Mac grafana wrapper script (#5779)
* One of the homebrew folks first asked for a wrapper script to make launching grafana easier. Later I was asked to remove it and submit it upstream, so here it is.

* add instructions for installing grafana HEAD from git with homebrew back to the docs
2016-08-11 07:37:35 +02:00
Jeremy Bingham 2c4ab4af02 Mac grafana wrapper script (#5779)
* One of the homebrew folks first asked for a wrapper script to make launching grafana easier. Later I was asked to remove it and submit it upstream, so here it is.

* add instructions for installing grafana HEAD from git with homebrew back to the docs
2016-08-11 07:36:14 +02:00
Torkel Ödegaard fbb8f8e691 feat(alerting): making progress on alert handles 2016-08-10 21:37:10 +02:00
Torkel Ödegaard 2639c38912 fix(threshold): remove old threshold properties 2016-08-10 20:44:39 +02:00
Torkel Ödegaard bdb8d77562 feat(thresholds): migration from previous threshold schema 2016-08-10 20:41:21 +02:00
Alexander Zobnin 124961a9e3 Explicitly set charset to utf-8 in viewJson(), fixes #5719. (#5774) 2016-08-10 20:23:58 +02:00
Torkel Ödegaard 7c0675798e feat(thresholds): new thresholds options are looking ok 2016-08-10 17:32:34 +02:00
Torkel Ödegaard 0f8c8517e3 feat(thresholds): adding a new form of thresholds options 2016-08-10 15:27:33 +02:00
bergquist 95c1a4a936 feat(alerting): implement more simple reducers 2016-08-10 14:06:17 +02:00
bergquist f2436fc7cd test(alerting): add tests for simple reducer 2016-08-10 13:52:15 +02:00
Torkel Ödegaard 4fd8b2ace4 Merge branch 'master' into alerting 2016-08-10 12:53:41 +02:00
Torkel Ödegaard a56cf9d6fd Merge branch 'v3.1.x' 2016-08-10 12:44:43 +02:00
Torkel Ödegaard 9a7e0eaf42 fix(dashboard): fixed drag and drop issue in chrome, fixes #5767 2016-08-10 12:43:36 +02:00
bergquist 03f0bc46a1 fix(metrics): make metrics cfg backwards compatible 2016-08-10 11:15:49 +02:00
Torkel Ödegaard c5d0c9f088 Merge branch 'v3.1.x' 2016-08-10 08:42:30 +02:00
Torkel Ödegaard c0301349fb docs(): update mac docs 2016-08-10 08:39:57 +02:00
Torkel Ödegaard 624e30e743 fix(docs): minor doc fixes, fixes #5751 2016-08-10 08:38:08 +02:00
Torkel Ödegaard d95545b5d3 feat(graph tooltip): refactoring PR #3063 2016-08-10 08:31:53 +02:00
Torkel Ödegaard 34804bda6d Merge branch 'issue-3063' of https://github.com/alexanderzobnin/grafana into alexanderzobnin-issue-3063 2016-08-10 08:08:57 +02:00
Torkel Ödegaard d49f0569f2 feat(metrics): minor fix for internal metrics fix PR #5758 2016-08-10 08:06:10 +02:00
Torkel Ödegaard 61756d2ae6 feat(alerting): removed delete button 2016-08-10 07:58:40 +02:00
bergquist de47710f1e tech(circle): rearrange build order 2016-08-09 14:28:44 +02:00
bergquist 5b57210aeb fix(metrics): replaces . with _ in instance name
closes #5739
2016-08-09 14:06:03 +02:00
bergquist d6fdb598b0 fix(alerting): gofmt 2016-08-08 14:46:47 +02:00
Alexander Zobnin f8f7543d4a Fix Elastic datasource tests - use moment.utc() instead moment() to prevent timezone-related issues, fixes #5733. (#5746) 2016-08-07 12:01:53 +02:00
bmundt 6d1dd95ab3 adds check for making datasource template variables children of other template variables (#5717) 2016-08-05 10:03:46 +02:00
hc4 4d40326706 Add refresh query parameter parsing (#5729) 2016-08-04 18:58:59 +02:00
Torkel Ödegaard 34ea7312bc docs(): added missing snapshot config options, fixes #5708 2016-08-02 09:35:15 +02:00
Torkel Ödegaard 01e5fd623b Update latest.json 2016-08-02 09:31:02 +02:00
Torkel Ödegaard e044a65d08 feat(alerting): updated 2016-08-01 22:15:28 +02:00
Alexander Zobnin 2c283ddd77 Fixed shared tooltip time calculation. Fixes #3063. 2016-08-01 20:41:15 +03:00
Torkel Ödegaard 1edd224168 feat(alerting): fixing failing unit tests 2016-08-01 14:34:58 +02:00
Torkel Ödegaard e6c4e47849 updated dependencies 2016-08-01 14:15:41 +02:00
Torkel Ödegaard 2bfccd77d4 docs(): updated release links 2016-08-01 12:47:55 +02:00
Torkel Ödegaard 84d7305d37 docs(): updated release links 2016-08-01 12:45:31 +02:00
Torkel Ödegaard fbad17d3a1 docs(): updated changelog 2016-08-01 12:27:03 +02:00
Torkel Ödegaard 317ffd1b68 Merge branch 'master' of github.com:grafana/grafana 2016-08-01 12:24:01 +02:00
Torkel Ödegaard 49abb205a0 Merge branch 'v3.1.x'
Conflicts:
	public/sass/_variables.light.scss
2016-08-01 12:23:36 +02:00
Torkel Ödegaard a4d27083d0 fix(tests): fixed unit test broken in recent dynamic dashboard fix 2016-08-01 12:20:16 +02:00
Torkel Ödegaard a9cf7cd4f0 fix(light theme): fixes issue with hidden queries in light theme, fixes #5697 2016-08-01 11:58:12 +02:00
Torkel Ödegaard 44d1393480 fix(templating): fixed issue with panel/row repeat when saving dashboard, fixes #5591 2016-08-01 10:50:33 +02:00
Torkel Ödegaard b46af0069e fix(footer): fixed link in footer, #5690 2016-08-01 10:09:43 +02:00
Torkel Ödegaard 357358898d feat(annotations): working on alert annotations, #5694 2016-08-01 10:07:00 +02:00
Torkel Ödegaard c5e90b1801 feat(alerting): more polish on alerting tab UI 2016-07-31 21:58:12 +02:00
Torkel Ödegaard 3b69c8f687 feat(alerting): new design for alert tab with sidemenu 2016-07-31 09:31:32 +02:00
Torkel Ödegaard 2b276d5cd1 feat(alerting): working on alert notification and image rendering 2016-07-30 13:36:21 +02:00
slqgsm e17b1548e8 Release there were some issues with the way removing columns was being implemented.
So I decided to scrap that, and go for just having a hidden column style. This is what
@madshall did in his enhanced table pull request, so this is basically the hidden
column style feature form his pull request.
2016-07-29 20:21:59 +00:00
slqgsm 93cb08d9d0 fixed typo and issue of not being able to add fields in table transformation 2016-07-29 16:30:38 +00:00
Torkel Ödegaard f9ddfb4337 Merge branch 'master' into alerting 2016-07-29 15:07:47 +02:00
Torkel Ödegaard 79138e211f Merge branch 'v3.1.x' 2016-07-29 15:07:17 +02:00
Torkel Ödegaard 741b7353c1 Merge branch 'v3.1.x' of github.com:grafana/grafana into v3.1.x 2016-07-29 15:06:09 +02:00
Torkel Ödegaard c4e7a3ae89 fix(png rendering): another fix for #5606 2016-07-29 15:04:51 +02:00
Torkel Ödegaard 4fc50742a0 feat(alerting): working on image rendering with alert notifications 2016-07-29 14:55:02 +02:00
slqgsm afb55fb3bd fixed to allow adding columns back in 2016-07-29 12:25:36 +00:00
Torkel Ödegaard f9a28d3306 feat(alerting): slack notification improvements, #5679 2016-07-29 13:41:42 +02:00
slqgsm e420bee2ab First commit for this branch, to allow removing of columns in table transformation 2016-07-28 21:44:07 +00:00
Torkel Ödegaard 01da3f6cb2 feat(alerting): worked on improving slack alerts 2016-07-28 17:03:53 +02:00
Torkel Ödegaard 717cce014b feat(alerting): refactoring 2016-07-27 17:07:44 +02:00
Torkel Ödegaard 6aaf4c97a2 feat(alerting): refactoring conditions out to seperate package 2016-07-27 16:18:10 +02:00
Torkel Ödegaard ae5f8a76d9 feat(alerting): lots of progress on notifications, refactored them out to their own package, restored webhook notitication and added slack notification 2016-07-27 12:09:55 +02:00
Torkel Ödegaard 77c66a88d9 Merge branch 'master' into alerting 2016-07-27 10:22:00 +02:00
Torkel Ödegaard c997923b17 Merge branch 'master' of github.com:grafana/grafana 2016-07-27 10:21:38 +02:00
Torkel Ödegaard e789d0df63 Merge branch 'v3.1.x' 2016-07-27 10:21:16 +02:00
Torkel Ödegaard 89dc3b88d1 fix(test): fixed failing test caused by recent change 2016-07-27 10:20:48 +02:00
Torkel Ödegaard c2eeb6dda0 fix(alerting): minor notification fix 2016-07-27 10:15:21 +02:00
Thib17 732c84c230 Enable scaling down seconds unit s > ms > µs > ns (#5642) 2016-07-27 10:10:01 +02:00
Torkel Ödegaard cde1bbff78 Merge branch 'alert_conditions' into alerting 2016-07-27 09:52:42 +02:00
Torkel Ödegaard c675ffc682 Merge branch 'master' into alerting 2016-07-27 09:45:16 +02:00
Mark Henderson 39be7cf7d7 Added grafana-cli command. Added public documentation for specifying plugin version when installing. (#5665) 2016-07-27 09:41:33 +02:00
Torkel Ödegaard e8e8463828 docs(): updated changelog 2016-07-27 09:39:46 +02:00
Torkel Ödegaard e4592c8d53 Merge branch 'v3.1.x' 2016-07-27 09:36:46 +02:00
Torkel Ödegaard 971e2d62f1 fix(zoom): fixed zoom in and out issues when graph is embedded, fixes #5666, fixes #4489 2016-07-27 09:36:35 +02:00
Leandro Piccilli 3057c9747c Change size on terms aggregation for ES 5.x 2016-07-26 22:05:49 +02:00
Torkel Ödegaard 5155c8a753 feat(templating): set default min span to 4, fixes #5662 2016-07-26 17:20:27 +02:00
Torkel Ödegaard 0b0f6b0848 feat(alerting): made very basic threshold viz work again 2016-07-26 14:35:42 +02:00
Torkel Ödegaard 0d9b98da6d feat(alerting): progress on email notifications 2016-07-26 12:29:52 +02:00
Torkel Ödegaard 6cb1dafb1d feat(alerting): progress on notifications 2016-07-25 16:26:28 +02:00
Torkel Ödegaard 8df558dece feat(notifications): refactoring notification handling 2016-07-25 13:52:17 +02:00
Torkel Ödegaard 9f14b209bd fix(html): moved body tag, fixes #5648 2016-07-25 12:21:51 +02:00
Torkel Ödegaard d4e2bb70e9 Merge branch 'v3.1.x'
Conflicts:
	package.json
2016-07-25 12:20:59 +02:00
Torkel Ödegaard 66a72e9ece changed version to 3.1.1 2016-07-25 12:20:21 +02:00
Torkel Ödegaard ee0d6ecfe6 Merge branch 'master' of github.com:grafana/grafana 2016-07-25 12:04:58 +02:00
Torkel Ödegaard def4d8f8dc docs(): updated changelog 2016-07-25 12:04:43 +02:00
Torkel Ödegaard 9fd7676846 Merge branch 'v3.1.x' 2016-07-25 12:03:40 +02:00
Torkel Ödegaard 0de0f4d014 feat(templating): fixed issue with template variables set to reload on dashboard load being issued multiple times, fixes #5637 2016-07-25 12:02:59 +02:00
bmundt f6b1d5a84a Added '!=' option for where clause in the influx query builder (#5646) 2016-07-25 10:36:38 +02:00
Torkel Ödegaard 9f777a535b fix(): removed dashboard version to schema version migration 2016-07-23 13:29:48 +02:00
Torkel Ödegaard 6d28365e84 docs(): updated changelog 2016-07-23 12:59:07 +02:00
Torkel Ödegaard 7a2e8324b9 Merge branch 'v3.1.x' 2016-07-23 12:54:23 +02:00
Torkel Ödegaard ddf579f204 fix(mixed data sources): fix when using two graphite data sources in mixed mode, fixes #5617 2016-07-23 12:54:11 +02:00
Torkel Ödegaard b943e41434 Merge branch 'master' of github.com:grafana/grafana 2016-07-23 12:01:48 +02:00
Torkel Ödegaard 4a33e2023f Merge branch 'v3.1.x' 2016-07-23 12:01:27 +02:00
Torkel Ödegaard 3abbf08a17 tech(): upgrade jquery to 2.2.4, closes #5627 2016-07-23 12:00:45 +02:00
Torkel Ödegaard 474a821767 fix(elasticsearch): fix json escape logic when doing terms template value lookup, fixes #5485 2016-07-23 11:52:49 +02:00
Torkel Ödegaard 14eba30f63 feat(alerting): more work on notifications 2016-07-23 11:50:48 +02:00
Peter Bonney 62e162c44c Update dashboard.md (#5640)
The key returned by `GET /api/dashboards/db/:slug` is "dashboard" (not "model").
2016-07-23 11:46:20 +02:00
Torkel Ödegaard a6c6094775 feat(alerting): started reworking notifications 2016-07-22 16:45:17 +02:00
Mitsuhiro Tanda 490ea18638 (cloudwatch) fix, don't block by white list (#5632) 2016-07-22 13:15:18 +02:00
Torkel Ödegaard 7eb2d2cf47 feat(alerting): working on state management 2016-07-22 13:14:09 +02:00
Torkel Ödegaard 783d697529 feat(alerting): more output when testing alert 2016-07-21 21:54:12 +02:00
Torkel Ödegaard b073fe0eba feat(alerting): more work on handling result and saving state 2016-07-21 17:31:46 +02:00
Torkel Ödegaard f0fc336e88 feat(alerting): worked on alert condition eval tests 2016-07-21 16:19:28 +02:00
Torkel Ödegaard 3ad38eefd2 feat(alerting): test results look better 2016-07-21 13:57:19 +02:00
Torkel Ödegaard f6a160b270 feat(alerting): testing alert is starting to work 2016-07-21 13:09:12 +02:00
Torkel Ödegaard 9e91aacd34 feat(alerting): progress on testing alerts 2016-07-21 10:29:11 +02:00
Leandro Piccilli df9ace8ac2 Change annotations query for ES 5.x 2016-07-21 00:42:36 +02:00
Torkel Ödegaard fb636344a6 feat(alerting): began work on testing alert rule from UI without having to save it 2016-07-20 16:13:36 +02:00
Torkel Ödegaard 0ce55600bb feat(alerting): progress on alerting backend 2016-07-20 14:28:02 +02:00
Torkel Ödegaard 3219d98a92 feat(alerting): starting work on condition evaluation 2016-07-20 09:30:31 +02:00
Torkel Ödegaard f872d5cfa3 feat(alerting): more refactoring work in backend code 2016-07-19 22:36:59 +02:00
Torkel Ödegaard 2a30baef05 feat(alerting): progress on updating extractor to work with new alert model 2016-07-19 21:00:41 +02:00
Torkel Ödegaard f60efed5d8 feat(alerting): progress on refactoring backend alert rule model 2016-07-19 17:45:37 +02:00
Torkel Ödegaard 20fcffb71e feat(alerting): working on alerting conditions model 2016-07-19 16:15:26 +02:00
Christos Trochalakis 824bf9f029 feat(graphite): added groupByNodes func def, closes #5612 2016-07-19 14:23:13 +03:00
Torkel Ödegaard f38c954639 feat(alerting): more work on alert conditions 2016-07-19 11:54:41 +02:00
Torkel Ödegaard 29d308e447 feat(alerting): refactoring alert model to use conditions concept 2016-07-19 11:24:27 +02:00
Torkel Ödegaard 0f555d6ab5 fix(alerting): minor fix 2016-07-19 09:28:49 +02:00
Torkel Ödegaard b0fe69822a Merge branch 'master' into alerting
Conflicts:
	public/app/core/services/alert_srv.ts
	public/app/partials/confirm_modal.html
2016-07-18 18:22:35 +02:00
Torkel Ödegaard 3f861dd039 Merge branch 'v3.1.x' 2016-07-18 16:27:27 +02:00
Torkel Ödegaard 3ae327320a fix(prometheus): fixed svg link in prometheus dashboard, fixes #5604 2016-07-18 16:27:02 +02:00
Torkel Ödegaard 78d0badffe Merge branch 'v3.1.x' of github.com:grafana/grafana into v3.1.x 2016-07-18 16:22:31 +02:00
Torkel Ödegaard 575b015fe0 fix(panel rendering): Fixed png panel rendering timing issue, #5606 2016-07-18 16:18:00 +02:00
Torkel Ödegaard b9a2546a10 fix(iframe): fixed issue with using full height of iframe, fixes #5605 2016-07-18 16:17:46 +02:00
Torkel Ödegaard 7ad0904fdb :Merge branch 'master' of github.com:grafana/grafana 2016-07-18 16:16:44 +02:00
Torkel Ödegaard b9c4107361 docs(): updated changelog 2016-07-18 16:16:35 +02:00
Torkel Ödegaard ffd865c7ca fix(panel rendering): Fixed png panel rendering timing issue, #5606 2016-07-18 16:13:50 +02:00
Torkel Ödegaard e507bb6dd7 fix(iframe): fixed issue with using full height of iframe, fixes #5605 2016-07-18 15:41:06 +02:00
Torkel Ödegaard 8f8ee28e64 docs(): updated changelog 2016-07-18 14:06:31 +02:00
Torkel Ödegaard 6c6dae1c92 Merge branch 'elasticsearch_precision_threshold' of https://github.com/lucasrodcosta/grafana into lucasrodcosta-elasticsearch_precision_threshold 2016-07-18 13:56:34 +02:00
Torkel Ödegaard c82d5f86ac fix(singlestat): fixed minor editor blur issue on decimal option that did not cause update of rendered value, fixes #5004 2016-07-18 11:24:41 +02:00
Leandro Piccilli 2a501d6cdb Merge branch 'master' of https://github.com/grafana/grafana 2016-07-18 10:34:11 +02:00
Loren West 51940fa209 Tooltip detatch too soon on mobile click (#5598)
* Tooltip detatch too soon on mobile click

* Fixed syntax error
2016-07-18 09:04:06 +02:00
Torkel Ödegaard f13b869aa4 feat(alerting): work on alerting 2016-07-14 13:32:16 +02:00
Jack Meagher 2c77f2231e Do not substitute #[A-Z] in graphite target when invalid ref (#5581)
* Do not substitute #[A-Z] in graphite target when invalid ref

In the case where #[A-Z] does not reference another query, such as #J when there
are only 2 queries, do not perform the substitution. This prevents the situation
target name without a query labelled J (10th query).

* Do not substitute #[A-Z] in graphite target when invalid ref

In the case where #[A-Z] does not reference another query, such as #J when there
are only 2 queries, do not perform the substitution. This prevents the situation
target name without a query labelled J (10th query).
2016-07-14 10:29:22 +02:00
Torkel Ödegaard 624cd6fc0a feat(alerting): cleanup, removed alert changes table and code 2016-07-13 11:58:55 +02:00
Torkel Ödegaard 82eebf64b6 fix(graph): Fix so that zoom works even when no data exists, fixes #5570 2016-07-13 10:02:53 +02:00
Torkel Ödegaard cc5c45112a Merge branch 'master' of github.com:grafana/grafana 2016-07-12 15:55:10 +02:00
Torkel Ödegaard 4bb4d7f7d3 Merge branch 'v3.1.x' 2016-07-12 15:54:31 +02:00
Torkel Ödegaard 383b313027 Update CHANGELOG.md 2016-07-12 15:17:04 +02:00
Torkel Ödegaard 0f9f903e09 Update latest.json 2016-07-12 15:16:46 +02:00
Torkel Ödegaard 6c2a61001a docs(): updated download links 2016-07-12 13:19:20 +02:00
Torkel Ödegaard d007363e7c bumbped version from beta1 to stable 2016-07-12 08:42:28 +02:00
Torkel Ödegaard b2acac3a41 feat(apps): more polish on app dashboard save warning, #5529 2016-07-12 08:41:56 +02:00
Torkel Ödegaard f3db2fa262 feat(plugins): hide link on small screens 2016-07-11 19:16:35 +02:00
Torkel Ödegaard 5b4fd8e9c8 Merge branch 'v3.1.x' of github.com:grafana/grafana into v3.1.x 2016-07-11 19:07:32 +02:00
Torkel Ödegaard 81af8f072c feat(links): updated links to grafana.net 2016-07-11 19:07:16 +02:00
Torkel Ödegaard d9096110f8 Merge branch 'master' into alerting
Conflicts:
	pkg/api/dashboard.go
	pkg/models/dashboards.go
	pkg/services/sqlstore/dashboard.go
2016-07-11 18:28:07 +02:00
Torkel Ödegaard 817f24e6fb Merge remote-tracking branch 'origin/development' 2016-07-11 15:24:24 +02:00
Bryan Irvine eafb0f3248 get rid of weird line breaks and use action (#4926)
* get rid of weird line breaks and use action

When using restarts/stops/starts you'd get weird output sometimes, Strange line breaks 'OK' status overlapping the next lines etc...
This fixes those moves OK to the right place and colorizes them correctly.

* added : for more uniformity

when doing a restart the output looked like:
Stopping Grafana Server ...                                [  OK  ]
Starting Grafana Server: ...                               [  OK  ]

The Stopping line did not have a colon. I added it just to make it look better.
2016-07-11 15:23:39 +02:00
stuart nelson eb35f8cb89 [prometheus] Use panelId and target.refId for requestId
Using these two values ties requests to a
particular query position within a panel, ensuring
that requests are canceled if:

- Duplicate requests with the same query are sent
- Requests from the same query position (but a
different query) are sent

The last point is important as it identifies
queries by a physical location in the dashboard
instead of with the query expression.  If a
different query from the same position in a panel
is sent, the previous request should be canceled.
2016-07-11 14:47:14 +02:00
Torkel Ödegaard 9055beff1a fix(table): fixed merge issue 2016-07-11 11:09:20 +02:00
Torkel Ödegaard e518f50248 docs(): updated changelog 2016-07-11 10:09:49 +02:00
Torkel Ödegaard 08202dcb83 Merge branch 'v3.1.x' 2016-07-11 09:39:17 +02:00
Torkel Ödegaard 65683ab241 feat(table): added sanitize html option to column styles for table panel, fixes #4596 2016-07-11 09:38:06 +02:00
Torkel Ödegaard 4c4cb20bde tech(sass): changed sass lint version to 1.7.0 2016-07-08 22:12:10 +02:00
Torkel Ödegaard 4133526d8d feat(build): updated sass lint 2016-07-08 21:04:58 +02:00
Alexander Akulov 010dbddf59 Fix double slashes in POST request to ES (#5536) 2016-07-08 18:24:08 +02:00
Torkel Ödegaard 12d455f3c3 Merge branch 'v3.1.x' of github.com:grafana/grafana into v3.1.x 2016-07-08 18:23:15 +02:00
Torkel Ödegaard 615b692442 feat(apps): fixed unit tests 2016-07-08 18:21:25 +02:00
Torkel Ödegaard ebdf0564eb feat(apps): plugin dashboard sync is starting to work 2016-07-08 17:44:57 +02:00
Torkel Ödegaard 68a8d9bc91 feat(apps): more work on plugin dashboard sync 2016-07-08 13:41:46 +02:00
Torkel Ödegaard 85be7dd902 feat(apps): progress on app dashboard sync 2016-07-08 12:26:51 +02:00
Torkel Ödegaard d44325affd feat(apps): progress on app dashboard imports 2016-07-08 09:35:06 +02:00
Fraser Savage 5a8efa9a52 Update configuration.md (#5527)
Insert missing backtick.
2016-07-08 07:12:26 +02:00
Torkel Ödegaard b62f1f00cd feat(apps): auto update dashboard dashboards, #5529 2016-07-07 18:11:03 +02:00
Torkel Ödegaard 3f83bf6e47 Merge branch 'v3.1.x' 2016-07-07 14:48:41 +02:00
Torkel Ödegaard 4545b4d323 fix(login): minor fix redirect on login change 2016-07-07 14:48:22 +02:00
bmundt e58ccc5a83 Hex units (#5530)
* added hex units

* deleted blank line, to fix style error

* added unit tests

* updated unit tests and changed the way it handles negative hex0x
2016-07-07 08:54:51 +02:00
Leandro Piccilli 0ebf469f5f Merge branch 'master' of https://github.com/grafana/grafana 2016-07-07 00:58:26 +02:00
Torkel Ödegaard 60abe75615 Merge branch 'v3.1.x' 2016-07-06 10:10:25 +02:00
Torkel Ödegaard d74eb8c188 fix(login): fixed so that you get redirect back to the page or dashboard you where on when you clicked on sign in link, fixes #3312 2016-07-06 10:09:53 +02:00
Torkel Ödegaard 89c3880a59 Merge branch 'master' of github.com:grafana/grafana 2016-07-06 08:26:24 +02:00
Torkel Ödegaard 7c7e26bc18 feat(templating): refactoring template variable handling for variables that change on time refresh, closes #5021 2016-07-06 08:25:46 +02:00
Torkel Ödegaard 069100099d Merge branch 'reflect_panel_repeat_when_time_range_changed' of https://github.com/mtanda/grafana 2016-07-06 07:40:51 +02:00
Adrián López 65aa6df45c Warn user if there are no mappings (#5246) 2016-07-06 07:31:42 +02:00
Torkel Ödegaard aad76d9220 Merge branch 'master' of github.com:grafana/grafana 2016-07-06 07:23:20 +02:00
Torkel Ödegaard 9088023116 fix(error handling): improved dashboard init error handling and notifications 2016-07-06 07:23:09 +02:00
Torkel Ödegaard ad1d7f0ffb Update package.json 2016-07-06 07:22:29 +02:00
Torkel Ödegaard 41bffd503d Update CHANGELOG.md 2016-07-06 07:22:03 +02:00
Torkel Ödegaard b4493155fc fix(error handling): improved dashboard init error handling and notifications 2016-07-06 07:18:58 +02:00
Torkel Ödegaard c1b7bd0f1b Merge branch 'notify_migration_error' of https://github.com/mtanda/grafana 2016-07-06 06:34:17 +02:00
Torkel Ödegaard 6a8c774dcc fix(graph): show graph panel render errors as panel errors, fixes #5414 2016-07-06 06:31:32 +02:00
Torkel Ödegaard 435aa88c05 Merge branch 'issue_5372' of https://github.com/kipe/grafana into kipe-issue_5372 2016-07-06 06:05:50 +02:00
Torkel Ödegaard 782427b5f2 Update latest.json 2016-07-06 05:28:49 +02:00
herver 9c73b2fa1c Support data units for both IEC (Binary) and Metric (Decimal) variants (#5473) 2016-07-06 05:27:35 +02:00
Torkel Ödegaard 53f110c942 Merge branch 'master' of github.com:grafana/grafana 2016-07-05 18:02:23 +02:00
Torkel Ödegaard fd5f7c2e34 fix(): updated changelog 2016-07-05 18:02:10 +02:00
Torkel Ödegaard 5595fc2683 refactor(): refactored date handling and locale handling in #5517 2016-07-05 17:59:43 +02:00
Torkel Ödegaard f31960d325 Update latest.json 2016-07-05 16:39:36 +02:00
Torkel Ödegaard c029e47a12 Merge branch 'moment-locale' of https://github.com/gofore/grafana into gofore-moment-locale 2016-07-05 16:22:33 +02:00
Joona Romppanen 438a73c58a Added moment.js locales. Set locale from window.navigator at app init(). Use firstDayOfWeek on time picker 2016-07-05 17:08:44 +03:00
Torkel Ödegaard 460820a117 conf(): updated sample config and root_url to better explain it 2016-07-05 14:10:23 +02:00
Carl Bergquist 9312a13e6e Merge pull request #5496 from joemiller/doc-update
grammar fix in docs
2016-07-03 09:44:00 -07:00
Torkel Ödegaard 8bd6b953b8 fix(elasticsearch): fix json escape logic when doing terms template value lookup, fixes #5485 2016-07-02 12:01:04 -04:00
joe miller a6554a85c0 grammar fix in docs 2016-07-02 08:27:31 -07:00
Carl Bergquist c047dacf18 Merge pull request #5442 from mtanda/snapshot_orig_url
(snapshot) save original url
2016-07-01 13:09:34 -07:00
Mitsuhiro Tanda 630d0d0793 (snapshot) add open original dashboard button 2016-07-02 02:26:27 +09:00
Kimmo Huoman 522a3408e9 Export CSV in the same format as presented in Table panel. Fixes issue #5372.
The data is exported in the same exact format as presented in the table panel.
This is achieved by using the same renderer as the UI uses.
2016-07-01 20:21:53 +03:00
Mitsuhiro Tanda cc519adcfc (snapshot) restrict saving original url for local snapshot 2016-07-02 02:16:23 +09:00
Mitsuhiro Tanda 7aaa15ad95 (snapshot) save original url 2016-07-02 02:16:23 +09:00
bergquist 07e522bb64 Merge branch 'influxdb_stop_hidden_queries' 2016-07-01 02:09:40 +02:00
bergquist 22ba51a631 Merge branch 'master' into influxdb_stop_hidden_queries 2016-07-01 02:09:10 +02:00
bergquist b47a307106 Merge branch 'master' into influxdb_stop_hidden_queries 2016-07-01 02:06:19 +02:00
Andris Raugulis 1c293781e3 Log to default log directory, only if custom configuration failed. (#5393) 2016-06-30 16:37:06 -07:00
Kevin Fitzpatrick f2baa5b210 Make Generic OAuth Configs ENV VARS-friendly
Use underscores instead of dashes.
2016-06-30 15:07:55 -07:00
Kevin Fitzpatrick b4646b6c3a Allow users to use a generic oauth that conforms to the github style.
Enables users to set their own link text.
2016-06-30 15:07:55 -07:00
Carl Bergquist 603e5fe0bf Merge pull request #5469 from stuartnelson3/create-unique-prometheus-req-id
[prometheus] Use `panelId` and `target.refId` for requestId
2016-06-30 13:13:01 -07:00
stuart nelson 0590c51524 [prometheus] Use panelId and target.refId for requestId
Using these two values ties requests to a
particular query position within a panel, ensuring
that requests are canceled if:

- Duplicate requests with the same query are sent
- Requests from the same query position (but a
different query) are sent

The last point is important as it identifies
queries by a physical location in the dashboard
instead of with the query expression.  If a
different query from the same position in a panel
is sent, the previous request should be canceled.
2016-06-30 11:29:02 +02:00
Nozomi Anzai bdf68b2183 Fix wrong overwrite of commit:711992c8e2e811abd450cb665008bb0a1b3e29a9 2016-06-30 10:48:39 +09:00
Torkel Ödegaard 5676a35d9a fix(css): added responsive media query for phones that fix header wrap 2016-06-29 14:35:58 -07:00
Torkel Ödegaard ae8fabdad3 fix(modal): fixed duplicate confirm modal issue 2016-06-29 14:26:21 -07:00
Carl Bergquist b289497db6 Merge pull request #5455 from rakotomandimby/patch-1
Update debian.md to Debian Jessie
2016-06-29 12:35:32 -07:00
Carl Bergquist fe7438c7ff Merge pull request #5461 from mtanda/pr_cloudwatch_add_metrics
(cloudwatch) add metrics
2016-06-29 12:08:44 -07:00
Carl Bergquist 7b84c4b4dc Merge pull request #5465 from tmc/patch-1
properly quote font-family on singlestat
2016-06-29 12:07:53 -07:00
Travis Cline bca6101609 properly quote font-family on singlestat 2016-06-29 11:03:07 -07:00
Soulou aa064b18e8 Test environment override for secret and url with credentials 2016-06-29 13:49:41 +02:00
Mitsuhiro Tanda 9ca5ba96be reorder metrics/dimensions 2016-06-29 14:11:01 +09:00
Mitsuhiro Tanda 511f8d3213 add cloudwatch metrics and dimensions 2016-06-29 13:55:16 +09:00
bergquist 4fc16c36ed feat(alerting): saves new state when alert updates 2016-06-29 00:05:48 +02:00
Torkel Ödegaard 5a65dc5d23 Merge branch 'alerting' of github.com:grafana/grafana into alerting 2016-06-28 14:04:38 -07:00
Torkel Ödegaard 9b4c0cca07 fix(flot): fixed flot issue introduced in alerting branch 2016-06-28 14:04:29 -07:00
Carl Bergquist 3460c12491 Merge pull request #5454 from Scalingo/node_version_package_json
Fix node version in package.json
2016-06-28 14:26:30 -04:00
Soulou e2c5fac9df Predefine url to let the environment variable overrider do its job 2016-06-28 17:45:55 +02:00
Soulou 03d0f11407 Accept URL parameter [database] config 2016-06-28 15:31:34 +02:00
Rakotomandimby Mihamina 16e2c660ac Update debian.md 2016-06-28 15:58:00 +03:00
Soulou 122b0d20a9 Fix node version in package.json
Value was incoherent since
https://github.com/grafana/grafana/commit/1900c81d9f9507ed4dbd18e95569480dfd0922f7
2016-06-28 14:36:15 +02:00
Othyus f3a6848710 feat(sidemenu): add style(margin and witdh) for the input and label filter 2016-06-28 08:30:36 +02:00
Othyus 31317abbeb feat(sidemenu): add limit for shown organizations 2016-06-28 08:11:37 +02:00
bergquist 6bf42dde18 tech(alerting): remove some logging 2016-06-27 01:27:30 +02:00
Mitsuhiro Tanda 8af3bb739c refactor 2016-06-26 22:39:34 +09:00
bergquist 4ed6b99d9a Merge branch 'alerting_notifications' into alerting 2016-06-26 04:05:56 +02:00
bergquist af216ecf83 tech(cli): remove loop and head straight for plugindir 2016-06-26 03:47:15 +02:00
bergquist 07be2c89a3 tech(cli): lets use the fact that we have a compiler 2016-06-26 03:47:15 +02:00
bergquist 88e208bddf feat(gf-form): add support for small input fields 2016-06-25 23:30:51 +02:00
Carl Bergquist 92835f0a04 Merge pull request #5434 from saboorian/master
Escape html chararcters in singlestat renderer
2016-06-25 20:49:16 +02:00
bergquist aecd487775 Merge branch 'f1yegor-master' 2016-06-25 20:42:38 +02:00
bergquist 241b9ee329 fix(kbn): add calculator for opn,rpm and wpm 2016-06-25 20:42:24 +02:00
bergquist 4cbde7e747 Merge branch 'master' of https://github.com/f1yegor/grafana into f1yegor-master 2016-06-25 20:38:43 +02:00
bergquist 12570bb959 feat(singlestat): add serie name as an value option
closes #4740
2016-06-25 20:17:23 +02:00
bergquist 8b8bfa8a17 fix(singlestat): rename seriename scoped var 2016-06-25 20:17:05 +02:00
Torkel Ödegaard b31fccb889 Merge branch 'master' of github.com:grafana/grafana 2016-06-25 17:53:42 +02:00
Carl Bergquist ab104bcfd7 Merge pull request #5401 from alexanderzobnin/issue-4740
Issue #4740 - able to use $SeriesName variable in prefix of postfix.
2016-06-25 17:49:44 +02:00
Torkel Ödegaard 35f135f6c2 Merge branch 'master' of github.com:grafana/grafana 2016-06-25 17:46:07 +02:00
Torkel Ödegaard 6dad6241ed docs(): updated changelog 2016-06-25 17:45:39 +02:00
Carl Bergquist 2d4cb50490 Merge pull request #5394 from hailthemelody/master
fix z-index order in Series Overrides
2016-06-25 17:43:47 +02:00
Torkel Ödegaard 0d6222c803 Merge branch 'master' of github.com:grafana/grafana 2016-06-25 17:43:22 +02:00
Torkel Ödegaard b275fa8109 fix(alerts): fixed login and other alert popups not showing, fixes #5435 2016-06-25 17:42:08 +02:00
Carl Bergquist c223994155 Merge pull request #5411 from mtanda/pr_dynamodb_add_metrics
add cloudwatch metrics
2016-06-25 17:36:50 +02:00
bergquist ff15a90e6d fix(login): fixes broken validation for login 2016-06-25 17:34:47 +02:00
bergquist 638a8a1528 docs(changelog): add note about closing #4674
closes #4674
2016-06-25 16:37:28 +02:00
bergquist 16fa631ea0 tech(tests): remove unused code that breaks gorename 2016-06-25 16:34:42 +02:00
bergquist c2689b0c2b Merge branch 'kfitzpatrick-recreate-4675' 2016-06-25 16:31:11 +02:00
bergquist 690a74c6b7 feat(login): invert naming for dissallow user pass login 2016-06-25 16:30:41 +02:00
Torkel Ödegaard 346ca3fc89 Merge branch 'master' into alerting 2016-06-25 09:56:57 -04:00
bergquist 092b6517dc Merge branch 'recreate-4675' of https://github.com/kfitzpatrick/grafana into kfitzpatrick-recreate-4675 2016-06-25 15:53:42 +02:00
Mohammad Mehdi Saboorian 1e486398cc Escape html chararcters in singlestat renderer 2016-06-25 13:43:58 +04:30
Torkel Ödegaard 23345c563c changed version in master to 3.2-pre 2016-06-24 16:51:55 +02:00
Torkel Ödegaard 60f45c965c Merge branch 'master' of github.com:grafana/grafana 2016-06-24 10:25:44 +02:00
Mitsuhiro Tanda 6ef27a87e4 fix catch clause 2016-06-24 13:44:10 +09:00
Kevin Fitzpatrick 040586604b Allow configuration to disable the username and password login interface.
Used for when admins only want users to login via OAuth.
2016-06-23 10:09:13 -07:00
Alexander Zobnin e593cc3e9f Issue #4740 - change variable $SeriesName to $seriesName. 2016-06-23 19:35:50 +03:00
Torkel Ödegaard efad4bcb56 docs(): updated changelog 2016-06-23 17:45:29 +02:00
Torkel Ödegaard 9435e70b37 docs(): spelling fix 2016-06-23 17:31:22 +02:00
bergquist 48e1a17ac2 feat(alerting): remove dummie values from email notifier 2016-06-23 16:30:12 +02:00
bergquist 6121d15ba7 feat(alerting): more aggressive requirements for parsing alertrules 2016-06-23 16:08:18 +02:00
bergquist 8b05af2f90 feat(alerting): add exeuction time to alertResult 2016-06-23 15:52:45 +02:00
bergquist 2063fee4fe docs(changelog): add note about cli fix #5410 2016-06-23 15:16:26 +02:00
Torkel Ödegaard c3e1955792 docs(): updated export docs 2016-06-23 13:21:30 +02:00
bergquist 6af2d99862 style(light-theme): make text-color-weak a little bit darker
otherwise its not possible to see which queries are disabled
in the query editor
2016-06-23 13:17:53 +02:00
Emmanuel Quentin 6487814007 Avoid to request influxdb when query is hidden 2016-06-23 13:11:16 +02:00
bergquist f95be63c43 feat(alerting): move response handling to seperate file 2016-06-23 12:57:10 +02:00
bergquist 67197d54f9 feat(alerting): add triggeredAlerts as json to alert_state 2016-06-23 11:14:40 +02:00
bergquist 488b42377b feat(alerting): update state if not been updated for 15min 2016-06-23 11:03:27 +02:00
Torkel Ödegaard 838284c09f docs(): updated changelog 2016-06-23 10:38:11 +02:00
Torkel Ödegaard 1d35b90484 docs(): updated download links 2016-06-23 10:35:47 +02:00
Mitsuhiro Tanda 44b2a292eb notify dashboard migration fail 2016-06-23 16:56:18 +09:00
Torkel Ödegaard f3c1a894de changed version to 3.1-beta1 2016-06-23 09:12:17 +02:00
bergquist eb54fbaef5 docs(changelog): add note about cli fix #5410 2016-06-23 08:41:25 +02:00
bergquist af1c8dc5d9 feat(cli): adds support for dist/plugin.json location for plugins
ref #5410
2016-06-23 08:35:40 +02:00
bergquist 2123fbdf9b feat(cli): make remove command an alias for uninstall 2016-06-23 08:21:55 +02:00
Mitsuhiro Tanda 16dc095329 (templating) support asc/desc sort 2016-06-23 11:26:41 +09:00
Mitsuhiro Tanda 8987cfe0a2 (templating) add sort order option 2016-06-23 11:26:41 +09:00
Mitsuhiro Tanda 09f7222e79 add cloudwatch metrics 2016-06-23 11:24:21 +09:00
bergquist 14169c5092 tech(docker): add memcached exporter target for prom 2016-06-22 17:36:22 +02:00
bergquist 925806df87 tech(alerting): add recovery logging 2016-06-22 13:43:11 +02:00
Othyus e204c308bf feat(sidemenu): filtering organizations by an input, issue #2609 2016-06-22 13:04:38 +02:00
Torkel Ödegaard 0555525f97 tech(): updated list of docker stuff 2016-06-22 11:01:11 +02:00
bergquist 7952723b71 feat(alerting): add warn/crit filter 2016-06-22 08:09:45 +02:00
bergquist b5a29b6246 test(alerting): add tests for when to send notifcations 2016-06-22 07:58:30 +02:00
bergquist 6edae37ac9 feat(alerting): rename state response method 2016-06-22 07:23:31 +02:00
Torkel Ödegaard 24a54cd95b feat(units): refactoring #5404 2016-06-21 21:08:07 +02:00
Torkel Ödegaard a7a5f36b49 Merge branch 'issue-2971' of https://github.com/alexanderzobnin/grafana into alexanderzobnin-issue-2971 2016-06-21 21:00:00 +02:00
Alexander Zobnin ab0155c861 Issue #2971 - add time units for use in singlestat panel. 2016-06-21 20:56:34 +03:00
Torkel Ödegaard 53c424caf8 docs(): title change 2016-06-21 18:25:24 +02:00
Torkel Ödegaard 23cfbac4ec feat(docs): updated import / export docs 2016-06-21 18:24:25 +02:00
Torkel Ödegaard f23d72001d fix(dashboard): fixed issue triggering refresh after leaving fullscreen/edit mode with time range change 2016-06-21 17:21:45 +02:00
Torkel Ödegaard 302ad5f1f9 Merge branch 'master' of github.com:grafana/grafana 2016-06-21 17:08:16 +02:00
Torkel Ödegaard 257e6c469e feat(collectd): updated collectd config 2016-06-21 17:07:01 +02:00
bergquist ef9766eb96 docs(3.1): initial post about whats new in 3.1 2016-06-21 16:29:17 +02:00
Alexander Zobnin cc433c1fbd Issue #4740 - able to use $SeriesName variable in prefix of postfix. 2016-06-21 15:48:18 +03:00
bergquist aa9e524e73 tech(docker): add node exporter to prometheus 2016-06-21 11:46:08 +02:00
Carl Bergquist 3b1ae3f7d2 Merge pull request #5396 from hailthemelody/fix_issue_template_typos
fix typos in GitHub Issue Template
2016-06-21 10:27:41 +02:00
hailthemelody cccfe47bf0 fix typos in GitHub Issue Template 2016-06-20 21:39:11 -04:00
hailthemelody 13d1fec2cb fix z-index order in Series Overrides 2016-06-20 20:54:01 -04:00
Carl Bergquist 87ab97b5ed Merge pull request #5391 from wkruse/prometheus-annotations-doc
Add Prometheus annotations doc
2016-06-20 18:49:00 +02:00
Wadim Kruse 3b47b1ecbd Add Prometheus annotations doc 2016-06-20 18:36:05 +02:00
bergquist 403fdebca3 docs(alerting): rewrite alert docs 2016-06-20 17:05:16 +02:00
bergquist 5d62c84a19 feat(alerting): adds default checkbox to ui 2016-06-20 16:19:15 +02:00
bergquist f5297db8f3 tech(alerting): remove console log that spams tests 2016-06-20 15:30:00 +02:00
bergquist fa309ec925 feat(alerting): add default notification group 2016-06-20 15:24:48 +02:00
bergquist 0a85efbf18 feat(alerting): add datasource type to settings 2016-06-20 11:44:06 +02:00
bergquist a18506e2e4 feat(alerting): changing notifications should require org admin 2016-06-20 11:32:55 +02:00
bergquist 0c5da9155f feat(alerting): only expose DTO info when requesting all notifications 2016-06-20 11:31:20 +02:00
bergquist 12706fd6db Revert "docs(changelog): add note about singlestat to datetime func"
This reverts commit 8efa94e42a.
2016-06-20 11:04:01 +02:00
Carl Bergquist d8be2f1ecc Merge pull request #5389 from grafana/revert-5383-issue-4747
Revert "issue #4747 - add date and time units to singlestat panel."
2016-06-20 11:02:43 +02:00
Carl Bergquist b6f9d9feb0 Revert "issue #4747 - add date and time units to singlestat panel." 2016-06-20 11:02:29 +02:00
bergquist 8efa94e42a docs(changelog): add note about singlestat to datetime func 2016-06-20 10:59:47 +02:00
Carl Bergquist b94527f661 Merge pull request #5383 from alexanderzobnin/issue-4747
issue #4747 - add date and time units to singlestat panel.
2016-06-20 10:57:08 +02:00
bergquist 96e5ad3f5c Merge branch 'alerting' into alerting_notifications 2016-06-20 10:45:05 +02:00
bergquist dd8c3d0355 Merge branch 'master' into alerting 2016-06-20 10:44:48 +02:00
bergquist 3adee1eda0 tech(sass): sasslint fixes for css3
Pseudo-elements must start with double colons pseudo-element
2016-06-20 10:37:47 +02:00
bergquist 7c09a140c7 test(alerting): fixes broken tests for alerting thresholds 2016-06-20 10:06:18 +02:00
bergquist 4c4164bb40 test(alerting): adds test email creater 2016-06-20 07:49:08 +02:00
Leandro Piccilli 2205ce5354 Add some tests for ES 5.x 2016-06-20 00:40:16 +02:00
Alexander Zobnin 398e9f5195 issue #4747 - add date and time units to singlestat panel. 2016-06-17 22:51:08 +03:00
bergquist adea539b8d feat(alerting): add link to panel png 2016-06-17 16:43:14 +02:00
bergquist ea4b14ac22 feat(alerting): rename critical -> crit 2016-06-17 16:40:48 +02:00
bergquist 212fd27252 feat(alerting): add support for email notifications 2016-06-17 15:30:17 +02:00
bergquist 774add94c1 feat(alerting): skip warn check if crit is triggered 2016-06-17 15:24:17 +02:00
Torkel Ödegaard 90c063060a fix(png): fixed phantomjs rendering issue with graph and y-axis label rotation, fixes #5220 2016-06-17 14:36:10 +02:00
Torkel Ödegaard 3bcda9268a feat(styleguide): removed unused/empty tabs 2016-06-17 14:18:24 +02:00
Torkel Ödegaard e2b398a6bf Merge branch 'master' of github.com:grafana/grafana 2016-06-17 14:16:25 +02:00
Torkel Ödegaard fa10fc994a fix(graph): remove panel width cache, causing issues, does not handle window resize and fullscreen to dashboard, #5297 2016-06-17 14:16:01 +02:00
Drew Farris cb2b8dea96 OpenTSDB: consistent options for http requests (#5233)
* OpenTSDB: consistent options for http requests

 . the get function wasn't using the same request options wrt to credentials/auth as
   the timeseries http request

* OpenTSDB: `_get` `_performTimeSeriesQuery` refactor copied code
2016-06-17 14:04:40 +02:00
Torkel Ödegaard 9bcd5de8ff fix(share): fixed PNG render link generated from share modal when opened from edit mode, fixes #5295 2016-06-17 14:03:59 +02:00
Torkel Ödegaard 9f9fca1e76 feat(datasource): added suggest urls for each data source, #4577 2016-06-17 13:35:29 +02:00
Alexander Zobnin fdf46c6a10 Issue 4577 (#5379)
* Add default-url property for datasource-http-settings directive.
This will allow to set default url for datasource.

* Fixed spelling.

* Use typeahead for url suggestion.
2016-06-17 13:18:00 +02:00
Torkel Ödegaard 305a6ae110 feat(dashboards): dashboard sharing fixes 2016-06-17 11:36:35 +02:00
Torkel Ödegaard 10daf1d63a Revert "Enable the "limit" param in /api/search"
This reverts commit 3d77685108.
2016-06-17 11:22:39 +02:00
bergquist 90e3d8afda Merge branch 'alerting' into alerting_notifications 2016-06-17 09:55:58 +02:00
bergquist c96108226c fix(alerting): use alert frequency 2016-06-17 09:55:42 +02:00
bergquist 764c58ba8d Merge branch 'alerting' into alerting_notifications 2016-06-17 09:54:38 +02:00
bergquist 9481fcb830 fix(alerting): use alert frequency 2016-06-17 09:54:11 +02:00
Torkel Ödegaard 23aa614baf feat(rendering): fixed issue with png rendering, recently introduced by profiler refactoring 2016-06-17 08:49:11 +02:00
bergquist ebada26b85 Merge branch 'alerting' into alerting_notifications 2016-06-17 08:27:58 +02:00
bergquist e8a324c7f5 feat(alerting): add frequency back to alert model 2016-06-17 08:27:38 +02:00
Torkel Ödegaard 5c35fac8fe fix(dataproxy): removed accidental debug code 2016-06-17 08:11:37 +02:00
bergquist 946dc0ecf3 Merge branch 'alerting' into alerting_notifications 2016-06-17 07:44:39 +02:00
bergquist 1771ab032e Merge branch 'master' into alerting 2016-06-17 07:44:21 +02:00
bergquist 8b2f6fffc9 test(dashboards): comment code in broken tests 2016-06-17 07:43:57 +02:00
Torkel Ödegaard 32479503bd fix(build): another windows build issue 2016-06-16 21:10:30 +02:00
Torkel Ödegaard b06ec734f1 fix(build): windows, another windows build fix, #5370 2016-06-16 18:21:12 +02:00
bergquist b035074613 tech(alerting): disable update state api 2016-06-16 17:02:45 +02:00
bergquist a0418da160 Merge branch 'alerting' into alerting_notifications 2016-06-16 16:49:16 +02:00
bergquist 8ec311ade4 Merge branch 'master' into alerting 2016-06-16 16:29:41 +02:00
bergquist 3c4d2b8ca1 feat(alerting): add basic body for webhooks 2016-06-16 16:25:23 +02:00
bergquist 6705efef6f feat(alerting): make some settings properties required 2016-06-16 16:18:40 +02:00
bergquist f3009dc23b fix(alerting): broken link 2016-06-16 16:06:40 +02:00
bergquist b907ce341c feat(alerting): enables deletes for alert notifications 2016-06-16 15:21:44 +02:00
bergquist 149c2ae913 feat(alerting): add submenu for alerting 2016-06-16 15:21:23 +02:00
Torkel Ödegaard b039a81375 feat(build): fixing windows build issue, #5370 2016-06-16 14:36:19 +02:00
bergquist 7f767224af feat(alerting): basic support for creating and updating notifications 2016-06-16 14:29:20 +02:00
Joel Smith 46fe9a167e Update file_export.ts (#5325)
Prepended first line to export file containing
`sep=;\n`
which I believe should be all that is required for Excel to interpret the CSV file as semicolon delimited.
2016-06-16 14:27:00 +02:00
Torkel Ödegaard 79eb971fad docs(): updated changelog 2016-06-16 10:49:40 +02:00
Torkel Ödegaard 81e9aa4de4 feat(datasource): cancel in flight data source requests, refeatoring #5321 2016-06-16 10:48:26 +02:00
bergquist c51facfaef style(alerting): move filter below HR 2016-06-16 09:23:53 +02:00
bergquist 00fc2e2593 test(alerting): fixes broken unittest 2016-06-16 09:09:09 +02:00
Torkel Ödegaard 6d3521c240 Merge branch 'cancel-in-flight-repeats' of https://github.com/stuartnelson3/grafana into stuartnelson3-cancel-in-flight-repeats 2016-06-16 08:57:31 +02:00
bergquist 72e23bca5f tech(alerting): improve/cleanup logging 2016-06-16 08:56:19 +02:00
Torkel Ödegaard 23e0240410 fix(build): removed logging call that caused wrong dependency to be used 2016-06-16 08:55:36 +02:00
bergquist 4d03e04172 feat(alerting): enable email notifiter 2016-06-16 08:29:49 +02:00
Torkel Ödegaard 1ae24b366f feat(profiler): fixed issues with frontend perf profiler 2016-06-16 08:28:50 +02:00
bergquist 2e809cae05 tech(alerting): enforce POST for webhooks 2016-06-16 08:16:16 +02:00
bergquist efea3bc9cb feat(alerting): skeleton commit for webhook 2016-06-16 08:16:16 +02:00
bergquist a3b7ea7704 feat(alerting): skeleton for alert notification configuration page 2016-06-16 08:16:16 +02:00
bergquist 4c5d2d6079 style(alerting): remove unused code 2016-06-16 08:16:16 +02:00
bergquist b9b65cf2d4 tech(alerting): add logging about failed notifications 2016-06-16 08:16:16 +02:00
bergquist 9a8416416d feat(alerting): converter for db model to notification 2016-06-16 08:16:16 +02:00
bergquist 6eca26e8ec style(alerting): improve formating 2016-06-16 08:16:16 +02:00
bergquist dbf3795aaf feat(alerting): add sql layer for alert notifications 2016-06-16 08:16:16 +02:00
bergquist 8b91e57ef6 feat(alerting): notification query 2016-06-16 08:16:16 +02:00
Torkel Ödegaard 2ceb58d0c4 feat(elasticsearch): removed dashboard import migration 2016-06-16 08:11:40 +02:00
Torkel Ödegaard e1f63a3346 docs(): updated changelog 2016-06-16 08:10:15 +02:00
Torkel Ödegaard ec0b09450c Merge branch 'export-dashboard'
Conflicts:
	conf/defaults.ini
	pkg/setting/setting.go
	public/app/core/components/grafana_app.ts
	public/app/core/core.ts
	public/app/features/dashboard/dashboardCtrl.js
2016-06-16 08:06:43 +02:00
Torkel Ödegaard 4b78ab5bcd feat(graph): graph tooltip sort order PR refactored/changed #4944, changed the layout graph display options, #4944 2016-06-15 17:20:55 +02:00
Torkel Ödegaard ae554a736b change(graphite): removed graphite png option in graph panel, closes #5367 2016-06-15 14:20:44 +02:00
bergquist 779ea55ee0 style(alerting): rename executor -> handler 2016-06-15 11:49:20 +02:00
bergquist 777ca4cd7d style(alerting): rename level.level to level.value 2016-06-15 11:39:25 +02:00
Torkel Ödegaard a893152141 feat(alerting): thesholds unification 2016-06-15 10:41:21 +02:00
Torkel Ödegaard f03e8292a2 feat(alerting): progress on threshold unification 2016-06-14 17:00:51 +02:00
Torkel Ödegaard ed7a539ddb feat(alerting): thresholds rethink 2016-06-14 16:45:51 +02:00
Carl Bergquist f842e28b85 Merge pull request #5343 from utkarshcmu/opentsdb-template
Implemented nested template variables functionality for Opentsdb
2016-06-14 07:43:41 +02:00
utkarshcmu 33aa3f0fc5 Made tag_values query more robust 2016-06-13 14:21:46 -07:00
Torkel Ödegaard dac8b35a1a feat(alerting): renamed scheduler to handler 2016-06-13 15:58:22 +02:00
bergquist 7f22b9eb6e tech(alerting): expression -> settings 2016-06-13 15:18:19 +02:00
bergquist bb6888885e fix(alerting): makes valid to save more explicit 2016-06-13 15:01:07 +02:00
bergquist 0d60b042c8 style(alerting): revemo commented code 2016-06-13 14:57:24 +02:00
bergquist ca33622698 style(alerting): rename max retries 2016-06-13 14:54:06 +02:00
bergquist 3ad90c389c style(alerting): improve naming 2016-06-13 14:01:57 +02:00
utkarshcmu e4e042e389 CHANGELOG entry 2016-06-13 04:53:21 -07:00
bergquist 04436c8a52 test(alerting): make sure the worst state is captured 2016-06-13 13:45:26 +02:00
utkarshcmu f3003a97ef Added required documentation 2016-06-13 04:34:23 -07:00
utkarshcmu 6550bc97ba Added unit tests 2016-06-13 04:24:27 -07:00
utkarshcmu 862de3a9dc Added templated dependency in Opentsdb 2016-06-13 03:59:12 -07:00
bergquist 6cb4bdd6cb feat(alerting): adds a result list to alertresult
Since one query can return multiple series we might be
interested in getting the result for each serie
2016-06-13 11:44:47 +02:00
Nozomi Anzai 6586cc4029 Add the datasource of RDBMS (PostgreSQL and MySQL) 2016-06-13 18:24:18 +09:00
bergquist a77824939f chore(alerting): remove alerting model.json 2016-06-13 11:10:28 +02:00
bergquist 1e41eb8c97 tech(alerting): remove frequency from alert model 2016-06-13 10:42:36 +02:00
bergquist 94f059838c feat(alerting): implemention duration parser 2016-06-13 10:40:46 +02:00
bergquist 2cf72715fb test(alerting): fixes broken unit tests 2016-06-13 09:33:14 +02:00
bergquist d52fc8d0ad Merge branch 'alert_ui_take2' into alerting 2016-06-13 09:20:00 +02:00
Torkel Ödegaard 9216492d55 Merge branch 'alert_handles' into alert_ui_take2
Conflicts:
	pkg/services/alerting/commands.go
2016-06-13 07:53:13 +02:00
bergquist 77746f277d chore(alerting): move transformers to seperate package 2016-06-13 07:46:54 +02:00
bergquist 22407fc897 fix(metrics): 64bit aligns standardcounter
Due to a bug in golang the 64bit variable i
need to come first to be 64bit aligned.
https://golang.org/pkg/sync/atomic/#pkg-note-BUG

closes #5341
2016-06-13 06:56:16 +02:00
Carl Bergquist dba6fe8af3 Merge pull request #5340 from hailthemelody/master
update pricing to include 1 million free API requests per month
2016-06-13 06:54:00 +02:00
hailthemelody ef9500a8f0 update pricing to include 1 million free API requests per month 2016-06-12 11:41:43 -04:00
Torkel Ödegaard e3b281dbac feat(alerting): more work on alerting thresholds 2016-06-12 11:43:18 +02:00
Torkel Ödegaard 5b6fb3b124 feat(alerting): level handle progress 2016-06-11 23:52:25 +02:00
Torkel Ödegaard ec640bd5da feat(alerting): more work on alerting ui 2016-06-11 23:31:49 +02:00
Torkel Ödegaard 1500c0e954 feat(alerting): alert threshold handles progress 2016-06-11 22:33:02 +02:00
Torkel Ödegaard f387e39b67 mend 2016-06-11 14:37:52 +02:00
Torkel Ödegaard 0b919c752b feat(alerting): poc of dragable alert handles 2016-06-11 14:37:33 +02:00
Torkel Ödegaard 66c2594262 feat(alerting): sql update fixes 2016-06-11 14:08:55 +02:00
Torkel Ödegaard 71c1c0ab65 feat(alerting): trying to get things to work with new model 2016-06-11 13:49:11 +02:00
Torkel Ödegaard 0ef6801117 Merge branch 'master' into alert_ui_take2 2016-06-11 12:17:14 +02:00
Torkel Ödegaard bf1ea560e9 feat(logging): error logging improvements 2016-06-11 12:16:33 +02:00
Torkel Ödegaard 77a5e3f14d feat(alerting): minor fixes 2016-06-11 11:54:46 +02:00
Torkel Ödegaard 086b59483e feat(loggin): disable logging by default so unit tests are not full of logging 2016-06-11 11:38:25 +02:00
Torkel Ödegaard 382f396247 feat(alerting): more model changes 2016-06-11 10:54:24 +02:00
Torkel Ödegaard a362984c57 feat(alerting): renamed AlertRuleModel to just Alert, think making a distinction between an Alert and an Alert Rule is just confusing and was a mistake on my part 2016-06-11 10:26:48 +02:00
Torkel Ödegaard 2b4a9954b1 feat(alerting): progress on alerting UI and model, refactoring of dashboard parser and tests into extractor component, moved tests from sqlstore to alerting package 2016-06-11 10:13:33 +02:00
bergquist 1fa9ae810b test(alerting): enable disabled tests 2016-06-10 15:49:23 +02:00
bergquist 83c422e6ef feat(alerting): implement transform objects 2016-06-10 15:31:17 +02:00
Torkel Ödegaard c18017381b Merge branch 'alert_ui_take2' of github.com:grafana/grafana into alert_ui_take2
Conflicts:
	public/app/plugins/panel/graph/alert_tab_ctrl.ts
2016-06-10 14:52:17 +02:00
Torkel Ödegaard 48cbeb96bf feat(alerting): updated rule model and UI 2016-06-10 14:49:54 +02:00
bergquist ea8fb66f73 test(alerting): fixes broken unittests 2016-06-10 13:47:54 +02:00
bergquist 3c0b5fe78e tech(alerting): add graphite dateformat replacer 2016-06-10 13:26:19 +02:00
bergquist 8cd1d17916 feat(alerting): new alerting model\ 2016-06-10 13:15:16 +02:00
bergquist 0c69c5afb1 test(alerting): fixes broken unittests 2016-06-10 11:37:03 +02:00
bergquist ef35184a80 feat(alerting): rename alertrule model to alertruleDAO 2016-06-10 10:00:00 +02:00
bergquist b17298c97c test(alerting): remove unused code to enable gorename 2016-06-10 07:11:14 +02:00
bergquist fdf051ad5a feat(alerting): begin alert rule storage refactoring 2016-06-09 22:21:28 +02:00
stuart nelson 048bcf19f6 Use panel+ref for unique id
Previously, if a user changed the query between
requests, the previous query would not be
canceled. This handles that edge-case.
2016-06-09 15:17:17 +02:00
stuart nelson 8797be9f89 Add existence check for canceler. 2016-06-09 15:16:53 +02:00
bergquist 3898f427f5 feat(alerting): update the ux model 2016-06-09 15:10:50 +02:00
bergquist 1e4761854e Merge branch 'alerting_definitions' into alert_ui_take2 2016-06-09 13:03:40 +02:00
stuart nelson cc64d65c2f Rename cacheKey to exprID/requestID
Depending on context in the code, rename cacheKey
to exprID when it identifies a unique expression,
and rename cacheKey to requestID when it is
identifying a request.
2016-06-09 12:57:55 +02:00
Torkel Ödegaard 55af988e02 feat(alerting): mocking with new alert rule model 2016-06-09 12:14:50 +02:00
stuart nelson efdb990e56 Return an error for a canceled request.
Allow the datasource to decide how to handle a
canceled request.
2016-06-09 12:13:17 +02:00
stuart nelson bc7c2cd3f5 Create cacheKey at top-level
Responsibility is now to pass the cacheKey through
to `datasourceRequest` in each datasources'
implementation of `query`.
2016-06-09 11:36:46 +02:00
bergquist 66d47a9303 tech(alerting): go vet fix 2016-06-09 10:49:25 +02:00
Torkel Ödegaard c85bb47675 Merge branch 'alerting_definitions' into alert_ui_take2 2016-06-09 10:46:03 +02:00
Torkel Ödegaard dee5f582d7 Merge branch 'master' into alerting_definitions 2016-06-09 10:45:16 +02:00
Torkel Ödegaard 1584dac00a Merge branch 'master' of github.com:grafana/grafana 2016-06-09 10:43:46 +02:00
Torkel Ödegaard 79986e5593 Merge branch 'query-part-refactor'
Conflicts:
	public/app/plugins/datasource/influxdb/query_part.ts
2016-06-09 10:43:07 +02:00
Torkel Ödegaard b8aa8b3079 feat(prometheus): restore old prometheus query editor, revert this commit in prometheus query editor v2 branch 2016-06-09 10:37:33 +02:00
bergquist 544073b7e1 feat(alerting): make sure saved alerts are valid 2016-06-09 10:27:23 +02:00
Torkel Ödegaard 071c16b73c feat(alerting): start on new ui 2016-06-09 10:13:34 +02:00
bergquist a1f97e0b77 feat(alerting): add heartbeat writer 2016-06-09 10:00:34 +02:00
Mark Baas ced3bafa99 returns correct index (#5275) 2016-06-09 08:13:31 +02:00
Mukesh 755ec552de Bugfix: org select btn was not working on profile (#5317) 2016-06-09 00:43:38 +02:00
stuart nelson 18f9f6c159 Add in-flight identifier for Prometheus requests
Repeat Prometheus requests with the same query
will cancel preceding requests.
2016-06-08 18:05:46 +02:00
stuart nelson 6da7ed9706 Add support for canceling in-flight requests
Repeat requests, if they already exist in the
in-flight request map, will cause the previous
request to cancel.

The implementation of the unique key is the
responsibility of individual datasources.
2016-06-08 18:04:31 +02:00
Torkel Ödegaard a66027830b Merge branch 'alerting_definitions' of github.com:grafana/grafana into alerting_definitions 2016-06-08 09:42:31 +02:00
Torkel Ödegaard 26d93d7130 Merge branch 'master' into alerting_definitions 2016-06-08 09:36:50 +02:00
bergquist ffac5c1299 docs(changelog): add note about changelog 2016-06-08 09:35:34 +02:00
Carl Bergquist fe5673134f Merge pull request #5292 from Thib17/master
Enable the "limit" param in /api/search
2016-06-08 09:19:58 +02:00
bergquist 366fb11416 style(alerting): add fmt fixes 2016-06-08 08:50:11 +02:00
Torkel Ödegaard 1d8fdc09e7 feat(logging): added log format option, #4590 2016-06-08 08:48:46 +02:00
Torkel Ödegaard 7d6cda4916 Merge branch 'master' of github.com:grafana/grafana 2016-06-08 08:10:22 +02:00
Torkel Ödegaard b25cb60259 Merge branch 'new-logger'
Conflicts:
	CHANGELOG.md
2016-06-08 08:09:59 +02:00
Torkel Ödegaard 87e98f01cd feat(logging): updated syslog writer to work with log15 log interface, closes #4590 2016-06-08 08:09:29 +02:00
Karl 22cda198ae Apply EscapeFilter to username to address grafana/grafana#5121 (#5279) 2016-06-08 07:28:16 +02:00
Tom Hukins d1c06a93df Fix a typo (#5306) 2016-06-08 07:27:52 +02:00
Torkel Ödegaard eed0d9c8d2 feat(graph performance): graph performance tweaks, refactoring #5297 2016-06-08 07:23:44 +02:00
Torkel Ödegaard bf82fdb678 Merge branch 'perf_graph_js' of https://github.com/mtanda/grafana into mtanda-perf_graph_js 2016-06-08 06:53:28 +02:00
Torkel Ödegaard e1e7fbf83d Merge branch 'master' of github.com:grafana/grafana 2016-06-08 06:51:43 +02:00
Torkel Ödegaard c739428c30 feat(profiling): refactorign profiling code, #5286 2016-06-08 06:51:10 +02:00
Torkel Ödegaard 2a7d2ffccb Merge branch 'profiling_in_dev' of https://github.com/mtanda/grafana into mtanda-profiling_in_dev 2016-06-08 05:47:30 +02:00
Zdenek Styblik 5eceabf810 fix(): Check Organization exists before User is added (#5302)
Commit adds a check whether Organization exists before User is added to
the organization.

Fixes #3151.
2016-06-08 05:46:21 +02:00
Torkel Ödegaard 67ad903556 feat(test metrics): fixed issue with built in Grafana test data source, fixes #5299 2016-06-08 05:45:13 +02:00
Torkel Ödegaard 36b0802789 fix(png): fixed issue with png rendering, fixes #5274 2016-06-08 05:29:38 +02:00
Torkel Ödegaard 93fdc18fd4 feat(logging): fixed dependencies 2016-06-07 15:59:50 +02:00
bergquist 8d4aa5d114 test(alerting): update dashboard json 2016-06-07 15:52:33 +02:00
Torkel Ödegaard e4ea24dfc4 Merge branch 'new-logger' into alerting_definitions
Conflicts:
	pkg/services/sqlstore/migrations/migrations_test.go
2016-06-07 15:51:22 +02:00
Torkel Ödegaard 73b0e6c37b feat(logging): disable migrator logging during test 2016-06-07 15:50:16 +02:00
Torkel Ödegaard d7c03359ea feat(alerting): fixed test issues 2016-06-07 14:54:30 +02:00
Torkel Ödegaard 3289225b77 feat(alerting): fixed test issues 2016-06-07 14:51:53 +02:00
Torkel Ödegaard 8105ec4660 feat(alerting): fixed test issues 2016-06-07 14:27:56 +02:00
Torkel Ödegaard 461e6ae4ac feat(alerting): added missing godep libs 2016-06-07 13:50:55 +02:00
Torkel Ödegaard 0d9c9526b9 feat(alerting): fixed graphite log issue 2016-06-07 13:47:22 +02:00
Torkel Ödegaard 0667d73660 Merge branch 'new-logger' into alerting_definitions
Conflicts:
	pkg/api/api.go
	pkg/setting/setting.go
2016-06-07 13:31:56 +02:00
Torkel Ödegaard 65aad44464 feat(logging): added uname to context logger 2016-06-07 12:20:46 +02:00
Torkel Ödegaard a02cf5beb7 feat(logging): added loging filters 2016-06-07 12:11:41 +02:00
bergquist b76b42f209 docs(changelog): add note about deb post install script 2016-06-07 12:09:56 +02:00
Carl Bergquist ee88b0dc35 Merge pull request #5282 from nazco/patch-1
restart grafana after upgrade
2016-06-07 12:03:42 +02:00
Torkel Ödegaard 3dc7706c45 feat(loggin): improved http request panic handling 2016-06-07 10:05:10 +02:00
Torkel Ödegaard 9741af2031 feat(logging): progress on new logging #4590 2016-06-07 09:29:47 +02:00
Mitsuhiro Tanda 487b2089a9 cache label width 2016-06-07 14:28:08 +09:00
Mitsuhiro Tanda b28368c859 cache panel width 2016-06-07 14:04:06 +09:00
Torkel Ödegaard 22778e6efd feat(logging): a lot of progress on moving to new logging lib, #4590 2016-06-06 23:06:44 +02:00
Thibault Chataigner 3d77685108 Enable the "limit" param in /api/search 2016-06-06 16:15:20 +00:00
Mitsuhiro Tanda 25899b72d2 use applyAsync for compile (#5287) 2016-06-06 17:18:18 +02:00
Mitsuhiro Tanda f877afb74d use async apply (#5258) 2016-06-06 17:18:10 +02:00
Torkel Ödegaard 34e17f7282 feat(alerting): requests looks to be working again 2016-06-06 17:11:46 +02:00
Torkel Ödegaard d1acfb4494 feat(alerting): minor progress 2016-06-06 14:24:14 +02:00
Torkel Ödegaard 7a34c129fe feat(alerting): things are compiling and tests pass 2016-06-06 13:50:47 +02:00
Torkel Ödegaard 0cbf4ae773 feat(alerting): began work on splitting scheduler into scheduler and engine 2016-06-06 11:56:58 +02:00
Mitsuhiro Tanda 83c76981b2 fix profiling code 2016-06-06 17:42:11 +09:00
Mitsuhiro Tanda 975b53b318 enable profiling in development mode 2016-06-06 17:42:11 +09:00
bigbenhur ef623846c1 further tests for log-autoscale and log-fixedscale; only generate visible ticks; minor changes to prevent crashes due to bad user input 2016-06-06 10:33:35 +02:00
Torkel Ödegaard a191b9b1cf feat(alerting): moved alerting models back to alerting package, models is more for storage dtos 2016-06-06 10:31:21 +02:00
Torkel Ödegaard 70cb8400c3 feat(alerting): changed name of root Alerts nav item and page from Alerts to Alerting 2016-06-06 09:17:29 +02:00
Torkel Ödegaard f36a44c49a Merge branch 'master' into alerting_definitions
Conflicts:
	conf/defaults.ini
	pkg/api/dashboard.go
2016-06-06 08:43:01 +02:00
Karl 2f5ae85d33 Initial patch for grafana/grafana#4267 (#5280) 2016-06-06 07:15:37 +02:00
Ben Oswald 51878aeca8 change start to restart also for systemctl
I've forgotten to update the systemctl start to restart in my first commit
2016-06-05 16:27:57 +02:00
Ben Oswald 1d2eb0f903 restart grafana after upgrade
The current script only tries to start the already running grafana process after an upgrade. This leads to errors due to changed js and css hashes while grafana is delivering the old ones. To load the new sources we need to restart grafana after an upgrade.
2016-06-05 16:19:53 +02:00
f1 d002cab28f add reads/min and etc to unitFormats 2016-06-05 00:57:04 +02:00
bigbenhur 29b9d17faa fix crash due to zero or negative data values in graph with log scale 2016-06-03 22:30:38 +02:00
Torkel Ödegaard 7cbaf06097 feat(instrumentation): check if enabled in http api metrics route 2016-06-03 21:22:34 +02:00
Torkel Ödegaard 1059a35bbc feat(instrumentation): documented instrumentation options, closes #4696 2016-06-03 18:38:19 +02:00
Torkel Ödegaard 064e474b0a Merge branch 'metrics_reporting' 2016-06-03 18:06:41 +02:00
Torkel Ödegaard aef2b6b45f feat(instrumentation): finial polish 2016-06-03 17:15:17 +02:00
Torkel Ödegaard 35a7a3a52b feat(instrumentation): added some more timers 2016-06-03 17:00:39 +02:00
Torkel Ödegaard e0c6048820 feat(instrumentation): added gauge and http endpoint 2016-06-03 16:15:36 +02:00
bigbenhur 1e4eb01059 Support auto grid min/max when using log scale, Issue #3090 2016-06-03 15:54:14 +02:00
Torkel Ödegaard ffb12d122f Update ISSUE_TEMPLATE.md 2016-06-03 15:34:08 +02:00
bergquist 6a49d4ed6b feat(alerting): remove orgid from alertrule query 2016-06-03 15:24:53 +02:00
bergquist b08f8bab71 Merge branch 'dakerfp-patch-3' 2016-06-03 15:09:18 +02:00
Torkel Ödegaard 1a05ae2eaa feat(instrumentation): more work 2016-06-03 15:06:57 +02:00
bergquist 961c31a747 test(util): add unit test for string util 2016-06-03 15:06:54 +02:00
bergquist d1a345bb03 Merge branch 'patch-3' of https://github.com/dakerfp/grafana into dakerfp-patch-3 2016-06-03 15:02:46 +02:00
bergquist 2cf797b567 tech(alerting): minor refactoring and code style 2016-06-03 15:01:42 +02:00
Carl Bergquist 236aed112f Merge pull request #5255 from dakerfp/patch-1
Unify signal registration in a single syscall.
2016-06-03 14:59:42 +02:00
bergquist 65eb373808 Merge branch 'master' into alerting_definitions 2016-06-03 13:48:36 +02:00
bergquist 3d7facf6ee fix(cli): fixes broken import 2016-06-03 13:40:48 +02:00
Torkel Ödegaard eee49a4995 feat(instrumentation): added meter, histogram and new timer, timer now send p25, p75, p90, p99 percentiles in 1000 sample exp decaying sample 2016-06-03 12:50:51 +02:00
bergquist 6de1399cf0 fix(cli): fixes broken import 2016-06-03 12:35:17 +02:00
bergquist d0ac258474 Merge branch 'master' into alerting_definitions 2016-06-03 12:22:46 +02:00
bergquist 15aeb4aec2 tech(cli): rename log to logger to separate from server logger 2016-06-03 12:22:30 +02:00
bergquist 5bbfe39f84 tech(alerting): replace goreq with native http 2016-06-03 11:38:56 +02:00
bergquist 9c7e6a2133 feat(alerting): add basic auth support for graphite 2016-06-03 11:07:55 +02:00
Torkel Ödegaard 86f0007768 feat(instrumentation): added influxdb client 2016-06-03 09:18:21 +02:00
Torkel Ödegaard 3065d10931 feat(timing): timing is now working with graphite and influxdb 2016-06-03 09:17:36 +02:00
bergquist eab81a7781 style(alerting): go lint fixes 2016-06-03 09:11:20 +02:00
bergquist 50d98b161c feat(alerting): adds support for retries 2016-06-03 09:04:20 +02:00
bergquist 68f01d57d3 tech(alerting): use range in loops when possible 2016-06-03 08:44:22 +02:00
Torkel Ödegaard 4c4189d631 Update ISSUE_TEMPLATE.md 2016-06-03 08:38:48 +02:00
Torkel Ödegaard 015b409f2f Update ISSUE_TEMPLATE.md 2016-06-03 08:38:07 +02:00
bergquist cc65dd8bcf tech(alerting): use pointers for updating alertjobs 2016-06-03 08:33:53 +02:00
bergquist 910253bc42 tech(alerting): remove datasource ref from alertjob 2016-06-03 07:40:47 +02:00
Torkel Ödegaard e2c794ff31 feat(instrumentation): lots of refactoring to support tag based backend, #4696 2016-06-02 21:06:49 +02:00
Torkel Ödegaard 2a9b51d836 feat(instrumentation): influxdb is working, now need to find a way to better support tags, #4696 2016-06-02 16:56:07 +02:00
bergquist 0bea0cc5b9 feat(alerting): add interface for alert backend 2016-06-02 16:34:25 +02:00
bergquist 510360a509 docs(elastic): updates readme 2016-06-02 14:56:31 +02:00
Torkel Ödegaard 6b2a4fe8e8 feat(instrumentation): work on settings model for internal metrics publishing, #4696 2016-06-02 14:32:17 +02:00
Torkel Ödegaard 49fe90874a Merge branch 'v3.0.x' 2016-06-02 12:09:10 +02:00
Torkel Ödegaard acbaef1907 fix(influxdb): fixed issue with backslash escaping in tag filter, fixes #5249 2016-06-02 12:08:13 +02:00
Torkel Ödegaard 74101eaf7c feat(instrumentation): changed name to senders 2016-06-02 12:04:50 +02:00
Torkel Ödegaard 8ab324988c Merge branch 'v3.0.x' 2016-06-02 09:57:20 +02:00
Torkel Ödegaard 1283461b89 fix(gzip): add plugin proxy to gzip exclusion, fixes #5237 2016-06-02 09:56:53 +02:00
Torkel Ödegaard 38790e2c4b fix(elasticsearch): fixed templating lucene / json escaping issue, fixes #5228, fixes #5227 2016-06-02 09:54:28 +02:00
Carl Bergquist aa718b4dce Merge pull request #5253 from minkikim89/fix_seperate_typo
fixed separate typo
2016-06-02 07:42:04 +02:00
Daker Fernandes Pinheiro 2d09dfd34f Using variadic argument to StringFallback implementation 2016-06-02 01:46:18 -03:00
Daker Fernandes Pinheiro 48e4de823a Unify signal registration in a single syscall. 2016-06-02 01:34:37 -03:00
bergquist 65d8403a04 fix(metrics_reporting): adds missing formating varialbe 2016-06-01 15:16:17 +02:00
bergquist a8ac37f517 feat(usage_metrics): add timer metrics 2016-06-01 15:04:58 +02:00
bergquist b2c0679a7f feat(metrics): initial graphite metrics writer for internal stats 2016-06-01 13:31:11 +02:00
bergquist 69229211b2 fix(alerting): move backend to seperate file 2016-06-01 11:25:29 +02:00
bergquist 4e1f801f6c feat(alerting): add serie name to failed alert description 2016-05-31 21:02:26 +02:00
bergquist 76758d270f feat(alerting): set basic description text of status ok 2016-05-31 20:03:15 +02:00
Carl Bergquist 8db00073b4 Merge pull request #5232 from peggyl/peggyl/fix-tags-popover-text
Fix wording of the dashboard tags popover text
2016-05-31 19:47:24 +02:00
Peggy Li d36c1769e0 Fix wording of the dashboard tags popover text 2016-05-31 17:29:31 +00:00
bergquist 68f148880d feat(alerting): add alert info at log page 2016-05-31 16:26:06 +02:00
bergquist 7c3dbe2a38 chore(alerting): move aggregations into alerting package 2016-05-31 15:29:56 +02:00
bergquist 7224ea5229 chore(alerting): convert alert levels to float 2016-05-31 14:18:12 +02:00
bergquist 338fdcb576 feat(alerting): add copy of AlertRule to AlertResult 2016-05-31 13:27:12 +02:00
bergquist 1ded0b30c2 fix(alerting): fix broken model bind in alerting tab 2016-05-31 13:12:05 +02:00
Carl Bergquist 53ecb4c1ae Merge pull request #5222 from akiomik/patch-1
Fixed assets urls in 500.html
2016-05-31 07:59:24 +02:00
Akiomi KAMAKURA 616dd5c4a5 Fixed assets urls in 500.html 2016-05-31 14:26:13 +09:00
bergquist d1daa2c817 style(alerting): give better info about actual value 2016-05-30 19:21:28 +02:00
bergquist b75631e021 chore(alerting): move alert result to models 2016-05-30 19:08:04 +02:00
bergquist 1498db11a9 feat(alerting): extracts alert rule reading 2016-05-30 18:52:38 +02:00
bergquist c5c261e955 feat(alerting): improve spacing in alerting tab 2016-05-30 17:50:35 +02:00
bergquist 3d5c27df91 test(alerting): add tests for multi serie checks 2016-05-30 14:58:32 +02:00
bergquist 411568351d feat(alerting): revert operand positions 2016-05-30 14:47:59 +02:00
bergquist 2edb0ad94d feat(influxdb): adds spread functionallity
closes #5211
2016-05-30 14:23:24 +02:00
bergquist 077be210da tech(alerting): change interval -> frequency 2016-05-30 09:31:05 +02:00
bergquist 16a9e56eca tech(alerting): change queryrange to int from str 2016-05-30 09:18:22 +02:00
bergquist 51511dd654 feat(alerting): save alert state 2016-05-30 09:03:14 +02:00
bergquist 1686d86c3b Merge branch 'master' into alerting_definitions 2016-05-30 08:26:08 +02:00
Carl Bergquist f8a535c6e8 Merge pull request #5195 from matschaffer/cloudwatch_metric_update_elasticbeanstalk
Add metrics for AWS/ElasticBeanstalk
2016-05-30 08:05:09 +02:00
Carl Bergquist f1bd614770 Merge pull request #5183 from nfnty/master
package.json: Upgrade grunt-contrib-compress, Fixes #5071
2016-05-30 08:02:00 +02:00
Torkel Ödegaard c8965d0f9a feat(export): export will add templatize constant variables 2016-05-28 20:27:44 +02:00
Torkel Ödegaard 53bb264375 Merge branch 'master' into export-dashboard 2016-05-28 17:17:51 +02:00
Torkel Ödegaard 1ea54049d0 feat(templating): added new template variable type constant 2016-05-28 16:59:29 +02:00
Torkel Ödegaard ca8543348b docker(): added collectd system metrics collector that writes to graphite, just for testing 2016-05-28 10:13:51 +02:00
hc4 cf87e8ecf5 Fix parsing of intervals. defined in ms (#5151)
* Fix parsing of intervals. defined in ms

Fix parsing of intervals. defined in ms.
Increase accuracy for sub-second inrevals.
Closes #5008

* Tests for sub-ms intervals

Unit test for https://github.com/grafana/grafana/commit/2034d4b9710b0cb9fd0cdf14aa9981cd0417eda4
2016-05-27 17:26:20 +02:00
Carl Bergquist a6afd85526 Merge pull request #5197 from minkikim89/fixtypo
Fixed type
2016-05-27 16:57:07 +02:00
Torkel Ödegaard 0d4c76a029 feat(import): save gnetId for dashbards imported from grafana.net 2016-05-27 16:42:32 +02:00
Torkel Ödegaard c3708b3096 feat(import): import directly from grafana.net id/url now works 2016-05-27 16:11:05 +02:00
bergquist e80000ce94 tech(alerting): skip if operator does not exist 2016-05-27 15:53:18 +02:00
bergquist 1f990da5c3 tech(alerting): use the timeseries ctor function 2016-05-27 15:51:34 +02:00
bergquist 5f2447976c style(alerting): add note about making timeseries model safer 2016-05-27 15:28:47 +02:00
bergquist 22d8723c1d feat(alerting): generelize aggregator functions 2016-05-27 15:17:48 +02:00
bergquist abc1ae3956 feat(alerting): add timeserie aggregation functions 2016-05-27 14:59:13 +02:00
Torkel Ödegaard 22a7eaf2e7 Merge branch 'master' into export-dashboard 2016-05-27 13:52:53 +02:00
Torkel Ödegaard 540def2c39 feat(import): working on unit tests for import ctrl 2016-05-27 13:52:19 +02:00
bergquist 205afd7212 style(alerting): remove some logging 2016-05-27 12:13:09 +02:00
bergquist 422234d03a feat(alerting): abstract graphite from executor 2016-05-27 12:06:41 +02:00
bergquist 3d66ec816d chore(alerting): minor refactoring 2016-05-27 10:34:44 +02:00
Torkel Ödegaard bf90fbc678 fix(templating): fixed failing templating unit test 2016-05-27 09:23:08 +02:00
Tim Bielawa 2b9d260686 docs(rebuild): Include new http api preferences docs in menus (#5194)
This updates the mkdocs.yml source file such that the HTTP Preferences
API is included in the website navigation bar and in the HTTP API
overview page.

This commit also refreshes the docs/README.md file with more verbose
instructions for building and viewing the documentation locally.

* Original issue: #5069 Document org & user preferences HTTP docs
* Original PR: #5087

Closes #5193
2016-05-27 08:58:42 +02:00
Torkel Ödegaard f6633c8189 feat(export): minor dupe fix 2016-05-27 08:34:12 +02:00
Mat Schaffer 18f704533f Add enhanced elasticbeanstalk metrics 2016-05-27 11:47:53 +09:00
Mat Schaffer aedba5411c Add basic metrics for AWS/ElasticBeanstalk 2016-05-27 11:30:16 +09:00
Torkel Ödegaard e83d13848e Merge branch 'master' into export-dashboard
Conflicts:
	public/app/features/dashboard/submenu/submenu.ts
2016-05-26 14:22:22 +02:00
Torkel Ödegaard 696fad702f Merge branch 'v3.0.x'
Conflicts:
	public/app/features/templating/templateValuesSrv.js
2016-05-26 14:21:17 +02:00
Torkel Ödegaard 724a511995 fix(templating): fixed issue with value being shown instead of it's text representation, fixes #5172 2016-05-26 13:18:02 +02:00
Torkel Ödegaard 90c9c70416 fix(): another fix for panel image rendering 2016-05-26 08:49:55 +02:00
Torkel Ödegaard f8a4661d05 Merge branch 'master' of github.com:grafana/grafana 2016-05-26 08:37:19 +02:00
Torkel Ödegaard dd494e648a fix(rendering): fixed issue with phantomjs panel rendering 2016-05-26 07:45:53 +02:00
bergquist 8ac635b631 style(alerting): change const names 2016-05-26 07:41:23 +02:00
Jared Wiltshire c9d6321f38 Allow for proxying Authorization header and automatically convert (#4832)
Authorization header to X-DS-Authorization in backend_srv.js
2016-05-26 07:13:29 +02:00
Mukesh 4038b4d17e Set active org through admin api (#5179) 2016-05-26 06:51:23 +02:00
nfnty 46551e9d65 package.json: Upgrade grunt-contrib-compress, Fixes #5071 2016-05-26 01:03:22 +02:00
bergquist 957cb407c5 feat(alerting): naiv graphite executor 2016-05-25 17:21:20 +02:00
Torkel Ödegaard 1060eeb197 feat(dashboard): include org id query parameter in dashboard url, #1613 2016-05-25 17:06:41 +02:00
Torkel Ödegaard 201d30a944 fix(export): style fixes and markup fixes for share modal 2016-05-25 13:01:40 +02:00
bergquist b2a4d8083e feat(alerting): add datasource ref to alert rule 2016-05-25 12:57:49 +02:00
Torkel Ödegaard fc2a069180 feat(export): fixed refactoring issue with dynamic dashbord srv 2016-05-25 12:45:52 +02:00
Torkel Ödegaard 392407136d Merge branch 'export-dashboard' of github.com:grafana/grafana into export-dashboard 2016-05-25 12:33:30 +02:00
Torkel Ödegaard ba6573af61 Merge branch 'master' into export-dashboard
Conflicts:
	public/app/features/dashboard/submenu/submenu.ts
2016-05-25 12:32:56 +02:00
Matt Toback 8d988f9582 Export dashboard bulletfactory (#5160)
* create descriptions and styles for share dropdown

* Updating actual modal layout for Sharing

* Updated the modals to follow the new styles, fixed the wrapping issue on the main menu. Standardized buttons.
2016-05-25 12:30:27 +02:00
Torkel Ödegaard f923edc424 Merge branch 'v3.0.x' 2016-05-25 12:29:35 +02:00
Torkel Ödegaard 2712d9ae8b Update latest.json 2016-05-25 12:23:32 +02:00
Torkel Ödegaard 3312a042dd docs(): updated download links 2016-05-25 11:50:00 +02:00
Torkel Ödegaard 5040570ea9 docs(): updated changelog 2016-05-25 11:07:29 +02:00
Torkel Ödegaard f5c5d1b1da Merge branch 'master' of github.com:grafana/grafana 2016-05-25 11:04:27 +02:00
Torkel Ödegaard 2cd6c2e7e0 Merge branch 'v3.0.x' 2016-05-25 11:04:12 +02:00
Torkel Ödegaard 0daadc954c fix(templating): fixed issue with detecting data source variable in other template variable definition, fixes #5165 2016-05-25 10:46:55 +02:00
bergquist ec98b7d672 docs(changelog): add note about fix for 5167 2016-05-25 10:01:49 +02:00
bergquist 8c2b6b532d fix(preferences): fixes broken default home dashboard
closes #5167
2016-05-25 09:56:45 +02:00
Torkel Ödegaard 71d62012e1 fix(panel): fixed issue with fullscreen panel view and switching to another dashboard, fixes #5163 2016-05-25 09:46:15 +02:00
Torkel Ödegaard 41deea90ee feat(dashboard): template variable changes updates url, closes #5002 2016-05-24 16:34:17 +02:00
Torkel Ödegaard a81806d3d0 feat(dashboard): sync time range with url, closes #458 2016-05-24 16:32:28 +02:00
bergquist 0f58f8a679 feat(alerting): add timeout handler for check execution 2016-05-24 10:30:39 +02:00
Torkel Ödegaard 5607a114f9 updated changelog 2016-05-24 09:53:28 +02:00
Torkel Ödegaard e81614b9e9 Merge branch 'v3.0.x' 2016-05-24 09:50:41 +02:00
Torkel Ödegaard 6f094ef215 fix(templating): fixed issue with nested template variables and multi select, the child variable selection state is now updated like single select variables, so if none matches the first option is selected, fixes #4861 2016-05-24 09:50:23 +02:00
Torkel Ödegaard 366baea099 docs(): updated changelog 2016-05-24 08:14:40 +02:00
Torkel Ödegaard dc9dcd045d Merge branch 'master' of github.com:grafana/grafana 2016-05-24 08:11:52 +02:00
Torkel Ödegaard 10c47ee27c feat(footer): some minor changes to footer to make it look good in light theme, closes #4889 2016-05-24 08:11:28 +02:00
Torkel Ödegaard 8f0240a295 Merge branch 'footer' 2016-05-24 07:53:13 +02:00
Torkel Ödegaard fd08c821f9 Merge branch 'v3.0.x'
Conflicts:
	package.json
2016-05-24 07:52:27 +02:00
Torkel Ödegaard c41c771e9a fix(home dashboard): fixed handling error when default dashboard is not found, fixes #5141 2016-05-24 07:39:58 +02:00
bergquist 448ee5812c feat(alerting): make sure the map contains the responding alert 2016-05-24 07:24:45 +02:00
Zdenek Styblik fff5aa3020 Add missing option Read-Only Editor to auto_assign_org_role description (#5139)
Commit adds missing option `Read-Only Editor` to `auto_assign_org_role` description.
2016-05-23 21:24:23 +02:00
Torkel Ödegaard f1ec270e3e bumped version to 3.0.4 2016-05-23 21:24:02 +02:00
Torkel Ödegaard a3f2f574c6 fix(singlestat): fixed Gauge positioning issue, fixes #5143 2016-05-23 21:23:31 +02:00
Utkarsh Bhatnagar ec19a97156 [Bug Fix] #5136 (#5142) 2016-05-23 21:00:06 +02:00
Torkel Ödegaard 9a7817a271 Merge branch 'master' into footer
Conflicts:
	pkg/api/frontendsettings.go
2016-05-23 20:59:23 +02:00
Utkarsh Bhatnagar 8a0d5aa38d [Bug Fix] #5136 (#5142) 2016-05-23 20:58:21 +02:00
Trent White a52869507e hide footer on non-dashboard pages 2016-05-23 12:46:13 -04:00
Torkel Ödegaard c77d72b29f feat(prometheus): progress on new prometheus query editor, #5117 2016-05-23 18:03:17 +02:00
Trent White 76d18e7156 remove height: 100% on .main-view 2016-05-23 11:45:54 -04:00
bergquist 7229fb7a76 tech(alerting): change from array to map 2016-05-23 17:04:57 +02:00
bergquist 77ec575b46 tech(alerting): fixes broken unit-tests 2016-05-23 14:51:41 +02:00
bergquist 9d500df2bb chore(alerting): remove redundant code 2016-05-23 14:36:24 +02:00
bergquist 9f8c67e352 feat(alerting): only start unfinnished jobs 2016-05-23 14:14:02 +02:00
Torkel Ödegaard 9e6056551d docs(): updated download links 2016-05-23 14:13:30 +02:00
Torkel Ödegaard bbea698af3 Update latest.json 2016-05-23 12:30:46 +02:00
bergquist cb21bf41b0 tech(alerting): split code into different files 2016-05-23 12:15:36 +02:00
bergquist b496b6a252 test(alerting): add test for alertjob selection 2016-05-23 12:04:34 +02:00
Torkel Ödegaard 9eec68985d docs(): updated download links 2016-05-23 11:49:07 +02:00
bergquist 4fce82344e feat(alerting): async exeuction on a shoestring 2016-05-23 11:47:41 +02:00
bergquist f95fa51322 feat(alerting): make rule execution async 2016-05-23 11:17:07 +02:00
Torkel Ödegaard cd82f579bd docs(): updated changelog 2016-05-23 11:08:08 +02:00
Torkel Ödegaard 93665f49b1 Merge branch 'v3.0.x' 2016-05-23 11:06:53 +02:00
bergquist a7fcb3a2cc feat(alerting): add dummie executor 2016-05-23 10:59:28 +02:00
Torkel Ödegaard dc77d555f9 fix(elasticsearch): fixed templating issue with elasticsearch, fixes #5135 2016-05-23 10:58:31 +02:00
Torkel Ödegaard dfe3806d01 fix(elasticsearch): fixed query editor issue with elasticsearch 2016-05-23 10:14:40 +02:00
bergquist f05cae23d2 feat(alerting): alert rule selector 2016-05-23 10:07:04 +02:00
Torkel Ödegaard cfc7710205 docs(): changelog updated 2016-05-23 09:31:52 +02:00
Torkel Ödegaard c60d737928 Merge branch 'v3.0.x'
Conflicts:
	package.json
2016-05-23 09:29:14 +02:00
Torkel Ödegaard 1da149d9e1 feat(annotations): annotations can now use a template variable as data source, closes #5054 2016-05-23 09:28:14 +02:00
bergquist 411178d384 tech(alerting): disable feature toggle
this feature toggle caused migration tests to fail
2016-05-23 08:24:10 +02:00
bergquist 45b2b4bc52 feat(alerting): add feature toggles for alerting functions 2016-05-23 08:00:42 +02:00
Torkel Ödegaard 43ba563a1c fix(logging): change log level to trace for plugin proxy logging call, fixes #5126 2016-05-23 07:55:55 +02:00
minki 05cb6048ae fixed separate typo 2016-05-23 09:32:18 +09:00
minki 70d6b32e14 Fixed type 2016-05-22 05:38:57 +09:00
Trent White 75940c1f5d turn watch all back on 2016-05-21 13:21:31 -04:00
Mitsuhiro Tanda 1d27a7f93d (cloudwatch) fix wrong cache key of credentials (#5124) 2016-05-21 09:02:04 +02:00
Trent White cffcc4c7a5 make footer unordered list. add new icons. 2016-05-20 16:44:19 -04:00
Trent White c727c3c441 resize and color of links 2016-05-20 15:58:14 -04:00
Torkel Ödegaard fb4dc77f36 docs(): updated changelog with 3.0.3 fixes 2016-05-20 15:26:19 +02:00
Torkel Ödegaard 9eb7b192b8 Merge branch 'master' of github.com:grafana/grafana 2016-05-20 15:16:05 +02:00
Torkel Ödegaard 06d63dda6e Merge branch 'v3.0.x' 2016-05-20 15:15:30 +02:00
Torkel Ödegaard e6f251011f fix(panel span): fixed issue setting panel span while in fullscren and also an issue when changing repeat variable while in fullscreen view, fixes #4957 2016-05-20 15:15:02 +02:00
Torkel Ödegaard 6a813aa33d fix(export): better error handling 2016-05-20 14:45:22 +02:00
bergquist 9d016a2756 feat(alerting): add migration for create and update 2016-05-20 14:23:24 +02:00
David J. Felix 441682b598 Fix linking for /dashboard-solo/ proxy prefix (#5116)
Fixes #5109
2016-05-20 14:01:12 +02:00
Mitsuhiro Tanda 9c672f6ec1 (prometheus) support new legend format (with backward compatibility) (#5096)
* (prometheus) support new legend format (with backward compatibility)

* (prometheus) use regex replace for legend format

* (prometheus) allow white space
2016-05-20 12:29:10 +02:00
Torkel Ödegaard 35c05463e7 Merge branch 'v3.0.x' 2016-05-20 12:23:50 +02:00
Torkel Ödegaard f00cbc0aeb fix(panel height): fixed issue with singlestat height, fixes #4679, fixes #4894, fixes #5113 2016-05-20 12:23:26 +02:00
Torkel Ödegaard ee86d24797 fix(elasticsearch): minor editor layout fix 2016-05-20 10:31:22 +02:00
Torkel Ödegaard 58a9324db0 Merge branch 'v3.0.x' 2016-05-20 10:24:54 +02:00
Torkel Ödegaard e0e8fd6637 fix(templating): fixed handling of numeric values in tempalting query results, fixes #5097 2016-05-20 10:24:24 +02:00
Torkel Ödegaard 2416ee04c8 fix(templating): fixed detection of nested template variables, fixes #5103 2016-05-20 09:58:07 +02:00
Torkel Ödegaard 91c6ebb06c Merge branch 'v3.0.x' 2016-05-20 09:06:39 +02:00
Torkel Ödegaard df0ddc0b50 fix(prometheus): fixed bug in prometheus query editor, fixes #5107 2016-05-20 09:03:52 +02:00
Torkel Ödegaard 2e02abffc0 fix(render): fixed issue with image renderer caused by disabling angular debug info 2016-05-20 08:34:35 +02:00
Torkel Ödegaard e47957ce6d Merge branch 'master' of github.com:grafana/grafana 2016-05-20 08:32:40 +02:00
Torkel Ödegaard c54e688272 Merge branch 'v3.0.x' 2016-05-20 08:31:51 +02:00
Torkel Ödegaard 37821e6d63 fix(share modal): fixed link in share modal when sub app url is /dashboard/, fixes #5109 2016-05-20 08:31:27 +02:00
Torkel Ödegaard a3ee388b66 Merge branch 'master' into query-part-refactor 2016-05-19 14:52:18 +02:00
Torkel Ödegaard 855e913bbd feat(dashboards): began work on dashboard list 2016-05-19 11:03:10 +02:00
Richard Hartmann 78360ece8a ISSUE_TEMPLATE.md: Improve wording and fix typos (#5101) 2016-05-19 10:59:38 +02:00
Richard Hartmann 7c46423727 ISSUE_TEMPLATE.md: Fix typo (#5099) 2016-05-19 10:34:12 +02:00
Torkel Ödegaard fb74d10573 feat(export): added grafana version to requires array, #5084 2016-05-19 10:21:16 +02:00
Torkel Ödegaard 430bcf192f feat(export): templetize annotations and template vars, #5084 2016-05-19 10:01:31 +02:00
Torkel Ödegaard cac723dab3 Merge branch 'master' into export-dashboard 2016-05-19 08:48:24 +02:00
bergquist 402499c071 Merge branch 'master' into alerting_definitions 2016-05-19 08:47:34 +02:00
bergquist 617d18e587 feat(panel): active tab is now placed in querystring aswell 2016-05-19 08:42:21 +02:00
bergquist a379b0057a feat(alerting): link to dashboard goes directly to alerting tab 2016-05-19 08:13:20 +02:00
bergquist ef4f5147be Merge branch 'master' into alerting_definitions 2016-05-19 08:05:35 +02:00
bergquist 2b06ceda71 feat(panels): adds queryparameter for choose active tab in edit mode 2016-05-19 08:00:48 +02:00
Torkel Ödegaard 1bb4ca22e7 fix(test): fixed failing unsaved changes test 2016-05-19 07:58:44 +02:00
Tim Bielawa 24a410ae8f docs(preferences): Document user and org preferences (#5087)
closes #5069
2016-05-18 18:31:59 +02:00
Torkel Ödegaard 673984a7db feat(export): more export stuff 2016-05-18 15:53:13 +02:00
Torkel Ödegaard 10339090b8 fix(annotations): fixed annotation error handling, fixes #5077 2016-05-18 15:22:40 +02:00
Torkel Ödegaard b6dcf6bd02 Merge branch 'v3.0.x' 2016-05-18 14:23:59 +02:00
Torkel Ödegaard 280e7bb04d Merge branch 'master' of github.com:grafana/grafana 2016-05-18 14:23:41 +02:00
Torkel Ödegaard 03551a5961 Merge remote-tracking branch 'origin/development' 2016-05-18 14:23:21 +02:00
Torkel Ödegaard d474eba53a fix(logging): fixed reading config level from config file, fixes #5079 2016-05-18 14:18:08 +02:00
Mitsuhiro Tanda 392cb2a714 (cloudwatch) update changelog (#5080)
* update cloudwatch.md

* update changelog
2016-05-18 13:27:19 +02:00
bergquist 92ac370415 tech(docker): rename fake data writers 2016-05-18 12:29:37 +02:00
Torkel Ödegaard c41e3dcb91 updated changelog 2016-05-18 12:04:37 +02:00
Torkel Ödegaard 602d1a5fbc Merge branch 'v3.0.x' 2016-05-18 12:02:53 +02:00
Torkel Ödegaard cd80884b76 fix(dashboard timepicker): fixed issue with time picker and UTC when reading time from url, fixes #5078 2016-05-18 12:01:11 +02:00
Torkel Ödegaard bfadc932d7 Merge branch 'master' of github.com:grafana/grafana 2016-05-18 11:50:56 +02:00
Torkel Ödegaard 0cd2e150d5 feat(snapshots): performance improvements to deep clone, makes snapshot's a lot quicker for big dashboards with a lot of panels and data 2016-05-18 11:50:40 +02:00
Carl Bergquist 5aaaeb05a0 Merge pull request #5075 from mtanda/prometheus_templating_fix
(prometheus) fix metric find query
2016-05-18 11:40:33 +02:00
Torkel Ödegaard 26ea0bc360 feat(export): work on export 2016-05-18 11:11:53 +02:00
Mitsuhiro Tanda a86d218891 (prometheus) fix metric find query 2016-05-18 16:36:57 +09:00
Torkel Ödegaard 6632f883c0 Merge branch 'master' into export-dashboard
Conflicts:
	.floo
	.flooignore
2016-05-18 08:08:15 +02:00
Mitsuhiro Tanda 66bcae353c (prometheus) pass dashboard time range to template query (#5007)
* (prometheus) pass dashboard time range to template query

* (prometheus) add passing time test of templating
2016-05-18 07:56:23 +02:00
Mitsuhiro Tanda 07d355851e (cloudwatch) assume role support (#5065)
* (cloudwatch) assume role support

* save godep

* (cloudwatch) add assumeRoleArn field

* (cloudwatch) set cred provider for sts

* (cloudwatch) fix test
2016-05-18 07:54:24 +02:00
Mitsuhiro Tanda 8d2f350ad1 (prometheus) fix prometheus link 2016-05-18 07:50:30 +02:00
Mitsuhiro Tanda fc1891320e (prometheus) fix prometheus link (#5074) 2016-05-18 07:49:32 +02:00
Utkarsh Bhatnagar 8a9455d901 Fixed singlestat mapping typo (#5070) 2016-05-18 07:44:01 +02:00
Torkel Ödegaard 46b6ab7db7 Merge branch 'master' of github.com:grafana/grafana 2016-05-17 21:51:31 +02:00
Torkel Ödegaard 958f97232f fix(pluginlist): fixed issue with plugin list, fixes #5068 2016-05-17 21:51:19 +02:00
Torkel Ödegaard 05d064ca8d export(): moved to share modal 2016-05-17 21:18:47 +02:00
Carl Bergquist 47f88346d2 Merge pull request #5058 from hijklmno/master
Add dBm as an option in energy units
2016-05-17 15:57:05 +02:00
bergquist b5fc12fb80 docs(opentsdb): add working image of add datasource for opentsdb
closes #4984
2016-05-17 15:32:33 +02:00
Torkel Ödegaard 83f5080274 feat(angular): disable debug in production for angular compiler 2016-05-17 15:00:48 +02:00
Torkel Ödegaard c133a00125 feat(alerting): minor progress on scheduler 2016-05-17 14:31:52 +02:00
Torkel Ödegaard df50fa2332 feat(export): export dashboard modal 2016-05-17 11:17:11 +02:00
Torkel Ödegaard ad7a1e15b4 feat(export): began working on export modal 2016-05-17 10:29:57 +02:00
bergquist efe6fd154b tech(docker): add default writer for influxdb 2016-05-17 09:03:52 +02:00
bergquist fb8296524e tech(docker): add default fake-data-gen for prometheus 2016-05-17 09:03:52 +02:00
Torkel Ödegaard 00957a42d4 Merge branch 'v3.0.x' 2016-05-17 08:40:28 +02:00
Torkel Ödegaard 99db89067e fix(): reverted RESTART_ON_UPGRADE change 2016-05-17 08:34:34 +02:00
hijklmno f1b5a265ab fix trailing whitespace in kbn.js 2016-05-16 15:35:42 -07:00
hijklmno 451e917e7d Add dBm as an option in energy units 2016-05-16 15:24:31 -07:00
Torkel Ödegaard d443079cf6 fix(): fixed sass issue 2016-05-16 18:48:13 +02:00
Torkel Ödegaard 163e55c0eb Update latest.json 2016-05-16 18:07:42 +02:00
bergquist fa19e0d9c6 style(modal): use standard valid styles 2016-05-16 17:03:01 +02:00
bergquist 6435fa6b99 fix(modal): add undefined check 2016-05-16 16:48:28 +02:00
bergquist 8dbb5bad4b test(alerting): fix broken unit tests 2016-05-16 16:20:28 +02:00
Torkel Ödegaard 77b7cdfadb feat(alerting): added few fields to alert rule 2016-05-16 15:39:09 +02:00
bergquist 2ce9d4571c fix(alerting): fix spacing 2016-05-16 14:29:54 +02:00
Torkel Ödegaard 495404ef73 Merge branch 'master' into alerting_definitions 2016-05-16 14:12:56 +02:00
Torkel Ödegaard 09f11cf66e updated 2016-05-16 14:11:55 +02:00
Torkel Ödegaard 4ea3002572 added floobits stuff 2016-05-16 14:02:34 +02:00
Torkel Ödegaard 840cd7b2e1 doc(): updated changelog 2016-05-16 13:58:38 +02:00
Torkel Ödegaard 0760528f4a Merge branch 'v3.0.x' 2016-05-16 13:57:44 +02:00
Torkel Ödegaard 7f0fe31881 docs(): updated download links 2016-05-16 13:41:50 +02:00
Mitsuhiro Tanda f585d22ce7 (templating) update dynamic dashboard only if variable is changed 2016-05-16 19:26:24 +09:00
bergquist 80f7fe8646 feat(alerting): add confirm text dialog when deleting dashboards with alerts 2016-05-16 11:54:28 +02:00
Torkel Ödegaard 2be8658034 Merge remote-tracking branch 'origin/development' 2016-05-16 11:40:12 +02:00
Torkel Ödegaard 494bee1d6b bumped version 2016-05-16 11:39:16 +02:00
bergquist 31698a1c55 Merge branch 'master' into alerting_definitions 2016-05-16 09:28:14 +02:00
bergquist 0c345e2b09 docs(changelog): remove invalid chars 2016-05-16 09:06:39 +02:00
Carl Bergquist adce8c15bb Merge pull request #5041 from LindsayHill/patch-1
Fixed minor typo s/seperate/separate/
2016-05-15 22:25:15 +02:00
Torkel Ödegaard 7cd663bbe8 feat(import): more import work 2016-05-14 10:00:43 +02:00
Lindsay Hill 85758a2dd2 Fixed minor typo s/seperate/separate/
Fixed small typo in help text
2016-05-14 17:51:08 +12:00
Utkarsh Bhatnagar 7bc15ec6c1 [Bug Fix] Opentsdb Alias issue (#4910)
* Fixed Opentsdb Alias issue

* Fixed Opentsdb query editor
2016-05-13 22:22:56 +02:00
Torkel Ödegaard d9d46096dd feat(import): lots of work on dashboard import 2016-05-13 17:39:22 +02:00
bergquist da68f7d31a feat(docker): fake data writer for opentsdb 2016-05-13 16:53:28 +02:00
bergquist 41ed0e670a feat(docker): fake data writer for graphite 2016-05-13 16:25:03 +02:00
bergquist 579b36754a Merge branch 'master' into development 2016-05-13 14:30:47 +02:00
bergquist e50211572f docs(changelog): add note about fix for graph panel 2016-05-13 13:54:39 +02:00
bergquist 6849bfae16 fix(graph): fixes broken hide xaxis option
closes #5024
2016-05-13 13:52:57 +02:00
bergquist c3f1d1a647 fix(influxdb): fixes extra semi colon due to hidden series
closes #5005
2016-05-13 13:36:57 +02:00
bergquist ac674bd405 docs(changelog): add note about graph fix 2016-05-13 12:23:58 +02:00
bergquist d5899aacfb fix(graph-panel): fixes broken PNG rendering
When refactoring y-axies for graph panel these
was forgotten and which caused the graphite datasource
to send invalid data.

closes #5025
2016-05-13 12:20:39 +02:00
bergquist 9e5a8c3fc8 docs(changelog): add info about configurable theme 2016-05-13 11:38:54 +02:00
Carl Bergquist 83707f7b35 Merge pull request #5011 from acmnu/default_theme
Add new parameter to config: default_theme.
2016-05-13 11:36:32 +02:00
Torkel Ödegaard ca8df67947 feat(import): things are starting to work 2016-05-13 11:26:02 +02:00
Mitsuhiro Tanda 3b85901b95 reflect panel repeat status when variable updated 2016-05-13 16:29:11 +09:00
Prajwal Rao 3feb6492e6 fixed datasources icon (#5015) 2016-05-12 21:49:58 +02:00
Anton Chevychalov c6744925c4 Add new parameter to config: default_theme. 2016-05-12 18:21:11 +03:00
bergquist 88b2f48493 Merge branch 'master' into development 2016-05-12 16:22:18 +02:00
Torkel Ödegaard 0d3e06e68a feat(wizard): merged wizard poc 2016-05-12 14:45:32 +02:00
Torkel Ödegaard bf890719ff Merge remote-tracking branch 'origin/wizard' into export-dashboard2 2016-05-12 10:52:24 +02:00
Torkel Ödegaard 28eae1e7ff Merge branch 'master' into export-dashboard
Conflicts:
	packaging/publish/publish.sh
	public/app/features/dashboard/dynamicDashboardSrv.js
	public/test/specs/dynamicDashboardSrv-specs.js
2016-05-12 10:50:37 +02:00
Dan Cech 9f9f4e7fef use new plugin-specific repo route when installing or updating a single plugin (#4992) 2016-05-12 10:43:31 +02:00
Denny Schäfer 2f6b00b6f7 Add What's New in Grafana 3.0 link into the readme (#5001) 2016-05-12 10:41:36 +02:00
Torkel Ödegaard 35f55cabf0 fix(templating): improved detection of nested template variables, fixes #4986, fixes #4987 2016-05-12 10:41:15 +02:00
Torkel Ödegaard 0201ac24e7 fix(templating): fixed issue with mixing repeated row and repeated panel, fixes #4988 2016-05-12 10:31:36 +02:00
Torkel Ödegaard 731c35540f packaging(): default RESTART_ON_UPGRADE to true, closes #4993 2016-05-12 07:29:33 +02:00
Dan Cech dac62ec560 fix rpm download link 2016-05-11 14:09:03 -04:00
Torkel Ödegaard 2c7447eaca feat(): started work on new import system 2016-05-11 16:18:52 +02:00
Torkel Ödegaard b170b6ec8b feat(query part): moved query part editor from influxdb to core 2016-05-11 14:52:44 +02:00
bergquist e69658128c docs(alerting): change api url layout 2016-05-11 14:08:45 +02:00
Torkel Ödegaard 8a3bdb3685 fix(typo): corrected spelling in error message, fixes #4982 2016-05-11 13:21:25 +02:00
Torkel Ödegaard 85e8cba7a1 Merge branch 'master' of github.com:grafana/grafana 2016-05-11 13:20:14 +02:00
Torkel Ödegaard 56bf9c5612 fix(): changed how package iteration/build is generated 2016-05-11 13:20:01 +02:00
bergquist c76c2f30a8 tech(alerting): add default values for alerts 2016-05-11 13:04:03 +02:00
bergquist b58be91e71 feat(alerting): add delete button for removing alerts 2016-05-11 11:11:45 +02:00
bergquist 18bf2b2391 docs(alerting): add syles for optional params 2016-05-11 10:47:51 +02:00
Torkel Ödegaard 549eb15c32 Update latest.json 2016-05-11 10:37:21 +02:00
Torkel Ödegaard 03663c5b28 docs(): updated download links 2016-05-11 10:23:17 +02:00
Torkel Ödegaard bbd52c0b71 changelog(): updated and updated version 2016-05-11 09:36:07 +02:00
Trent White 995f6be2c4 old grafana wordmark was still showing on login and sidebar (#4972) 2016-05-11 09:08:25 +02:00
Torkel Ödegaard 5b42753b8b feat(export): progress on dashboard export 2016-05-10 21:09:15 +02:00
Torkel Ödegaard 959714a6ef feat(docs): updated what's new article 2016-05-10 20:33:42 +02:00
Torkel Ödegaard 79a8017fe9 feat(export): more progress on dashboard export 2016-05-10 20:31:47 +02:00
Leandro Piccilli 0d34740a62 Add support to ElasticSearch 5.0 2016-05-10 19:38:22 +02:00
Carl Bergquist e4a24e1785 Merge pull request #4969 from peggyl/peggyl/fix-update-checker-typo
Fix typo in error message from update checker
2016-05-10 18:17:09 +02:00
Peggy Li 9b0da20d90 Fix typo in error message from update checker 2016-05-10 16:06:51 +00:00
Torkel Ödegaard db664c61a4 Merge branch 'master' into export-dashboard 2016-05-10 16:46:58 +02:00
bergquist dd47f7382a docs(alerting): initial info 2016-05-10 16:40:46 +02:00
Torkel Ödegaard c299b86983 docs(): updated readme 2016-05-10 16:33:05 +02:00
bergquist 33108df13f docs(conf): add warning about alerting in conf file 2016-05-10 16:32:20 +02:00
Torkel Ödegaard 56e53d7da2 docs(): update readme dependency section 2016-05-10 16:07:59 +02:00
Torkel Ödegaard d676840258 docs(): added homebrew info to mac install docs 2016-05-10 16:02:00 +02:00
Torkel Ödegaard cca37caf33 feat(prometheus): began work on prometheus query model 2016-05-10 15:48:07 +02:00
bergquist 1fe2055743 tech(alerting): disable DEL for alert rules in the api 2016-05-10 15:02:11 +02:00
Torkel Ödegaard 4358687bfa Merge branch 'master' into query-part-refactor 2016-05-10 14:38:49 +02:00
Torkel Ödegaard ae66c3f289 fix(influxdb): minor editor display fix 2016-05-10 14:38:11 +02:00
Torkel Ödegaard d3bbc245c9 feat(query_part): began query part refactor to be able to reuse it in prometheus query editor 2016-05-10 14:32:25 +02:00
bergquist 5ee1b6ca97 docs(changelog): add note about merged PR 2016-05-10 12:54:25 +02:00
Carl Bergquist c522341136 Merge pull request #4944 from Gueust/optional_tooltip_ordering
Add optional tooltip ordering (against the development branch)
2016-05-10 12:51:44 +02:00
bergquist 2cebe151f2 Merge branch 'master' into development 2016-05-10 12:40:17 +02:00
Torkel Ödegaard ecf5b61e86 Update ISSUE_TEMPLATE.md 2016-05-10 11:36:45 +02:00
Richard Hartmann c01ab63744 ISSUE_TEMPLATE.md: different layout (#4960) 2016-05-10 11:33:33 +02:00
Torkel Ödegaard 72b324c95b fix(go16): fixed hang with go 1.6 by updating sqlite3, fixes #4367 2016-05-10 11:22:06 +02:00
bergquist 1bb8bc58b8 feat(alerting): add parameteters for filtering alerts 2016-05-10 09:45:56 +02:00
minkikim89 0c5abc491d Update index.md (#4956) 2016-05-10 08:44:18 +02:00
bergquist b8421a478f feat(alerting): move state filter to the right 2016-05-10 08:26:40 +02:00
bergquist 2ddffc8234 feat(alerting): add support for multiple state in ui 2016-05-09 16:32:35 +02:00
bergquist b2cf2e877a test(alerting): improve unit test 2016-05-09 15:19:11 +02:00
bergquist 9da2e6e907 feat(alerting): update path 2016-05-09 15:17:26 +02:00
bergquist 1be513fabd feat(alerting): add support for alert page filter 2016-05-09 14:44:44 +02:00
LaszloHont a5e2e59385 Clarify admin_password (#4948)
Closes #4923
2016-05-09 13:44:11 +02:00
bergquist 3e462f2914 chore(alerting): style refactoring 2016-05-09 12:10:53 +02:00
bergquist 35c73902da Merge branch 'master' into alerting_definitions 2016-05-09 11:34:56 +02:00
bergquist 47070f2d1f chore(alerting): struct names and url refactoring 2016-05-09 11:25:21 +02:00
Torkel Ödegaard 040dd91d2e fix(templating): fixed issue with current data source variable value, fixes #4934 2016-05-09 10:17:30 +02:00
Torkel Ödegaard c6c07599c7 conf(): updated comments in config file, fixes #4933 2016-05-09 09:21:33 +02:00
Peggy Li 04ef25b6ff Set custom type for templating variables (#4941) 2016-05-07 07:58:01 +02:00
bergquist 74d5410a38 feat(alerting): add inital doc page 2016-05-06 15:59:38 +02:00
Carl Bergquist 05ca7158d6 Merge pull request #4886 from Gueust/contribute_doc
Add documentation on the build system for occasional contributors
2016-05-06 15:04:14 +02:00
bergquist 27274f37e8 feat(alerting): update paths for alert state 2016-05-06 14:37:41 +02:00
Torkel Ödegaard c7e7a0cd16 fix(singlestat): rerender singlestat and reevaluate thresholds on render, fixes #4920 2016-05-05 10:29:14 +02:00
Utkarsh Bhatnagar 70f7177025 Fixed deleting row bug (#4919) 2016-05-05 09:57:21 +02:00
Mathieu Payeur Levallois c86cdb1805 opentsdb: apply templating on filters (#4594) 2016-05-04 13:47:05 +02:00
Torkel Ödegaard bd15534360 fix(singlestat gauge): better font size handling for gauge, now value font size is used as scaling factor, fixes #4876 2016-05-04 11:46:21 +02:00
Carl Bergquist e30745f19c Merge pull request #4881 from mmckinst/kairosdb_broken_image
fix broken link for kairosdb image
2016-05-04 11:05:05 +02:00
Idan Zalzberg bca8d6d07b singlestat/module.ts onDataError was calling onDataReceived incorrectly (#4897)
onDataError was calling onDataReceived with {data : []} which breaks at the first line since object has no map function.
The correct form is probably just []
2016-05-04 10:48:01 +02:00
Martin Häger 0764a4313b AWS Elasticsearch Service Dimensions (#4903) 2016-05-04 10:47:35 +02:00
Denny Schäfer e0ef6dd8d4 Fix changelog formatting for 3.0.0-beta7 (#4905) 2016-05-04 10:47:17 +02:00
bergquist 3d366c2a4c feat(graphs): align forms for line mode checkbox 2016-05-04 10:42:12 +02:00
Carl Bergquist 2018e30366 Merge pull request #4902 from idanz/patch-4
Bring back threshold line mode
2016-05-04 10:39:36 +02:00
bergquist 26941284da feat(alerting): add limit and since id options for alert logs 2016-05-04 09:57:53 +02:00
fg2it 303cd8a5af [RenderToPng fix] (#4901)
* removing useless code

* fix various minor typo

* don't silence phantomjs timeout and allow more time

* fix gofmt
2016-05-04 09:07:45 +02:00
bergquist 7757d6d636 feat(alerting): set default title for alerts 2016-05-04 08:22:44 +02:00
Idan Zalzberg 2f7af968bf Bring back threshold line mode
Threshold line mode was somehow discarded from the HTML in the ui redesign, this brings it back
2016-05-04 10:04:00 +07:00
Matt Toback 543d247af8 Wrapped the form in a form tag and added a submit, the ng-click shoudl work the same, but now enter works. @torkelo, pls review (#4898) 2016-05-03 21:02:57 +02:00
Jean-Baptiste Lespiau ca1182e783 Stress the required version of node JS 2016-05-03 19:10:32 +02:00
Jean-Baptiste Lespiau a34a784b43 Add more documentation on how to contribute
Add more documentation on how to fork the project, and how to
build on changes using grunt
2016-05-03 19:10:31 +02:00
Torkel Ödegaard 3bd4b5ccc6 Merge branch 'master' of github.com:grafana/grafana 2016-05-03 19:00:57 +02:00
Torkel Ödegaard f4a013946f feat(pluginlist): link in plugin list now goes to app/plugin default nav unless enabled 2016-05-03 19:00:42 +02:00
Matt Toback d2fd829a58 Update module.html 2016-05-03 12:42:37 -04:00
bergquist 2ccb3956a6 feat(alerting): set default value for query 2016-05-03 17:55:41 +02:00
bergquist 1624dc9dfd feat(alerting): separate operator and level 2016-05-03 17:31:04 +02:00
bergquist 27c34745a6 feat(alerting): add link to alerts in side menu 2016-05-03 16:46:10 +02:00
Torkel Ödegaard bb6f4fff87 feat(export/import): minor progress 2016-05-03 16:40:21 +02:00
bergquist 4ea0e6ca93 feat(alerting): remove delete option from alerts page 2016-05-03 16:39:52 +02:00
bergquist 3c7e793c1f feat(alerting): add color to alert state icons 2016-05-03 16:36:49 +02:00
bergquist b0a16a9e6b Merge branch 'master' into alerting_definitions 2016-05-03 14:32:31 +02:00
Torkel Ödegaard 5ffd57695c feat(table): added support for column units overriding style units for table 2016-05-03 11:29:51 +02:00
bergquist 02ae1f79f7 docs(changelog): add node about range to text mappings in singlestat 2016-05-03 10:42:01 +02:00
Torkel Ödegaard f42b47e65b Merge branch 'master' into export-dashboard
Conflicts:
	public/app/features/dashboard/dashnav/dashnav.ts
2016-05-03 10:26:40 +02:00
Torkel Ödegaard 6dc24ab2d7 Merge branch 'master' of github.com:grafana/grafana 2016-05-03 10:25:16 +02:00
Torkel Ödegaard fe0b7533a1 fix(influxdb): quote number valued tag values, only not quote when operator is > or <, fixes #4885 2016-05-03 10:25:06 +02:00
Utkarsh Bhatnagar b8d861edc1 Fixed query editor UI for keywords (#4890) 2016-05-03 10:09:03 +02:00
Torkel Ödegaard de26a17dc7 feat(footer): began work on page footer 2016-05-03 09:00:58 +02:00
Mark McKinstry 37907e4110 fix broken link for kairosdb image 2016-05-02 12:31:39 -04:00
bergquist 1c082670c4 feat(alerting): make alertname link to status page 2016-05-02 18:06:17 +02:00
bergquist 7c5c7c6f32 feat(alerting): renames go to dashboard -> edit 2016-05-02 18:02:33 +02:00
bergquist bac89775e2 tech(alerting): fixes broken refactoring 2016-05-02 18:00:10 +02:00
bergquist 9083392341 feat(alerting): to straight for panel in alert link 2016-05-02 17:37:08 +02:00
Torkel Ödegaard 152e085310 fix(elasticsearch): minor form fix to elastic query editor 2016-05-02 16:34:07 +02:00
bergquist b606d9b7da test(alerting): fixes broken test 2016-05-02 16:27:02 +02:00
bergquist 743a6fa37c feat(alerting): add support for deleting alert rules 2016-05-02 16:07:19 +02:00
Torkel Ödegaard 372b394f5b Merge branch 'master' of github.com:grafana/grafana 2016-05-02 15:41:20 +02:00
bergquist a573d2504c feat(alerting): pixels have been pushed 2016-05-02 15:37:18 +02:00
Torkel Ödegaard 3889052c31 docs(): added whats new in v3 guide 2016-05-02 15:35:49 +02:00
bergquist 05459de344 feat(alerting): add gf icons for alerts page 2016-05-02 15:31:40 +02:00
bergquist 3eab0cde70 feat(alerting): add gf icons for alert state page 2016-05-02 15:20:58 +02:00
Torkel Ödegaard 43182cb1eb updated 2016-05-02 14:49:50 +02:00
bergquist 9c5b4e6f25 feat(alerting): auto convert thresholds if existing 2016-05-02 14:41:29 +02:00
bergquist bc892789c1 feat(alerting): change state from ALERT to CRITICAL 2016-05-02 14:33:38 +02:00
bergquist ca959d1ab0 Merge branch 'master' into alerting_definitions 2016-05-02 13:22:58 +02:00
bergquist de5a39f320 Revert "Revert "Merge branch 'utkarshcmu-rangeMaps'""
This reverts commit 58b91befde.
2016-05-02 13:17:57 +02:00
bergquist 58b91befde Revert "Merge branch 'utkarshcmu-rangeMaps'"
This reverts commit 8f976fd980, reversing
changes made to 072f51e300.
2016-05-02 13:15:18 +02:00
bergquist 8f976fd980 Merge branch 'utkarshcmu-rangeMaps' 2016-05-02 13:10:17 +02:00
bergquist 91047ffa30 tech(singlestat): convert to gf-form 2016-05-02 12:43:07 +02:00
bergquist b42064acdb tech(singlestat): fixes indentation 2016-05-02 10:40:28 +02:00
bergquist 7e220b2b9e Merge branch 'rangeMaps' of https://github.com/utkarshcmu/grafana into utkarshcmu-rangeMaps 2016-05-02 10:26:30 +02:00
Torkel Ödegaard 072f51e300 fix(): updated changelog 2016-05-02 10:18:22 +02:00
Torkel Ödegaard af95993d6d feat(): updated download links 2016-05-02 09:54:11 +02:00
Torkel Ödegaard e6bccc5eff feat(influxdb): Added new functions moving_average and difference to query editor, closes #4698 2016-05-02 09:07:44 +02:00
yershalom 1b262d33f3 Added json to file name when exporting dashboard (#4869) 2016-05-01 15:31:01 +02:00
Jean-Baptiste Lespiau c555bbce3d Add optional tooltip ordering 2016-05-01 01:32:36 +02:00
Utkarsh Bhatnagar f6d538bb98 Bug fix, match tooltip timezone to X-axis timezone (#4855)
* Bug fix, match tooltip timezone to X-axis timezone

* Small improvement
2016-04-30 16:41:24 +02:00
joelanford cbefd8f8ae Fixed legend labeling bug in Prometheus datasource (#4858) 2016-04-30 16:40:41 +02:00
Torkel Ödegaard 736ee3ffff fix(influxdb): Fixed issue with missing plus group by icon, fixes #4862 2016-04-30 16:35:42 +02:00
Torkel Ödegaard 36c583dddf fix(graphite): Fixed issue graphite png rendering option, fixes #4864 2016-04-30 16:26:25 +02:00
Torkel Ödegaard 70d03b7a1c fix(query editor): Fixed issue with removing query for data sources without collapsable query editors, fixes #4856 2016-04-29 23:20:48 +02:00
Torkel Ödegaard 0d85254a19 fix(annotations): Fixed issue with entering annotation edit view, fixes #4857 2016-04-29 23:14:39 +02:00
Torkel Ödegaard e3376136ca fix(css): Fixed max dashboard title width (media query) for large screens, fixes #4859 2016-04-29 23:07:37 +02:00
bergquist de7544fabd fix(alerting): set alertin enabled to false 2016-04-29 15:40:16 +02:00
Torkel Ödegaard f8b4fcdc42 Merge branch 'master' into export-dashboard
Conflicts:
	packaging/publish/publish.sh
2016-04-29 15:01:47 +02:00
Torkel Ödegaard 2546ec062b Merge branch 'master' into dash-edit-mode
Conflicts:
	public/app/features/dashboard/partials/settings.html
2016-04-29 14:50:17 +02:00
bergquist 6d66d9f42d feat(alerting): adds fearture toogle for alerting 2016-04-29 14:35:58 +02:00
Torkel Ödegaard 6c340dcb65 docs(): updated download links 2016-04-29 11:24:43 +02:00
Torkel Ödegaard 6b467d5b3e fix(): spelling fix in templating editor 2016-04-29 08:40:53 +02:00
Archit Sharma 5372bcc7a2 fixes #4849 - minor fix for metric-segment-model (agg.field) 2016-04-29 07:21:52 +02:00
Lucas Costa 9b84b88518 Add support to Elasticsearch precision_threshold 2016-04-28 19:23:45 -03:00
Torkel Ödegaard 0c9a19e38c Merge branch 'ds-template-var' 2016-04-28 19:31:56 +02:00
Torkel Ödegaard 8b4c7c94b8 feat(templating): completed work on templating as data source, closes #816 2016-04-28 19:31:43 +02:00
Torkel Ödegaard c4440eab4c fix(dashboard): fixed issue with render event after resize 2016-04-28 19:15:54 +02:00
Torkel Ödegaard 7349427189 feat(data source variable): progress on data source as variable 2016-04-28 19:08:35 +02:00
Torkel Ödegaard 89ea25ca08 feat(templating): minor sort fix 2016-04-28 18:26:41 +02:00
bergquist bd30a4d23e Merge branch 'master' into alerting_definitions 2016-04-28 16:04:28 +02:00
bergquist 16cede30f6 feat(alerting): move alertingtab to seperate directive 2016-04-28 16:03:14 +02:00
Torkel Ödegaard 5d652dcaef fix(table): table column sorting fix 2016-04-28 15:48:49 +02:00
Torkel Ödegaard d69788c9df Merge branch 'master' of github.com:grafana/grafana 2016-04-28 15:30:09 +02:00
Torkel Ödegaard 69c2fafa7a feat(elasticsearch): added geo hash bucket aggregation 2016-04-28 15:29:54 +02:00
bergquist f442adca47 feat(alerting): adds api endpoints for alerts per dashboard and panel 2016-04-28 15:13:42 +02:00
Torkel Ödegaard 620e3a602d Merge pull request #4842 from grafana/pluginSettingFix
allow updates to secureJsonData.
2016-04-28 13:07:39 +02:00
woodsaj ad8dbbb559 allow updates to secureJsonData.
SecureJsonData is stored as a json object in the DB. As the
secureJsonData is never returned to the user they are unable
to provide the full json object when performing updates instead
the user can only provide the specific keys they wish to update.
This commit ensures that only the provided keys are updated and
existing keys in the secureJsonData object are left untouched.
2016-04-28 18:39:23 +08:00
bergquist 1f414c1372 test(alerting): add test that validates rule updates do not change state 2016-04-28 11:47:14 +02:00
bergquist ecfbc2edca feat(alerting): adds alert history page 2016-04-28 11:42:03 +02:00
bergquist 5bc3672296 Merge branch 'master' into alerting_definitions 2016-04-28 11:03:33 +02:00
bergquist 0f0fa0c257 feat(alerting): adds endpoint for getting alert states log 2016-04-28 10:59:46 +02:00
Torkel Ödegaard 5a241a8290 fix(): minor query editor fix 2016-04-28 10:29:36 +02:00
Torkel Ödegaard 4a332065d0 changelog(): updated changelog with notice about new query editors, closes #3900 2016-04-28 10:22:17 +02:00
Torkel Ödegaard 0e4b70a4a8 feat(query_editors): more work 2016-04-28 10:13:18 +02:00
bergquist 3ecc13506c feat(alerting): adds alert state go ui 2016-04-28 08:53:34 +02:00
bergquist 1631673485 feat(alerting): dont change state when updating alert definitions 2016-04-28 08:42:51 +02:00
bergquist e7be7d2835 feat(alerting): add api endpoint for alert state 2016-04-28 08:23:50 +02:00
Torkel Ödegaard f1d4fd3e67 feat(query editors): changed chevron position 2016-04-27 21:24:41 +02:00
Torkel Ödegaard 7b560f9080 feat(query editors): converted OpenTSDB editor to new form styles 2016-04-27 16:29:59 +02:00
bergquist 6a5ecb3fca feat(alerting): adds basic page for listing alerts 2016-04-27 13:02:28 +02:00
bergquist 3cf6532515 feat(alerting): add json encoding name for properties 2016-04-27 11:44:04 +02:00
Torkel Ödegaard 0ebd921bbb feat(query editors): updated cloudwatch to new form styles 2016-04-27 11:07:26 +02:00
Torkel Ödegaard 206cb51219 feat(query editors): updated prometheus editor 2016-04-27 10:50:29 +02:00
Torkel Ödegaard 5e6485c210 feat(query editors): minor progress 2016-04-27 10:16:04 +02:00
bergquist 44dd98e277 tech(alerting): rename alerting sql server 2016-04-27 09:25:11 +02:00
bergquist 7041169ffb feat(alerting): add datasource name field 2016-04-27 09:06:19 +02:00
bergquist 973db1ac38 feat(alerting): add api route for alert changes 2016-04-27 08:59:33 +02:00
Torkel Ödegaard 65b4945548 Merge branch 'master' into query-editor-style 2016-04-27 08:43:34 +02:00
bergquist 2e097f4af1 Merge branch 'master' into alerting_definitions 2016-04-26 17:38:29 +02:00
bergquist 9b50313f11 feat(alerting): add api endpoints for listing alerts 2016-04-26 17:36:50 +02:00
bergquist 996eec3ce2 tech(alerting): refactored save alerts code 2016-04-26 16:31:13 +02:00
bergquist 55e83a3d62 feat(alerting): rename alerting dashboard names 2016-04-26 16:06:29 +02:00
bergquist 3ef2be13df feat(alerting): move alert deletion to alert code 2016-04-26 15:48:29 +02:00
Torkel Ödegaard aa98ada141 fix(snapshots): fixed snapshot issue introdiuced yesterday 2016-04-26 14:51:06 +02:00
Torkel Ödegaard 26eeb6578d feat(gauge): polish to gauge, better handling of automatic font size, added option to hide threshold markers 2016-04-26 13:50:04 +02:00
Torkel Ödegaard 8bb07124f7 fix(gauge): validate min / max range, fixes #4820 2016-04-26 13:14:43 +02:00
Torkel Ödegaard bce5c447b3 fix(apps): app dashboards can now be updated, fixes #4817 2016-04-26 12:52:44 +02:00
Torkel Ödegaard 34cb17546d fix(): minor fix for event emitter 2016-04-26 12:39:24 +02:00
utkarshcmu c1cd1fedf4 Added relevant tests 2016-04-26 02:57:46 -07:00
utkarshcmu 5defc2a3d2 Fixed remove mapping function 2016-04-26 02:57:46 -07:00
utkarshcmu 7b2a21994f Moved mappings to new tab, added rangeMaps feature 2016-04-26 02:57:45 -07:00
Torkel Ödegaard 7c06604f16 Merge branch 'master' of github.com:grafana/grafana 2016-04-26 11:00:20 +02:00
Torkel Ödegaard 0762c38d35 fix(ds_edit): dont show warning when data source does not support testing, fixes #4811 2016-04-26 10:59:57 +02:00
bergquist baac7809c5 docs(changelog): add notes about fixes for singlestat 2016-04-26 10:04:39 +02:00
bergquist 79ed99a940 fix(singlestat): fixes font size diffs for gauge 2016-04-26 10:00:13 +02:00
Torkel Ödegaard bca0894f73 feat(query editors): progress on query editors 2016-04-26 09:58:55 +02:00
bergquist 9316bcf307 fix(singlestat): enables autoupdate on change
closes #4809
closes #4812
2016-04-26 09:51:31 +02:00
Torkel Ödegaard 60855643c4 Merge pull request #4807 from grafana/makefile
add basic Makefile, remove need for global grunt-cli
2016-04-25 19:01:44 +02:00
Dan Cech 650bb4c719 use npm test to run npm tests 2016-04-25 12:53:15 -04:00
Dan Cech 2244224b12 add basic Makefile, remove need for global grunt-cli 2016-04-25 12:44:26 -04:00
bergquist bb42579b0f Merge branch 'master' into alerting_definitions 2016-04-25 16:42:33 +02:00
bergquist ddd826616b feat(alerting): serialize whole target obj from dashboard 2016-04-25 16:38:27 +02:00
bergquist 25f6ec8b53 feat(alerting): add support for alert_rule updates 2016-04-25 16:18:28 +02:00
Torkel Ödegaard bbf4d00319 fix(query editors): added select style to segment, used by data source selector 2016-04-25 15:49:33 +02:00
Torkel Ödegaard 6b813b4e2a feat(query editors): remember collapsed state 2016-04-25 15:11:40 +02:00
bergquist c83af353b2 feat(alerting): renames alert table to alert_rule 2016-04-25 14:42:24 +02:00
Torkel Ödegaard 529cb43397 Merge branch 'master' of github.com:grafana/grafana into query-editor-style 2016-04-25 14:30:41 +02:00
Torkel Ödegaard 6bc898b215 fix(influxdb): fixed issue with using multi value template vars in influxdb measurement clause, fixes #4797 2016-04-25 14:29:51 +02:00
Torkel Ödegaard 1a433de0b4 Merge branch 'master' into query-editor-style 2016-04-25 14:22:36 +02:00
Torkel Ödegaard 4d802df040 fix(influxdb): fixed issue with using multi value template vars in influxdb measurement clause, fixes #4797 2016-04-25 14:22:15 +02:00
bergquist 8ca7ccae38 feat(alerting): add functionallity for converting tresholds to alerts 2016-04-25 14:18:45 +02:00
Torkel Ödegaard 04a79175bf fix(plugins): only add app nav link if it has any pages/dashboards with role matching current user, fixes #4784 2016-04-25 14:00:49 +02:00
bergquist f167ce19ab test(alerting): add test for deleting alerts 2016-04-25 13:00:05 +02:00
bergquist bdd3e2ad73 Merge branch 'master' into alerting_definitions 2016-04-25 11:22:35 +02:00
Torkel Ödegaard 97656d65ec db(dashboard): minor fix for dashboard delete 2016-04-25 11:22:13 +02:00
Torkel Ödegaard ba28d2e13f Merge branch 'master' of github.com:grafana/grafana 2016-04-25 09:26:57 +02:00
Torkel Ödegaard 711992c8e2 fix(influxdb): minor fix for duplicated db param to proxied influxdb call, fixes #4703 2016-04-25 09:26:47 +02:00
bergquist 5d5999561a test(dashboard): add failing test for deleting dashboards 2016-04-25 08:46:15 +02:00
bergquist 44310921b5 test(alerting): add commented failed test 2016-04-25 08:34:48 +02:00
Carl Bergquist 31624b410a Merge pull request #4800 from 1tylermitchell/patch-1
typo
2016-04-25 08:01:39 +02:00
Torkel Ödegaard 00827ce921 fix(): let binding cycle complete before adding panel to dom 2016-04-24 12:50:33 +02:00
Tyler Mitchell 21d2a51cd3 typo
tabs != tags
2016-04-23 22:00:42 -07:00
bergquist c0384a04f8 Merge branch 'cli_upgradeFix' 2016-04-23 14:40:05 +02:00
bergquist ee0c4cd194 docs(changelog): add note about cli issue
closes #4651
2016-04-23 14:39:42 +02:00
bergquist 07b13e24fa style(cli): add some color to error messages 2016-04-23 14:39:42 +02:00
bergquist 0855f51436 feat(cli): improves defer error handling 2016-04-23 14:39:42 +02:00
bergquist 70acfb2cfd fix(cli): adds better help text.
The zip lib is throwing panics sometimes when the response is malformed.
The cli will now try to download the zip file up to three times before
aborting. The cli gives a better error message and informes the user
about retrying.

closes #4651
2016-04-23 14:39:42 +02:00
bergquist 03e6fc951f feat(alerting): delete alerts when dashboard gets deleted 2016-04-23 14:14:18 +02:00
bergquist ec6dbe3067 tests(alerting): connect alerts to dashboard 2016-04-23 10:41:50 +02:00
Torkel Ödegaard 29a2b2032a Merge pull request #4794 from grafana/issue-4767
Updated link color in text panel to be -link-color
2016-04-22 18:37:03 +02:00
Torkel Ödegaard af2efbe480 Merge pull request #4796 from grafana/g-net-links
fix broken link to grafana.net, standardize on https://grafana.net for links
2016-04-22 18:36:42 +02:00
Dan Cech 25b0773a94 fix broken link to grafana.net, standardize on https://grafana.net for links 2016-04-22 12:13:39 -04:00
bergquist 84115c8038 feat(alerting): delete alerts when panels are removed 2016-04-22 17:49:50 +02:00
Matt Toback 349f6b51a5 Updated link color in text panel to be -link-color 2016-04-22 11:32:19 -04:00
bergquist 8bb62a79d0 feat(alerting): excisting alerts are now updated 2016-04-22 16:51:24 +02:00
bergquist ba5978abd3 Merge branch 'master' into alerting_definitions 2016-04-22 15:52:56 +02:00
Torkel Ödegaard 9917de09af fix(graph): removed angular copy that was no longer needed 2016-04-22 15:49:51 +02:00
Torkel Ödegaard 884eef32c9 Merge pull request #4793 from daniellee/panel_defaults
fix(panels): avoid deep copy problem for panel defaults
2016-04-22 15:47:59 +02:00
Daniel Lee 16dbf3166d fix(panels): avoid deep copy problem for panel defaults
Moves the defaults to be an instance property. This solves
the problem of lodash defaults function not doing a deep
copy. The symptom of this is that new deep properties for
a panel are assigned to every panel of the same type by
the defaults function in the constructor.
2016-04-22 15:29:33 +02:00
Carl Bergquist be19f8888e Merge pull request #4792 from grafana/revert-4790-revert-3688-gauges
Revert "Revert "Gauges""
2016-04-22 15:06:13 +02:00
Torkel Ödegaard 3bbc86bcf2 Merge pull request #4719 from nlf/master
dont quote numbers for influxdb, closes #4163
2016-04-22 15:04:14 +02:00
Torkel Ödegaard 8b656f15b9 feat(graphite): added stddevSeries func def, closes #4782 2016-04-22 14:57:16 +02:00
Carl Bergquist 453f8b312a Revert "Revert "Gauges"" 2016-04-22 14:55:35 +02:00
Torkel Ödegaard 723bfa70db fix(table panel): fixed issue with string array formating, fixes #4791 2016-04-22 14:46:32 +02:00
Torkel Ödegaard 45dd9c5795 fix(graph panel): fix for graph panel alignment when legend is in table mode, fixes #4772 2016-04-22 14:36:20 +02:00
Torkel Ödegaard fa479afdaa Merge branch 'master' of github.com:grafana/grafana 2016-04-22 14:00:08 +02:00
Torkel Ödegaard 1dfeb192a3 fix(templating): another fix for templating and custom all value escaping, fixes #4787 2016-04-22 13:59:54 +02:00
Carl Bergquist 1f9c2add7c Merge pull request #4790 from grafana/revert-3688-gauges
Revert "Gauges"
2016-04-22 13:05:54 +02:00
Carl Bergquist 24fbcd8dea Revert "Gauges" 2016-04-22 13:05:43 +02:00
bergquist db15bf23b8 fix(sass): fixes sass lint issue 2016-04-22 12:09:02 +02:00
bergquist de52ca4785 docs(changelog): adds gauges to changelog 2016-04-22 11:54:09 +02:00
Carl Bergquist 2748a3fbd8 Merge pull request #3688 from keis/gauges
Gauges
2016-04-22 11:49:35 +02:00
Torkel Ödegaard dfe36fb702 feat(panel): added new panel event panel-initialized 2016-04-22 11:41:56 +02:00
Torkel Ödegaard 297c829bdc tech(): updatad sass-lint 2016-04-22 09:47:30 +02:00
Torkel Ödegaard bd933badb1 Merge pull request #4779 from bergquist/fix_snapshots
Fix broken snapshots in grafana 2.6
2016-04-22 09:35:02 +02:00
bergquist d21f97e69b feat(alerting): adds basic alerting tab 2016-04-21 11:47:30 +02:00
bergquist 0fb4141ce4 docs(changelog): add note about scrollbar fix #4769 2016-04-21 10:23:09 +02:00
bergquist 51de894692 fix(snapshots): sets default value for snapshot name
make it possible for < 3.0 instances to publish snapshots

ref #4778
2016-04-21 09:59:48 +02:00
Torkel Ödegaard 7079b5d770 fix(dashboard list): fixed minor issue with dashboard list panel, fixes #4768 2016-04-20 09:15:45 -07:00
Torkel Ödegaard 41e5812a22 Merge pull request #4771 from mtanda/cloudwatch_kinesis_metrics
(cloudwatch) add kinesis metrics
2016-04-20 08:57:26 -07:00
Torkel Ödegaard 8d5f28b33a Merge pull request #4774 from ycombinator/update-es-logo
Updating Elasticsearch logo
2016-04-20 08:56:21 -07:00
Shaunak Kashyap 3925bcb94c Updating Elasticsearch logo 2016-04-20 08:50:28 -07:00
bergquist 96e88ee84d refactor(alerting): changes interval to string from int 2016-04-20 16:57:03 +02:00
bergquist 262821e7e7 feat(alerting): tests that alertes can be read from db 2016-04-20 16:46:24 +02:00
bergquist ef92fd4ebc feat(alerting): renames error_level to crit_level 2016-04-20 15:02:49 +02:00
bergquist 7860a2a1b8 feat(alerting): make sure dashboard id exists 2016-04-20 09:55:32 +02:00
Mitsuhiro Tanda 8d1ac8c7f5 (cloudwatch) add kinesis metrics 2016-04-20 14:33:08 +09:00
Mitsuhiro Tanda ab9abee67b (cloudwatch) add test for interval variable 2016-04-20 01:27:44 +09:00
Carl Bergquist 9f4ad73698 Merge pull request #4758 from bergquist/cli_local_pluginfolder
CLI: Adds support for local plugin folder
2016-04-19 17:30:01 +02:00
bergquist ca3ad7d17c tests(alerting): add tests for saving alerts 2016-04-19 16:52:20 +02:00
bergquist 0108b5eb88 fix(singlestat): adds support for lighttheme 2016-04-19 16:18:29 +02:00
bergquist 0c6841bdc7 fix(singlestat): adds support for fontsizes in gagues 2016-04-19 16:18:22 +02:00
David Keijser c455e501ac Add gauge option to singlestat 2016-04-19 16:18:09 +02:00
David Keijser 44c1d8c1e5 Add jquery.flot.gauge 2016-04-19 16:18:09 +02:00
Mitsuhiro Tanda 2e5a1328a8 (cloudwatch) support interval template variable 2016-04-19 22:57:34 +09:00
bergquist 832e38af34 feat(alerting): limit alerts to one per panel 2016-04-19 15:34:23 +02:00
bergquist ff22f43002 fix(cli): fixes missplaced % 2016-04-19 14:46:03 +02:00
bergquist 4e8396dbce fix(graph): sets legend table scroll to auto
closes #4760
2016-04-19 13:41:35 +02:00
bergquist d38d4efc18 style(cli): improve logging to find install crash 2016-04-19 10:39:55 +02:00
bergquist a8c68e33db feat(cli): add more logging for failed install 2016-04-19 10:22:02 +02:00
bergquist 903d1b7797 tech(cli): dont use defer statements in loops 2016-04-19 09:13:58 +02:00
bergquist 5abaf26b5f style(cli): remove some logging 2016-04-19 08:39:22 +02:00
bergquist 485a377800 fix(cli): adds support for local plugin folder
closes #4572
2016-04-19 08:27:26 +02:00
Torkel Ödegaard bd21a08bc9 fix(templating): fixed encoding of all value for regex, and custom all value, fixes #4755, fixes #4736 2016-04-18 17:33:51 -04:00
Torkel Ödegaard 99ae38a232 Merge pull request #4750 from bergquist/fix_influxb_showtag_values
[Influxb] Support for multible measurement results in showtag values
2016-04-18 13:22:07 -04:00
bergquist c148e54bbd style(influxdb): improve naming 2016-04-18 18:52:09 +02:00
bergquist 267ab822c2 tech(influxdb): uses hashmap for uniqueness 2016-04-18 18:46:50 +02:00
Torkel Ödegaard 39cdaf5175 ux(query-editors): more progress and fixes 2016-04-18 11:35:24 -04:00
bergquist 80818f80a9 tech(grunt): add check for not including "only" in tests 2016-04-18 17:12:53 +02:00
bergquist fde6eee4f4 fix(influxdb): adds support for multi table values
When quering for tag values without measurement
all tags and values should be shown

closes #4726
2016-04-18 16:27:06 +02:00
Torkel Ödegaard 14ec69a160 Merge remote-tracking branch 'origin/master' into query-editor-style 2016-04-18 09:51:35 -04:00
Torkel Ödegaard 8ebe9d1e16 Merge branch 'query-editor-style' of github.com:grafana/grafana into query-editor-style 2016-04-18 09:51:28 -04:00
bergquist 7e66d0bcc1 fix(): remove only usage in tests 2016-04-18 15:25:06 +02:00
Torkel Ödegaard 4515e66783 feat(query editors): more progress on ES query editor 2016-04-18 08:43:11 -04:00
bergquist daa5468801 feat(alerting): parses dashboard alerts 2016-04-18 14:15:03 +02:00
bergquist 769016783f feat(alerting): add aggregator field 2016-04-18 11:10:52 +02:00
bergquist bcf10a6483 Merge branch 'master' into alerting_definitions 2016-04-18 10:28:40 +02:00
Torkel Ödegaard 1069f485da ux(query_editors): handle text overflow in collapsed mode 2016-04-17 22:24:40 -04:00
Torkel Ödegaard 4c4835e869 ux(query-editors): more progress on elastic query editor 2016-04-17 22:04:43 -04:00
Torkel Ödegaard a1faaa133c feat(): query editors, started work on updated ES query editor 2016-04-17 17:17:30 -04:00
Torkel Ödegaard 805fd18b7b feat(query editors): more work on query editors make over 2016-04-17 16:43:13 -04:00
Torkel Ödegaard 33f7b8479e ux(query editors): progress on new query editor styles 2016-04-17 12:14:25 -04:00
Torkel Ödegaard 68bd82f1b6 Merge branch 'master' into query-editor-style 2016-04-16 13:46:05 -04:00
Torkel Ödegaard 13471ae2c4 feat(templating): templated ds progress 2016-04-16 13:43:16 -04:00
Torkel Ödegaard 822bf13b7a Merge pull request #4728 from grafana/code-style-improvements
Code style improvements
2016-04-16 12:09:40 -04:00
Torkel Ödegaard 1cce5fdfe1 feat(templating): polished variable template edit forms, added new template variable type: datasource 2016-04-16 12:03:29 -04:00
Torkel Ödegaard 6b2fedb1c2 Merge branch 'master' of github.com:grafana/grafana 2016-04-15 19:57:12 -04:00
Torkel Ödegaard e307ada374 ux(): tooltip improvement 2016-04-15 19:56:39 -04:00
Matt Toback a7e8e64d78 The beginnings of the build mode and rows 2016-04-15 19:52:18 -04:00
Torkel Ödegaard 4f2628c221 fix(): fixed issue with templating preview, fixes #4714 2016-04-15 18:50:48 -04:00
Torkel Ödegaard 0f16066915 fix(): zoom out tooltip fix, fixes #4729 2016-04-15 18:32:03 -04:00
Torkel Ödegaard 5f6ecac3f9 poc(editmode): experimental edit mode 2016-04-15 15:11:40 -04:00
Matt Toback 151d8db98d removed unnecessary style 2016-04-15 15:00:29 -04:00
Matt Toback 614b26fff6 Fixed inline code styles and increase line heights in lists to accommodate code 2016-04-15 14:58:20 -04:00
Torkel Ödegaard 49b2743a37 Merge branch 'master' of github.com:grafana/grafana 2016-04-15 14:36:51 -04:00
Torkel Ödegaard 8e37de19c9 ux(): minor fix to tooltip in template editor view 2016-04-15 14:36:43 -04:00
Matt Toback 38bda92bdc Update dashnav.html 2016-04-15 13:26:27 -04:00
Torkel Ödegaard 83ba6638a1 bumped version 2016-04-15 10:50:21 -04:00
Torkel Ödegaard 4832ecf3e7 docs(): updated download links 2016-04-15 09:25:09 -04:00
Torkel Ödegaard 2e8ed97355 changelog(grafana-cli): fixed issue with grafana-cli and plugins dir, fixes #4723 2016-04-15 09:13:06 -04:00
Torkel Ödegaard d98839fc19 Revert "feat(cli): detects plugin folder for dev env"
This reverts commit a5eda6a87b.
2016-04-15 09:01:27 -04:00
Torkel Ödegaard 0f71838fdf feat(dash export): dashboard export can now replace datasource names with variable and add inputs section 2016-04-14 21:13:01 -04:00
Nathan LaFreniere b6de656cf1 dont quote numbers for influxdb, closes #4163 2016-04-14 17:08:54 -07:00
Torkel Ödegaard 75555c470b Update latest.json 2016-04-14 18:09:04 -04:00
Torkel Ödegaard 4d0b14fbb4 feat(exporter): stared work on dashboard exporter that cleans up repeated panels etc 2016-04-14 17:31:34 -04:00
Torkel Ödegaard 1f9922a5aa refactor(): moved dashboard_srv and DashboardCtrl to typescript 2016-04-14 16:53:19 -04:00
Torkel Ödegaard b3f3b70b90 Merge branch 'master' of github.com:grafana/grafana 2016-04-14 14:15:59 -04:00
Torkel Ödegaard 924800b7df bumped version 2016-04-14 14:15:47 -04:00
Matt Toback d27da57b02 Fixed the fix. 2016-04-14 12:39:37 -04:00
Torkel Ödegaard f1a01aed7e Merge pull request #4711 from grafana/issue-4704
Updated colors to fix issue
2016-04-14 12:30:47 -04:00
Matt Toback c1a5771fcd Updated colors to fix issue 2016-04-14 11:38:07 -04:00
Matt Toback 8ac5c36735 Still not fixed, not sure why.
despite having pushed that code with @torkelo.
2016-04-14 11:12:00 -04:00
Torkel Ödegaard 6355896584 fix(snapshots): Fixed issue with empty snapshots, fixes #4706 2016-04-14 11:06:48 -04:00
Torkel Ödegaard 6216ce455f fix(pluginlist): fixed issue with pluginlist link, fixes #4705 2016-04-14 10:55:24 -04:00
Torkel Ödegaard c0832995ae Merge branch 'master' of github.com:grafana/grafana 2016-04-14 08:47:38 -04:00
Torkel Ödegaard 9469b20cbd fix(graph): Fixed issue with light theme text color issue in tooltip, fixes #4702 2016-04-14 08:41:54 -04:00
Torkel Ödegaard 573457c03f fix(build): fixed build script issue 2016-04-13 17:48:20 -04:00
Torkel Ödegaard 5c395424c6 updated changelog 2016-04-13 17:42:33 -04:00
Torkel Ödegaard f6d53df282 Merge branch 'master' of github.com:grafana/grafana 2016-04-13 17:33:17 -04:00
Torkel Ödegaard e4374b1d56 docs(): updated download links 2016-04-13 17:33:03 -04:00
Torkel Ödegaard 7302ddaba5 docs(): fixed docs fixes #46688 2016-04-13 16:43:00 -04:00
Torkel Ödegaard 7456514816 fix(templating): fixed issue with template variables that use regex extraction, fixes #4672 2016-04-13 16:41:19 -04:00
Torkel Ödegaard d9ad4cf2fc fix(): made plugin settings api call accessable for viewer roles 2016-04-13 13:03:41 -04:00
Torkel Ödegaard 8b4efbed06 Merge branch 'master' of github.com:grafana/grafana 2016-04-13 12:23:45 -04:00
Torkel Ödegaard 10131aa8a0 fix(pluginlist): fixed issue with home dashboard and new pluginlist panel that casued permission denied error for non admin users, fixes #4686 2016-04-13 12:23:29 -04:00
Torkel Ödegaard 23dc85c1de Merge pull request #4628 from timstanley1985/master
Fix build on RPi.  Building from source timesout on karma tests so increase timeouts
2016-04-13 10:32:46 -04:00
Torkel Ödegaard 338c6b5a5c Merge pull request #4671 from grafana/login-page-style
Updated background color on div
2016-04-13 10:28:40 -04:00
bergquist 91a1a823e2 feat(alerting): add basic tables for alerting definitions 2016-04-13 10:33:45 +02:00
Matt Toback c13ebce2f6 Update module.html 2016-04-12 17:01:30 -04:00
Matt Toback b6ccd7ffbe Updated background color on div 2016-04-12 15:18:47 -04:00
Torkel Ödegaard ad0794cc59 ux(): updated light theme 2016-04-12 14:26:55 -04:00
Torkel Ödegaard 6961cb7440 ux(): reduced tooltip border radius 2016-04-12 13:29:31 -04:00
Torkel Ödegaard 9868edb138 ux(): changed tooltip style 2016-04-12 13:00:33 -04:00
Torkel Ödegaard e822fad505 fix(timepicker): fixed issues and added some polish to timepicker shift back/forward buttons 2016-04-12 12:41:17 -04:00
Torkel Ödegaard 3ab5427019 fix(timepicker): fixed issues and added some polish to timepicker shift back/forward buttons 2016-04-12 12:39:59 -04:00
Torkel Ödegaard 7afb6fa3e3 ux(ds edit): combine save and test connection buttons, closes #4658 2016-04-12 11:20:03 -04:00
Torkel Ödegaard 29dff7ba1a fix(graph): fixed color picker appearingunder pinned side nav, fixes #4556 2016-04-12 11:07:34 -04:00
Torkel Ödegaard 329ee8d9f1 fix(prometheus): added template variable escape format to prometheus annotations queries, fixes #4656 2016-04-12 10:50:58 -04:00
Torkel Ödegaard f70e0003f8 Merge branch 'master' of github.com:grafana/grafana 2016-04-12 10:29:07 -04:00
Torkel Ödegaard bb0eb29c82 Update latest.json 2016-04-12 10:28:56 -04:00
Torkel Ödegaard 47bba71d7f fixed update check 2016-04-12 10:28:32 -04:00
bergquist 6b8921c8c5 Merge branch 'utkarshcmu-move' 2016-04-12 16:22:27 +02:00
bergquist 7d09579e3f feat(timepicker): adds arrows to move back and forth in current dashboard
closes #119
2016-04-12 16:21:29 +02:00
bergquist e5c9a24c33 Merge branch 'master' into utkarshcmu-move 2016-04-12 16:21:20 +02:00
Torkel Ödegaard e7626befc5 updated version 2016-04-12 10:17:39 -04:00
Torkel Ödegaard 905d31442c fix(annotations): make sure a data source that supports annotations is used in annotation editor when creating new 2016-04-12 10:16:40 -04:00
bergquist 963001ba1a Merge branch 'move' of https://github.com/utkarshcmu/grafana into utkarshcmu-move 2016-04-12 15:22:38 +02:00
Torkel Ödegaard 75649c49d5 Merge branch 'master' into wizard 2016-04-11 18:18:09 -04:00
timstanley1985 92f5f8dced Fix build on RPi. Building from source timesout on karma tests so increase timeouts 2016-04-09 17:09:55 +01:00
utkarshcmu 6a55ec6955 Changed time shift icons 2016-04-07 02:21:54 -07:00
utkarshcmu e470786fb9 Backward and forward arrows for time shift 2016-04-07 01:30:49 -07:00
Torkel Ödegaard 6bb001e416 Merge branch 'master' into query-editor-style 2016-04-04 13:55:55 -04:00
Adrian Lopez 9fbb1214ae Allow to show multiple tags with annotations with InfluxDB datasource 2016-04-04 16:57:34 +02:00
Valeriy Simonov 8bf4d3fb7f Merge remote-tracking branch 'refs/remotes/grafana/master' 2016-03-31 15:54:00 +05:00
Torkel Ödegaard 50d773988b ux(): updated graphite editor 2016-03-29 19:17:32 +02:00
Torkel Ödegaard d2239427f2 ux(): big progress on updating query editors 2016-03-29 19:03:24 +02:00
Torkel Ödegaard 24a7d4f816 ux(): query editors, added group by 2016-03-29 17:56:34 +02:00
Torkel Ödegaard a4f9621473 Merge branch 'master' into query-editor-style 2016-03-29 17:45:24 +02:00
Torkel Ödegaard 437b880b3e feat(plugins): work on setup wizard started 2016-03-25 22:14:29 +01:00
Torkel Ödegaard bd6a68bfe5 ux(): more changes to influxdb query editor 2016-03-20 18:01:25 +01:00
Torkel Ödegaard a5a244767a Merge branch 'master' into query-editor-style 2016-03-20 17:39:31 +01:00
Torkel Ödegaard 55189200a4 ux(): updated query editor test 2016-03-20 16:18:31 +01:00
Shani Elharrar f121e8309d ElasticSearch Terms & Date Histogram: Support 'missing' setting 2016-03-03 22:34:28 +02:00
3867 changed files with 363599 additions and 218962 deletions
-3
View File
@@ -1,3 +0,0 @@
{
"directory": "public/vendor/"
}
+3 -3
View File
@@ -1,7 +1,7 @@
[run]
init_cmds = [
["go", "build", "-o", "./bin/grafana-server", "./pkg/cmd/grafana-server"],
["./bin/grafana-server"]
["./bin/grafana-server", "cfg:app_mode=development"]
]
watch_all = true
watch_dirs = [
@@ -9,9 +9,9 @@ watch_dirs = [
"$WORKDIR/public/views",
"$WORKDIR/conf",
]
watch_exts = [".go", ".ini", ".toml", ".html"]
watch_exts = [".go", ".ini", ".toml"]
build_delay = 1500
cmds = [
["go", "build", "-o", "./bin/grafana-server", "./pkg/cmd/grafana-server"],
["./bin/grafana-server"]
["./bin/grafana-server", "cfg:app_mode=development"]
]
+7 -7
View File
@@ -1,13 +1,6 @@
# http://editorconfig.org
root = true
[*.go]
indent_style = tabs
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*]
indent_style = space
indent_size = 2
@@ -15,5 +8,12 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.go]
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
+3 -3
View File
@@ -12,11 +12,11 @@ grunt karma:dev
### Run tests for backend assets before commit
```
test -z "$(gofmt -s -l . | grep -v Godeps/_workspace/src/ | tee /dev/stderr)"
test -z "$(gofmt -s -l . | grep -v -E 'vendor/(github.com|golang.org|gopkg.in)' | tee /dev/stderr)"
```
### Run tests for frontend assets before commit
```
grunt test
godep go test -v ./pkg/...
npm test
go test -v ./pkg/...
```
+15 -9
View File
@@ -1,12 +1,18 @@
Thank you! For helping us make Grafana even better.
Read before posting:
To help us respond to your issues faster, please make sure to add as much information as possible.
- Questions should be posted to https://community.grafana.com. Please search there and here on GitHub for similar issues before creating a new issue.
- Checkout FAQ: https://community.grafana.com/c/howto/faq
- Checkout How to troubleshoot metric query issues: https://community.grafana.com/t/how-to-troubleshoot-metric-query-issues/50
If this issue is about a plugin, please open the issue in that repository.
Please prefix your title with [Bug] or [Feature request].
Start your issues title with [Feature Request] / [Bug] / [Question] or no tag if your unsure.
Ex
* What grafana version are you using?
* What datasource are you using?
* What OS are you running grafana on?
Please include this information:
- What Grafana version are you using?
- What datasource are you using?
- What OS are you running grafana on?
- What did you do?
- What was the expected result?
- What happened instead?
- If related to metric query / data viz:
- Include raw network request & response: get by opening Chrome Dev Tools (F12, Ctrl+Shift+I on windows, Cmd+Opt+I on Mac), go the network tab.
+3 -1
View File
@@ -1,2 +1,4 @@
* Link the PR to an issue for new features
* Rebase your PR if it gets out of sync with master
* Rebase your PR if it gets out of sync with master
**REMOVE THE TEXT ABOVE BEFORE CREATING THE PULL REQUEST**
+17 -3
View File
@@ -4,18 +4,19 @@ coverage/
.aws-config.json
awsconfig
/dist
/public/build
/public/views/index.html
/emails/dist
/public_gen
/public/vendor/npm
/tmp
vendor/phantomjs/phantomjs
vendor/phantomjs/phantomjs.exe
docs/AWS_S3_BUCKET
docs/GIT_BRANCH
docs/VERSION
docs/GITCOMMIT
docs/changed-files
docs/changed-files
# locally required config files
public/css/*.min.css
@@ -25,6 +26,9 @@ public/css/*.min.css
*.swp
.idea/
*.iml
*.tmp
.DS_Store
.vscode/
/data/*
/bin/*
@@ -37,4 +41,14 @@ profile.cov
.notouch
/pkg/cmd/grafana-cli/grafana-cli
/pkg/cmd/grafana-server/grafana-server
/examples/*/dist
/pkg/cmd/grafana-server/debug
/examples/*/dist
/packaging/**/*.rpm
/packaging/**/*.deb
/vendor/**/*.py
/vendor/**/*.xml
/vendor/**/*.yml
/vendor/**/*_test.go
/vendor/**/.editorconfig
/vendor/**/appengine*
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
test -z "$(gofmt -s -l . | grep -v Godeps/_workspace/src/ | tee /dev/stderr)"
test -z "$(gofmt -s -l . | grep -v vendor/src/ | tee /dev/stderr)"
if [ $? -gt 0 ]; then
echo "Some files aren't formatted, please run 'go fmt ./pkg/...' to format your source code before committing"
exit 1
+1 -1
View File
@@ -10,4 +10,4 @@
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"validateIndentation": 2
}
}
-21
View File
@@ -1,21 +0,0 @@
{
"preset" : "default",
"lineBreak" : {
"before" : {
"VariableDeclarationWithoutInit" : 0,
},
"after": {
"AssignmentOperator": -1,
"ArgumentListArrayExpression": ">=1"
}
},
"whiteSpace" : {
"before" : {
},
"after" : {
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"browser": true,
"esversion": 6,
"bitwise":false,
"curly": true,
"eqnull": true,
+613 -2
View File
@@ -1,7 +1,618 @@
# 3.0.0-beta3 (unreleased)
# 5.0.0 (unreleased)
### WIP (in develop branch currently as its unstable or unfinished)
- Dashboard folders
- User groups
- Dashboard permissions (on folder & dashboard level), permissions can be assigned to groups or individual users
- UX changes to nav & side menu
- New dashboard grid layout system
# 4.6.0 (unreleased)
## New Features
* **GCS**: Adds support for Google Cloud Storage [#8370](https://github.com/grafana/grafana/issues/8370) thx [@chuhlomin](https://github.com/chuhlomin)
* **Prometheus**: Adds /metrics endpoint for exposing Grafana metrics. [#9187](https://github.com/grafana/grafana/pull/9187)
* **Graph**: Add support for local formating in axis. [#1395](https://github.com/grafana/grafana/issues/1395), thx [@m0nhawk](https://github.com/m0nhawk)
* **Jaeger**: Add support for open tracing using jaeger in Grafana. [#9213](https://github.com/grafana/grafana/pull/9213)
* **Unit types**: New date & time unit types added, useful in singlestat to show dates & times. [#3678](https://github.com/grafana/grafana/issues/3678), [#6710](https://github.com/grafana/grafana/issues/6710), [#2764](https://github.com/grafana/grafana/issues/2764)
* **CLI**: Make it possible to install plugins from any url [#5873](https://github.com/grafana/grafana/issues/5873)
* **Prometheus**: Add support for instant queries [#5765](https://github.com/grafana/grafana/issues/5765), thx [@mtanda](https://github.com/mtanda)
* **Cloudwatch**: Add support for alerting using the cloudwatch datasource [#8050](https://github.com/grafana/grafana/pull/8050), thx [@mtanda](https://github.com/mtanda)
* **Pagerduty**: Include triggering series in pagerduty notification [#8479](https://github.com/grafana/grafana/issues/8479), thx [@rickymoorhouse](https://github.com/rickymoorhouse)
* **Timezone**: Time ranges like Today & Yesterday now work correctly when timezone setting is set to UTC [#8916](https://github.com/grafana/grafana/issues/8916), thx [@ctide](https://github.com/ctide)
* **Prometheus**: Align $__interval with the step parameters. [#9226](https://github.com/grafana/grafana/pull/9226), thx [@alin-amana](https://github.com/alin-amana)
* **Prometheus**: Autocomplete for label name and label value [#9208](https://github.com/grafana/grafana/pull/9208), thx [@mtanda](https://github.com/mtanda)
* **Postgres**: New Postgres data source [#9209](https://github.com/grafana/grafana/pull/9209), thx [@svenklemm](https://github.com/svenklemm)
* **Datasources**: Make datasource HTTP requests verify TLS by default. closes [#9371](https://github.com/grafana/grafana/issues/9371), [#5334](https://github.com/grafana/grafana/issues/5334), [#8812](https://github.com/grafana/grafana/issues/8812), thx [@mattbostock](https://github.com/mattbostock)
* **OAuth**: Verify TLS during OAuth callback [#9373](https://github.com/grafana/grafana/issues/9373), thx [@mattbostock](https://github.com/mattbostock)
## Minor
* **SMTP**: Make it possible to set specific EHLO for smtp client. [#9319](https://github.com/grafana/grafana/issues/9319)
* **Dataproxy**: Allow grafan to renegotiate tls connection [#9250](https://github.com/grafana/grafana/issues/9250)
* **HTTP**: set net.Dialer.DualStack to true for all http clients [#9367](https://github.com/grafana/grafana/pull/9367)
* **Alerting**: Add diff and percent diff as series reducers [#9386](https://github.com/grafana/grafana/pull/9386), thx [@shanhuhai5739](https://github.com/shanhuhai5739)
* **Slack**: Allow images to be uploaded to slack when Token is precent [#7175](https://github.com/grafana/grafana/issues/7175), thx [@xginn8](https://github.com/xginn8)
* **Opsgenie**: Use their latest API instead of old version [#9399](https://github.com/grafana/grafana/pull/9399), thx [@cglrkn](https://github.com/cglrkn)
* **Table**: Add support for displaying the timestamp with milliseconds [#9429](https://github.com/grafana/grafana/pull/9429), thx [@s1061123](https://github.com/s1061123)
* **Hipchat**: Add metrics, message and image to hipchat notifications [#9110](https://github.com/grafana/grafana/issues/9110), thx [@eloo](https://github.com/eloo)
* **Kafka**: Add support for sending alert notifications to kafka [#7104](https://github.com/grafana/grafana/issues/7104), thx [@utkarshcmu](https://github.com/utkarshcmu)
* **Alerting**: add count_non_null as series reducer [#9516](https://github.com/grafana/grafana/issues/9516)
## Tech
* **Go**: Grafana is now built using golang 1.9
* **Webpack**: Changed from systemjs to webpack (see readme or building from source guide for new build instructions). Systemjs is still used to load plugins but now plugins can only import a limited set of dependencies. See [PLUGIN_DEV.md](https://github.com/grafana/grafana/blob/master/PLUGIN_DEV.md) for more details on how this can effect some plugins.
# 4.5.2 (2017-09-22)
## Fixes
* **Graphite**: Fix for issues with jsonData & graphiteVersion null errors [#9258](https://github.com/grafana/grafana/issues/9258)
* **Graphite**: Fix for Grafana internal metrics to Graphite sending NaN values [#9279](https://github.com/grafana/grafana/issues/9279)
* **HTTP API**: Fix for HEAD method requests [#9307](https://github.com/grafana/grafana/issues/9307)
* **Templating**: Fix for duplicate template variable queries when refresh is set to time range change [#9185](https://github.com/grafana/grafana/issues/9185)
* **Metrics**: dont write NaN values to graphite [#9279](https://github.com/grafana/grafana/issues/9279)
# 4.5.1 (2017-09-15)
## Fixes
* **MySQL**: Fixed issue with query editor not showing [#9247](https://github.com/grafana/grafana/issues/9247)
## Breaking changes
* **Metrics**: The metric structure for internal metrics about Grafana published to graphite has changed. This might break dashboards for internal metrics.
# 4.5.0 (2017-09-14)
## Fixes & Enhancements since beta1
* **Security**: Security fix for api vulnerability (in multiple org setups).
* **Shortcuts**: Adds shortcut for creating new dashboard [#8876](https://github.com/grafana/grafana/pull/8876) thx [@mtanda](https://github.com/mtanda)
* **Graph**: Right Y-Axis label position fixed [#9172](https://github.com/grafana/grafana/pull/9172)
* **General**: Improve rounding of time intervals [#9197](https://github.com/grafana/grafana/pull/9197), thx [@alin-amana](https://github.com/alin-amana)
# 4.5.0-beta1 (2017-09-05)
## New Features
* **Table panel**: Render cell values as links that can have an url template that uses variables from current table row. [#3754](https://github.com/grafana/grafana/issues/3754)
* **Elasticsearch**: Add ad hoc filters directly by clicking values in table panel [#8052](https://github.com/grafana/grafana/issues/8052).
* **MySQL**: New rich query editor with syntax highlighting
* **Prometheus**: New rich query editor with syntax highlighting, metric & range auto complete and integrated function docs. [#5117](https://github.com/grafana/grafana/issues/5117)
## Enhancements
* **GitHub OAuth**: Support for GitHub organizations with 100+ teams. [#8846](https://github.com/grafana/grafana/issues/8846), thx [@skwashd](https://github.com/skwashd)
* **Graphite**: Calls to Graphite api /metrics/find now include panel or dashboad time range (from & until) in most cases, [#8055](https://github.com/grafana/grafana/issues/8055)
* **Graphite**: Added new graphite 1.0 functions, available if you set version to 1.0.x in data source settings. New Functions: mapSeries, reduceSeries, isNonNull, groupByNodes, offsetToZero, grep, weightedAverage, removeEmptySeries, aggregateLine, averageOutsidePercentile, delay, exponentialMovingAverage, fallbackSeries, integralByInterval, interpolate, invert, linearRegression, movingMin, movingMax, movingSum, multiplySeriesWithWildcards, pow, powSeries, removeBetweenPercentile, squareRoot, timeSlice, closes [#8261](https://github.com/grafana/grafana/issues/8261)
- **Elasticsearch**: Ad-hoc filters now use query phrase match filters instead of term filters, works on non keyword/raw fields [#9095](https://github.com/grafana/grafana/issues/9095).
### Breaking change
* **InfluxDB/Elasticsearch**: The panel & data source option named "Group by time interval" is now named "Min time interval" and does now always define a lower limit for the auto group by time. Without having to use `>` prefix (that prefix still works). This should in theory have close to zero actual impact on existing dashboards. It does mean that if you used this setting to define a hard group by time interval of, say "1d", if you zoomed to a time range wide enough the time range could increase above the "1d" range as the setting is now always considered a lower limit.
* **Elasticsearch**: Elasticsearch metric queries without date histogram now return table formated data making table panel much easier to use for this use case. Should not break/change existing dashboards with stock panels but external panel plugins can be affected.
## Changes
* **InfluxDB**: Change time range filter for absolute time ranges to be inclusive instead of exclusive [#8319](https://github.com/grafana/grafana/issues/8319), thx [@Oxydros](https://github.com/Oxydros)
* **InfluxDB**: Added paranthesis around tag filters in queries [#9131](https://github.com/grafana/grafana/pull/9131)
## Bug Fixes
* **Modals**: Maintain scroll position after opening/leaving modal [#8800](https://github.com/grafana/grafana/issues/8800)
* **Templating**: You cannot select data source variables as data source for other template variables [#7510](https://github.com/grafana/grafana/issues/7510)
* **MySQL/Postgres**: Fix for max_idle_conn option default which was wrongly set to zero which does not mean unlimited but means zero, which in practice kind of disables connection pooling, which is not good. Fixes [#8513](https://github.com/grafana/grafana/issues/8513)
# 4.4.3 (2017-08-07)
## Bug Fixes
* **Search**: Fix for issue that casued search view to hide when you clicked starred or tags filters, fixes [#8981](https://github.com/grafana/grafana/issues/8981)
* **Modals**: ESC key now closes modal again, fixes [#8981](https://github.com/grafana/grafana/issues/8988), thx [@j-white](https://github.com/j-white)
# 4.4.2 (2017-08-01)
## Bug Fixes
* **GrafanaDB(mysql)**: Fix for dashboard_version.data column type, now changed to MEDIUMTEXT, fixes [#8813](https://github.com/grafana/grafana/issues/8813)
* **Dashboard(settings)**: Closing setting views using ESC key did not update url correctly, fixes [#8869](https://github.com/grafana/grafana/issues/8869)
* **InfluxDB**: Wrong username/password parameter name when using direct access, fixes [#8789](https://github.com/grafana/grafana/issues/8789)
* **Forms(TextArea)**: Bug fix for no scroll in text areas [#8797](https://github.com/grafana/grafana/issues/8797)
* **Png Render API**: Bug fix for timeout url parameter. It now works as it should. Default value was also increased from 30 to 60 seconds [#8710](https://github.com/grafana/grafana/issues/8710)
* **Search**: Fix for not being able to close search by clicking on right side of search result container, [8848](https://github.com/grafana/grafana/issues/8848)
* **Cloudwatch**: Fix for using variables in templating metrics() query, [8965](https://github.com/grafana/grafana/issues/8965)
## Changes
* **Settings(defaults)**: allow_sign_up default changed from true to false [#8743](https://github.com/grafana/grafana/issues/8743)
* **Settings(defaults)**: allow_org_create default changed from true to false
# 4.4.1 (2017-07-05)
## Bug Fixes
* **Migrations**: migration fails where dashboard.created_by is null [#8783](https://github.com/grafana/grafana/issues/8783)
# 4.4.0 (2017-07-04)
## New Features
**Dashboard History**: View dashboard version history, compare any two versions (summary & json diffs), restore to old version. This big feature
was contributed by **Walmart Labs**. Big thanks to them for this massive contribution!
Initial feature request: [#4638](https://github.com/grafana/grafana/issues/4638)
Pull Request: [#8472](https://github.com/grafana/grafana/pull/8472)
## Enhancements
* **Elasticsearch**: Added filter aggregation label [#8420](https://github.com/grafana/grafana/pull/8420), thx [@tianzk](github.com/tianzk)
* **Sensu**: Added option for source and handler [#8405](https://github.com/grafana/grafana/pull/8405), thx [@joemiller](github.com/joemiller)
* **CSV**: Configurable csv export datetime format [#8058](https://github.com/grafana/grafana/issues/8058), thx [@cederigo](github.com/cederigo)
* **Table Panel**: Column style that preserves formatting/indentation (like pre tag) [#6617](https://github.com/grafana/grafana/issues/6617)
* **DingDing**: Add DingDing Alert Notifier [#8473](https://github.com/grafana/grafana/pull/8473) thx [@jiamliang](https://github.com/jiamliang)
## Minor Enhancements
* **Elasticsearch**: Add option for result set size in raw_document [#3426](https://github.com/grafana/grafana/issues/3426) [#8527](https://github.com/grafana/grafana/pull/8527), thx [@mk-dhia](github.com/mk-dhia)
## Bug Fixes
* **Graph**: Bug fix for negative values in histogram mode [#8628](https://github.com/grafana/grafana/issues/8628)
# 4.3.2 (2017-05-31)
## Bug fixes
* **InfluxDB**: Fixed issue with query editor not showing ALIAS BY input field when in text editor mode [#8459](https://github.com/grafana/grafana/issues/8459)
* **Graph Log Scale**: Fixed issue with log scale going below x-axis [#8244](https://github.com/grafana/grafana/issues/8244)
* **Playlist**: Fixed dashboard play order issue [#7688](https://github.com/grafana/grafana/issues/7688)
* **Elasticsearch**: Fixed table query issue with ES 2.x [#8467](https://github.com/grafana/grafana/issues/8467), thx [@goldeelox](https://github.com/goldeelox)
## Changes
* **Lazy Loading Of Panels**: Panels are no longer loaded as they are scrolled into view, this was reverted due to Chrome bug, might be reintroduced when Chrome fixes it's JS blocking behavior on scroll. [#8500](https://github.com/grafana/grafana/issues/8500)
# 4.3.1 (2017-05-23)
## Bug fixes
* **S3 image upload**: Fixed image url issue for us-east-1 (us standard) region. If you were missing slack images for alert notifications this should fix it. [#8444](https://github.com/grafana/grafana/issues/8444)
# 4.3.0-stable (2017-05-23)
## Bug fixes
* **Gzip**: Fixed crash when gzip was enabled [#8380](https://github.com/grafana/grafana/issues/8380)
* **Graphite**: Fixed issue with Toggle edit mode did in query editor [#8377](https://github.com/grafana/grafana/issues/8377)
* **Alerting**: Fixed issue with state history not showing query execution errors [#8412](https://github.com/grafana/grafana/issues/8412)
* **Alerting**: Fixed issue with missing state history events/annotations when using sqlite3 database [#7992](https://github.com/grafana/grafana/issues/7992)
* **Sqlite**: Fixed with database table locked and using sqlite3 database [#7992](https://github.com/grafana/grafana/issues/7992)
* **Alerting**: Fixed issue with annotations showing up in unsaved dashboards, new graph & alert panel. [#8361](https://github.com/grafana/grafana/issues/8361)
* **webdav**: Fixed http proxy env variable support for webdav image upload [#7922](https://github.com/grafana/grafana/issues/79222), thx [@berghauz](https://github.com/berghauz)
* **Prometheus**: Fixed issue with hiding query [#8413](https://github.com/grafana/grafana/issues/8413)
## Enhancements
* **VictorOps**: Now supports panel image & auto resolve [#8431](https://github.com/grafana/grafana/pull/8431), thx [@davidmscott](https://github.com/davidmscott)
* **Alerting**: Alert annotations now provide more info [#8421](https://github.com/grafana/grafana/pull/8421)
# 4.3.0-beta1 (2017-05-12)
## Enhancements
* **InfluxDB**: influxdb query builder support for ORDER BY and LIMIT (allows TOPN queries) [#6065](https://github.com/grafana/grafana/issues/6065) Support influxdb's SLIMIT Feature [#7232](https://github.com/grafana/grafana/issues/7232) thx [@thuck](https://github.com/thuck)
* **Panels**: Delay loading & Lazy load panels as they become visible (scrolled into view) [#5216](https://github.com/grafana/grafana/issues/5216) thx [@jifwin](https://github.com/jifwin)
* **Graph**: Support auto grid min/max when using log scale [#3090](https://github.com/grafana/grafana/issues/3090), thx [@bigbenhur](https://github.com/bigbenhur)
* **Graph**: Support for histograms [#600](https://github.com/grafana/grafana/issues/600)
* **Prometheus**: Support table response formats (column per label) [#6140](https://github.com/grafana/grafana/issues/6140), thx [@mtanda](https://github.com/mtanda)
* **Single Stat Panel**: support for non time series data [#6564](https://github.com/grafana/grafana/issues/6564)
* **Server**: Monitoring Grafana (health check endpoint) [#3302](https://github.com/grafana/grafana/issues/3302)
* **Heatmap**: Heatmap Panel [#7934](https://github.com/grafana/grafana/pull/7934)
* **Elasticsearch**: histogram aggregation [#3164](https://github.com/grafana/grafana/issues/3164)
## Minor Enhancements
* **InfluxDB**: Small fix for the "glow" when focus the field for LIMIT and SLIMIT [#7799](https://github.com/grafana/grafana/pull/7799) thx [@thuck](https://github.com/thuck)
* **Prometheus**: Make Prometheus query field a textarea [#7663](https://github.com/grafana/grafana/issues/7663), thx [@hagen1778](https://github.com/hagen1778)
* **Prometheus**: Step parameter changed semantics to min step to reduce the load on Prometheus and rendering in browser [#8073](https://github.com/grafana/grafana/pull/8073), thx [@bobrik](https://github.com/bobrik)
* **Templating**: Should not be possible to create self-referencing (recursive) template variable definitions [#7614](https://github.com/grafana/grafana/issues/7614) thx [@thuck](https://github.com/thuck)
* **Cloudwatch**: Correctly obtain IAM roles within ECS container tasks [#7892](https://github.com/grafana/grafana/issues/7892) thx [@gomlgs](https://github.com/gomlgs)
* **Units**: New number format: Scientific notation [#7781](https://github.com/grafana/grafana/issues/7781) thx [@cadnce](https://github.com/cadnce)
* **Oauth**: Add common type for oauth authorization errors [#6428](https://github.com/grafana/grafana/issues/6428) thx [@amenzhinsky](https://github.com/amenzhinsky)
* **Templating**: Data source variable now supports multi value and panel repeats [#7030](https://github.com/grafana/grafana/issues/7030) thx [@mtanda](https://github.com/mtanda)
* **Telegram**: Telegram alert is not sending metric and legend. [#8110](https://github.com/grafana/grafana/issues/8110), thx [@bashgeek](https://github.com/bashgeek)
* **Graph**: Support dashed lines [#514](https://github.com/grafana/grafana/issues/514), thx [@smalik03](https://github.com/smalik03)
* **Table**: Support to change column header text [#3551](https://github.com/grafana/grafana/issues/3551)
* **Alerting**: Better error when SMTP is not configured [#8093](https://github.com/grafana/grafana/issues/8093)
* **Pushover**: Add an option to attach graph image link in Pushover notification [#8043](https://github.com/grafana/grafana/issues/8043) thx [@devkid](https://github.com/devkid)
* **WebDAV**: Allow to set different ImageBaseUrl for WebDAV upload and image link [#7914](https://github.com/grafana/grafana/issues/7914)
* **Panels**: type-ahead mixed datasource selection [#7697](https://github.com/grafana/grafana/issues/7697) thx [@mtanda](https://github.com/mtanda)
* **Security**:User enumeration problem [#7619](https://github.com/grafana/grafana/issues/7619)
* **InfluxDB**: Register new queries available in InfluxDB - Holt Winters [#5619](https://github.com/grafana/grafana/issues/5619) thx [@rikkuness](https://github.com/rikkuness)
* **Server**: Support listening on a UNIX socket [#4030](https://github.com/grafana/grafana/issues/4030), thx [@mitjaziv](https://github.com/mitjaziv)
* **Graph**: Support log scaling for values smaller 1 [#5278](https://github.com/grafana/grafana/issues/5278)
* **InfluxDB**: Slow 'select measurement' rendering for InfluxDB [#2524](https://github.com/grafana/grafana/issues/2524), thx [@sbhenderson](https://github.com/sbhenderson)
* **Config**: Configurable signout menu activation [#7968](https://github.com/grafana/grafana/pull/7968), thx [@seuf](https://github.com/seuf)
## Fixes
* **Table Panel**: Fixed annotation display in table panel, [#8023](https://github.com/grafana/grafana/issues/8023)
* **Dashboard**: If refresh is blocked due to tab not visible, then refresh when it becomes visible [#8076](https://github.com/grafana/grafana/issues/8076) thanks [@SimenB](https://github.com/SimenB)
* **Snapshots**: Fixed problem with annotations & snapshots [#7659](https://github.com/grafana/grafana/issues/7659)
* **Graph**: MetricSegment loses type when value is an asterisk [#8277](https://github.com/grafana/grafana/issues/8277), thx [@Gordiychuk](https://github.com/Gordiychuk)
* **Alerting**: Alert notifications do not show charts when using a non public S3 bucket [#8250](https://github.com/grafana/grafana/issues/8250) thx [@rogerswingle](https://github.com/rogerswingle)
* **Graph**: 100% client CPU usage on red alert glow animation [#8222](https://github.com/grafana/grafana/issues/8222)
* **InfluxDB**: Templating: "All" query does match too much [#8165](https://github.com/grafana/grafana/issues/8165)
* **Dashboard**: Description tooltip is not fully displayed [#7970](https://github.com/grafana/grafana/issues/7970)
* **Proxy**: Redirect after switching Org does not obey sub path in root_url (using reverse proxy) [#8089](https://github.com/grafana/grafana/issues/8089)
* **Templating**: Restoration of ad-hoc variable from URL does not work correctly [#8056](https://github.com/grafana/grafana/issues/8056) thx [@tamayika](https://github.com/tamayika)
* **InfluxDB**: timeFilter cannot be used twice in alerts [#7969](https://github.com/grafana/grafana/issues/7969)
* **MySQL**: 4-byte UTF8 not supported when using MySQL database (allows Emojis) [#7958](https://github.com/grafana/grafana/issues/7958)
* **Alerting**: api/alerts and api/alert/:id hold previous data for "message" and "Message" field when field value is changed from "some string" to empty string. [#7927](https://github.com/grafana/grafana/issues/7927)
* **Graph**: Cannot add fill below to series override [#7916](https://github.com/grafana/grafana/issues/7916)
* **InfluxDB**: Influxb Datasource test passes even if the Database doesn't exist [#7864](https://github.com/grafana/grafana/issues/7864)
* **Prometheus**: Displaying Prometheus annotations is incredibly slow [#7750](https://github.com/grafana/grafana/issues/7750), thx [@mtanda](https://github.com/mtanda)
* **Graphite**: grafana generates empty find query to graphite -> 422 Unprocessable Entity [#7740](https://github.com/grafana/grafana/issues/7740)
* **Admin**: make organisation filter case insensitive [#8194](https://github.com/grafana/grafana/issues/8194), thx [@Alexander-N](https://github.com/Alexander-N)
## Changes
* **Elasticsearch**: Changed elasticsearch Terms aggregation to default to Min Doc Count to 1, and sort order to Top [#8321](https://github.com/grafana/grafana/issues/8321)
## Tech
* **Library Upgrade**: inconshreveable/log15 outdated - no support for solaris [#8262](https://github.com/grafana/grafana/issues/8262)
* **Library Upgrade**: Upgrade Macaron [#7600](https://github.com/grafana/grafana/issues/7600)
# 4.2.0 (2017-03-22)
## Minor Enhancements
* **Templates**: Prevent use of the prefix `__` for templates in web UI [#7678](https://github.com/grafana/grafana/issues/7678)
* **Threema**: Add emoji to Threema alert notifications [#7676](https://github.com/grafana/grafana/pull/7676) thx [@dbrgn](https://github.com/dbrgn)
* **Panels**: Support dm3 unit [#7695](https://github.com/grafana/grafana/issues/7695) thx [@mitjaziv](https://github.com/mitjaziv)
* **Docs**: Added some details about Sessions in Postgres [#7694](https://github.com/grafana/grafana/pull/7694) thx [@rickard-von-essen](https://github.com/rickard-von-essen)
* **Influxdb**: Allow commas in template variables [#7681](https://github.com/grafana/grafana/issues/7681) thx [@thuck](https://github.com/thuck)
* **Cloudwatch**: stop using deprecated session.New() [#7736](https://github.com/grafana/grafana/issues/7736) thx [@mtanda](https://github.com/mtanda)
* **OpenTSDB**: Pass dropcounter rate option if no max counter and no reset value or reset value as 0 is specified [#7743](https://github.com/grafana/grafana/pull/7743) thx [@r4um](https://github.com/r4um)
* **Templating**: support full resolution for $interval variable [#7696](https://github.com/grafana/grafana/pull/7696) thx [@mtanda](https://github.com/mtanda)
* **Elasticsearch**: Unique Count on string fields in ElasticSearch [#3536](https://github.com/grafana/grafana/issues/3536), thx [@pyro2927](https://github.com/pyro2927)
* **Templating**: Data source template variable that refers to other variable in regex filter [#6365](https://github.com/grafana/grafana/issues/6365) thx [@rlodge](https://github.com/rlodge)
* **Admin**: Global User List: add search and pagination [#7469](https://github.com/grafana/grafana/issues/7469)
* **User Management**: Invite UI is now disabled when login form is disabled [#7875](https://github.com/grafana/grafana/issues/7875)
## Bugfixes
* **Webhook**: Use proxy settings from environment variables [#7710](https://github.com/grafana/grafana/issues/7710)
* **Panels**: Deleting a dashboard with unsaved changes raises an error message [#7591](https://github.com/grafana/grafana/issues/7591) thx [@thuck](https://github.com/thuck)
* **Influxdb**: Query builder detects regex to easily for measurement [#7276](https://github.com/grafana/grafana/issues/7276) thx [@thuck](https://github.com/thuck)
* **Docs**: router_logging not documented [#7723](https://github.com/grafana/grafana/issues/7723)
* **Alerting**: Spelling mistake [#7739](https://github.com/grafana/grafana/pull/7739) thx [@woutersmit](https://github.com/woutersmit)
* **Alerting**: Graph legend scrolls to top when an alias is toggled/clicked [#7680](https://github.com/grafana/grafana/issues/7680) thx [@p4ddy1](https://github.com/p4ddy1)
* **Panels**: Fixed panel tooltip description after scrolling down [#7708](https://github.com/grafana/grafana/issues/7708) thx [@askomorokhov](https://github.com/askomorokhov)
# 4.2.0-beta1 (2017-02-27)
## Enhancements
* **Telegram**: Added Telegram alert notifier [#7098](https://github.com/grafana/grafana/pull/7098), thx [@leonoff](https://github.com/leonoff)
* **Templating**: Make $__interval and $__interval_ms global built in variables that can be used in by any datasource (in panel queries), closes [#7190](https://github.com/grafana/grafana/issues/7190), closes [#6582](https://github.com/grafana/grafana/issues/6582)
* **S3 Image Store**: External s3 image store (used in alert notifications) now support AWS IAM Roles, closes [#6985](https://github.com/grafana/grafana/issues/6985), [#7058](https://github.com/grafana/grafana/issues/7058) thx [@mtanda](https://github.com/mtanda)
* **SingleStat**: Implements diff aggregation method for singlestat [#7234](https://github.com/grafana/grafana/issues/7234), thx [@oliverpool](https://github.com/oliverpool)
* **Dataproxy**: Added setting to enable more verbose logging in dataproxy [#7209](https://github.com/grafana/grafana/pull/7209), thx [@Ricky-N](https://github.com/Ricky-N)
* **Alerting**: Better information about why an alert triggered [#7035](https://github.com/grafana/grafana/issues/7035)
* **LINE**: Add LINE as alerting notification channel [#7301](https://github.com/grafana/grafana/pull/7301), thx [@huydx](https://github.com/huydx)
* **LINE**: Adds image to notification message [#7417](https://github.com/grafana/grafana/pull/7417), thx [@Erliz](https://github.com/Erliz)
* **Hipchat**: Adds support for sending alert notifications to hipchat [#6451](https://github.com/grafana/grafana/issues/6451), thx [@jregovic](https://github.com/jregovic)
* **Alerting**: Uploading images for alert notifications is now optional [#7419](https://github.com/grafana/grafana/issues/7419)
* **Dashboard**: Adds shortcut for collapsing/expanding all rows [#552](https://github.com/grafana/grafana/issues/552), thx [@mtanda](https://github.com/mtanda)
* **Alerting**: Adds de duping of alert notifications [#7632](https://github.com/grafana/grafana/pull/7632)
* **Orgs**: Sharing dashboards using Grafana share feature will now redirect to correct org. [#1613](https://github.com/grafana/grafana/issues/1613)
* **Pushover**: Add Pushover alert notifications [#7526](https://github.com/grafana/grafana/pull/7526) thx [@devkid](https://github.com/devkid)
* **Threema**: Add Threema Gateway alert notification integration [#7482](https://github.com/grafana/grafana/pull/7482) thx [@dbrgn](https://github.com/dbrgn)
## Minor Enhancements
* **Optimzation**: Never issue refresh event when Grafana tab is not visible [#7218](https://github.com/grafana/grafana/issues/7218), thx [@mtanda](https://github.com/mtanda)
* **Browser History**: Browser back/forward now works time ranges / zoom, [#7259](https://github.com/grafana/grafana/issues/7259)
* **Elasticsearch**: Support for Min Doc Count options in Terms aggregation [#7324](https://github.com/grafana/grafana/pull/7324), thx [@lpic10](https://github.com/lpic10)
* **Elasticsearch**: Term aggregation limit can now be changed in template queries [#7112](https://github.com/grafana/grafana/issues/7112), thx [@FFalcon](https://github.com/FFalcon)
* **Elasticsearch**: Ad-hoc filters now support all operators [#7612](https://github.com/grafana/grafana/issues/7612), thx [@tamayika](https://github.com/tamayika)
* **Graph**: Add full series name as title for legends. [#7493](https://github.com/grafana/grafana/pull/7493), thx [@kolobaev](https://github.com/kolobaev)
* **Table**: Add a message when queries returns no data. [#6109](https://github.com/grafana/grafana/issues/6109), thx [@xginn8](https://github.com/xginn8)
* **Graph**: Set max width for series names in legend tables. [#2385](https://github.com/grafana/grafana/issues/2385), thx [@kolobaev](https://github.com/kolobaev)
* **Database**: Allow max db connection pool configuration [#7427](https://github.com/grafana/grafana/issues/7427), thx [@huydx](https://github.com/huydx)
* **Datasources** Delete datsource by name [#7476](https://github.com/grafana/grafana/issues/7476), thx [@huydx](https://github.com/huydx)
* **Dataproxy**: Only allow get that begins with api/ to access Prometheus [#7459](https://github.com/grafana/grafana/pull/7459), thx [@mtanda](https://github.com/mtanda)
* **Snapshot**: Make timeout for snapshot creation configurable [#7449](https://github.com/grafana/grafana/pull/7449) thx [@ryu1-sakai](https://github.com/ryu1-sakai)
* **Panels**: Add more physics units [#7554](https://github.com/grafana/grafana/pull/7554) thx [@ryantxu](https://github.com/ryantxu)
* **Email**: Add sender's name on email [#2131](https://github.com/grafana/grafana/issues/2131) thx [@jacobbednarz](https://github.com/jacobbednarz)
* **HTTPS**: Set tls 1.2 as lowest tls version. [#7347](https://github.com/grafana/grafana/pull/7347) thx [@roman-vynar](https://github.com/roman-vynar)
* **Table**: Added suppressing of empty results to table plugin. [#7602](https://github.com/grafana/grafana/pull/7602) thx [@LLIyRiK](https://github.com/LLIyRiK)
## Tech
* **Library Upgrade**: Upgraded angularjs from 1.5.8 to 1.6.1 [#7274](https://github.com/grafana/grafana/issues/7274)
* **Backend**: Grafana is now built using golang 1.8
## Bugfixes
* **Alerting**: Fixes missing support for no_data and execution error when testing alerts [#7149](https://github.com/grafana/grafana/issues/7149)
* **Dashboard**: Avoid duplicate data in dashboard json for panels with alerts [#7256](https://github.com/grafana/grafana/pull/7256)
* **Alertlist**: Only show scrollbar when required [#7269](https://github.com/grafana/grafana/issues/7269)
* **SMTP**: Set LocalName to hostname [#7223](https://github.com/grafana/grafana/issues/7223)
* **Sidemenu**: Disable sign out in sidemenu for AuthProxyEnabled [#7377](https://github.com/grafana/grafana/pull/7377), thx [@solugebefola](https://github.com/solugebefola)
* **Prometheus**: Add support for basic auth in Prometheus tsdb package [#6799](https://github.com/grafana/grafana/issues/6799), thx [@hagen1778](https://github.com/hagen1778)
* **OAuth**: Redirect to original page when logging in with OAuth [#7513](https://github.com/grafana/grafana/issues/7513)
* **Annotations**: Wrap text in annotations tooltip [#7542](https://github.com/grafana/grafana/pull/7542), thx [@xginn8](https://github.com/xginn8)
* **Templating**: Fixes error when using numeric sort on empty strings [#7382](https://github.com/grafana/grafana/issues/7382)
* **Templating**: Fixed issue detecting template variable dependency [#7354](https://github.com/grafana/grafana/issues/7354)
# 4.1.2 (2017-02-13)
### Bugfixes
* **Table**: Fixes broken annotation rendering mode in the table panel [#7268](https://github.com/grafana/grafana/issues/7268)
* **Data Sources**: Sorting for lists of data sources in UI is now case insensitive [#7491](https://github.com/grafana/grafana/issues/7491)
* **Admin**: Support more then 1000 users in global users list [#7469](https://github.com/grafana/grafana/issues/7469)
# 4.1.1 (2017-01-11)
### Bugfixes
* **Graph Panel**: Fixed issue with legend height in table mode [#7221](https://github.com/grafana/grafana/issues/7221)
# 4.1.0 (2017-01-11)
### Bugfixes
* **Server side PNG rendering**: Fixed issue with y-axis label rotation in phantomjs rendered images [#6924](https://github.com/grafana/grafana/issues/6924)
* **Graph**: Fixed centering of y-axis label [#7099](https://github.com/grafana/grafana/issues/7099)
* **Graph**: Fixed graph legend table mode and always visible scrollbar [#6828](https://github.com/grafana/grafana/issues/6828)
* **Templating**: Fixed template variable value groups/tags feature [#6752](https://github.com/grafana/grafana/issues/6752)
* **Webhook**: Fixed webhook username mismatch [#7195](https://github.com/grafana/grafana/pull/7195), thx [@theisenmark](https://github.com/theisenmark)
* **Influxdb**: Handles time(auto) the same way as time($interval) [#6997](https://github.com/grafana/grafana/issues/6997)
## Enhancements
* **Elasticsearch**: Added support for all moving average options [#7154](https://github.com/grafana/grafana/pull/7154), thx [@vaibhavinbayarea](https://github.com/vaibhavinbayarea)
# 4.1-beta1 (2016-12-21)
### Enhancements
* **Postgres**: Add support for Certs for Postgres database [#6655](https://github.com/grafana/grafana/issues/6655)
* **Victorops**: Add VictorOps notification integration [#6411](https://github.com/grafana/grafana/issues/6411), thx [@ichekrygin](https://github.com/ichekrygin)
* **Opsgenie**: Add OpsGenie notification integratiion [#6687](https://github.com/grafana/grafana/issues/6687), thx [@kylemcc](https://github.com/kylemcc)
* **Singlestat**: New aggregation on singlestat panel [#6740](https://github.com/grafana/grafana/pull/6740), thx [@dirk-leroux](https://github.com/dirk-leroux)
* **Cloudwatch**: Make it possible to specify access and secret key on the data source config page [#6697](https://github.com/grafana/grafana/issues/6697)
* **Table**: Added Hidden Column Style for Table Panel [#5677](https://github.com/grafana/grafana/pull/5677), thx [@bmundt](https://github.com/bmundt)
* **Graph**: Shared crosshair option renamed to shared tooltip, shows tooltip on all graphs as you hover over one graph. [#1578](https://github.com/grafana/grafana/pull/1578), [#6274](https://github.com/grafana/grafana/pull/6274)
* **Elasticsearch**: Added support for Missing option (bucket) for terms aggregation [#4244](https://github.com/grafana/grafana/pull/4244), thx [@shanielh](https://github.com/shanielh)
* **Elasticsearch**: Added support for Elasticsearch 5.x [#5740](https://github.com/grafana/grafana/issues/5740), thx [@lpic10](https://github.com/lpic10)
* **CLI**: Make it possible to reset the admin password using the grafana-cli. [#5479](https://github.com/grafana/grafana/issues/5479)
* **Influxdb**: Support multiple tags in InfluxDB annotations. [#4550](https://github.com/grafana/grafana/pull/4550), thx [@adrianlzt](https://github.com/adrianlzt)
* **LDAP**: Basic Auth now supports LDAP username and password, [#6940](https://github.com/grafana/grafana/pull/6940), thx [@utkarshcmu](https://github.com/utkarshcmu)
* **LDAP**: Now works with Auth Proxy, role and organisation mapping & sync will regularly be performed. [#6895](https://github.com/grafana/grafana/pull/6895), thx [@Seuf](https://github.com/seuf)
* **Alerting**: Adds OK as no data option. [#6866](https://github.com/grafana/grafana/issues/6866)
* **Alert list**: Order alerts based on state. [#6676](https://github.com/grafana/grafana/issues/6676)
* **Alerting**: Add api endpoint for pausing all alerts. [#6589](https://github.com/grafana/grafana/issues/6589)
* **Panel**: Added help text for panels. [#4079](https://github.com/grafana/grafana/issues/4079), thx [@utkarshcmu](https://github.com/utkarshcmu)
### Bugfixes
* **API**: HTTP API for deleting org returning incorrect message for a non-existing org [#6679](https://github.com/grafana/grafana/issues/6679)
* **Dashboard**: Posting empty dashboard result in corrupted dashboard [#5443](https://github.com/grafana/grafana/issues/5443)
* **Logging**: Fixed logging level confing issue [#6978](https://github.com/grafana/grafana/issues/6978)
* **Notifications**: Remove html escaping the email subject. [#6905](https://github.com/grafana/grafana/issues/6905)
* **Influxdb**: Fixes broken field dropdown when using template vars as measurement. [#6473](https://github.com/grafana/grafana/issues/6473)
# 4.0.2 (2016-12-08)
### Enhancements
* **Playlist**: Add support for kiosk mode [#6727](https://github.com/grafana/grafana/issues/6727)
### Bugfixes
* **Alerting**: Add alert message to webhook notifications [#6807](https://github.com/grafana/grafana/issues/6807)
* **Alerting**: Fixes a bug where avg() reducer treated null as zero. [#6879](https://github.com/grafana/grafana/issues/6879)
* **PNG Rendering**: Fix for server side rendering when using non default http addr bind and domain setting [#6813](https://github.com/grafana/grafana/issues/6813)
* **PNG Rendering**: Fix for server side rendering when setting enforce_domain to true [#6769](https://github.com/grafana/grafana/issues/6769)
* **Webhooks**: Add content type json to outgoing webhooks [#6822](https://github.com/grafana/grafana/issues/6822)
* **Keyboard shortcut**: Fixed zoom out shortcut [#6837](https://github.com/grafana/grafana/issues/6837)
* **Webdav**: Adds basic auth headers to webdav uploader [#6779](https://github.com/grafana/grafana/issues/6779)
# 4.0.1 (2016-12-02)
> **Notice**
4.0.0 had serious connection pooling issue when using a data source in proxy access. This bug caused lots of resource issues
due to too many connections/file handles on the data source backend. This problem is fixed in this release.
### Bugfixes
* **Metrics**: Fixes nil pointer dereference on my arm build [#6749](https://github.com/grafana/grafana/issues/6749)
* **Data proxy**: Fixes a tcp pooling issue in the datasource reverse proxy [#6759](https://github.com/grafana/grafana/issues/6759)
# 4.0-stable (2016-11-29)
### Bugfixes
* **Server-side rendering**: Fixed address used when rendering panel via phantomjs and using non default http_addr config [#6660](https://github.com/grafana/grafana/issues/6660)
* **Graph panel**: Fixed graph panel tooltip sort order issue [#6648](https://github.com/grafana/grafana/issues/6648)
* **Unsaved changes**: You now navigate to the intended page after saving in the unsaved changes dialog [#6675](https://github.com/grafana/grafana/issues/6675)
* **TLS Client Auth**: Support for TLS client authentication for datasource proxies [#2316](https://github.com/grafana/grafana/issues/2316)
* **Alerts out of sync**: Saving dashboards with broken alerts causes sync problem[#6576](https://github.com/grafana/grafana/issues/6576)
* **Alerting**: Saving an alert with condition "HAS NO DATA" throws an error[#6701](https://github.com/grafana/grafana/issues/6701)
* **Config**: Improve error message when parsing broken config file [#6731](https://github.com/grafana/grafana/issues/6731)
* **Table**: Render empty dates as - instead of current date [#6728](https://github.com/grafana/grafana/issues/6728)
# 4.0-beta2 (2016-11-21)
### Bugfixes
* **Graph Panel**: Log base scale on right Y-axis had no effect, max value calc was not applied, [#6534](https://github.com/grafana/grafana/issues/6534)
* **Graph Panel**: Bar width if bars was only used in series override, [#6528](https://github.com/grafana/grafana/issues/6528)
* **UI/Browser**: Fixed issue with page/view header gradient border not showing in Safari, [#6530](https://github.com/grafana/grafana/issues/6530)
* **Cloudwatch**: Fixed cloudwatch datasource requesting to many datapoints, [#6544](https://github.com/grafana/grafana/issues/6544)
* **UX**: Panel Drop zone visible after duplicating panel, and when entering fullscreen/edit view, [#6598](https://github.com/grafana/grafana/issues/6598)
* **Templating**: Newly added variable was not visible directly only after dashboard reload, [#6622](https://github.com/grafana/grafana/issues/6622)
### Enhancements
* **Singlestat**: Support repeated template variables in prefix/postfix [#6595](https://github.com/grafana/grafana/issues/6595)
* **Templating**: Don't persist variable options with refresh option [#6586](https://github.com/grafana/grafana/issues/6586)
* **Alerting**: Add ability to have OR conditions (and mixing AND & OR) [#6579](https://github.com/grafana/grafana/issues/6579)
* **InfluxDB**: Fix for Ad-Hoc Filters variable & changing dashboards [#6821](https://github.com/grafana/grafana/issues/6821)
# 4.0-beta1 (2016-11-09)
### Enhancements
* **Login**: Adds option to disable username/password logins, closes [#4674](https://github.com/grafana/grafana/issues/4674)
* **SingleStat**: Add seriename as option in singlestat panel, closes [#4740](https://github.com/grafana/grafana/issues/4740)
* **Localization**: Week start day now dependant on browser locale setting, closes [#3003](https://github.com/grafana/grafana/issues/3003)
* **Templating**: Update panel repeats for variables that change on time refresh, closes [#5021](https://github.com/grafana/grafana/issues/5021)
* **Templating**: Add support for numeric and alphabetical sorting of variable values, closes [#2839](https://github.com/grafana/grafana/issues/2839)
* **Elasticsearch**: Support to set Precision Threshold for Unique Count metric, closes [#4689](https://github.com/grafana/grafana/issues/4689)
* **Navigation**: Add search to org swithcer, closes [#2609](https://github.com/grafana/grafana/issues/2609)
* **Database**: Allow database config using one propertie, closes [#5456](https://github.com/grafana/grafana/pull/5456)
* **Graphite**: Add support for groupByNodes, closes [#5613](https://github.com/grafana/grafana/pull/5613)
* **Influxdb**: Add support for elapsed(), closes [#5827](https://github.com/grafana/grafana/pull/5827)
* **OpenTSDB**: Add support for explicitTags for OpenTSDB>=2.3, closes [#6360](https://github.com/grafana/grafana/pull/6361)
* **OAuth**: Add support for generic oauth, closes [#4718](https://github.com/grafana/grafana/pull/4718)
* **Cloudwatch**: Add support to expand multi select template variable, closes [#5003](https://github.com/grafana/grafana/pull/5003)
* **Background Tasks**: Now support automatic purging of old snapshots, closes [#4087](https://github.com/grafana/grafana/issues/4087)
* **Background Tasks**: Now support automatic purging of old rendered images, closes [#2172](https://github.com/grafana/grafana/issues/2172)
* **Dashboard**: After inactivity hide nav/row actions, fade to nice clean view, can be toggled with `d v`, also added kiosk mode, toggled via `d k` [#6476](https://github.com/grafana/grafana/issues/6476)
* **Dashboard**: Improved dashboard row menu & add panel UX [#6442](https://github.com/grafana/grafana/issues/6442)
* **Graph Panel**: Support for stacking null values [#2912](https://github.com/grafana/grafana/issues/2912), [#6287](https://github.com/grafana/grafana/issues/6287), thanks @benrubson!
### Breaking changes
* **SystemD**: Change systemd description, closes [#5971](https://github.com/grafana/grafana/pull/5971)
* **lodash upgrade**: Upgraded lodash from 2.4.2 to 4.15.0, this contains a number of breaking changes that could effect plugins. closes [#6021](https://github.com/grafana/grafana/pull/6021)
### Bug fixes
* **Table Panel**: Fixed problem when switching to Mixed datasource in metrics tab, fixes [#5999](https://github.com/grafana/grafana/pull/5999)
* **Playlist**: Fixed problem with play order not matching order defined in playlist, fixes [#5467](https://github.com/grafana/grafana/pull/5467)
* **Graph panel**: Fixed problem with auto decimals on y axis when datamin=datamax, fixes [#6070](https://github.com/grafana/grafana/pull/6070)
* **Snapshot**: Can view embedded panels/png rendered panels in snapshots without login, fixes [#3769](https://github.com/grafana/grafana/pull/3769)
* **Elasticsearch**: Fix for query template variable when looking up terms without query, no longer relies on elasticsearch default field, fixes [#3887](https://github.com/grafana/grafana/pull/3887)
* **Elasticsearch**: Fix for displaying IP address used in terms aggregations, fixes [#4393](https://github.com/grafana/grafana/pull/4393)
* **PNG Rendering**: Fix for server side rendering when using auth proxy, fixes [#5906](https://github.com/grafana/grafana/pull/5906)
* **OpenTSDB**: Fixed multi-value nested templating for opentsdb, fixes [#6455](https://github.com/grafana/grafana/pull/6455)
* **Playlist**: Remove playlist items when dashboard is removed, fixes [#6292](https://github.com/grafana/grafana/issues/6292)
# 3.1.2 (unreleased)
* **Templating**: Fixed issue when combining row & panel repeats, fixes [#5790](https://github.com/grafana/grafana/issues/5790)
* **Drag&Drop**: Fixed issue with drag and drop in latest Chrome(51+), fixes [#5767](https://github.com/grafana/grafana/issues/5767)
* **Internal Metrics**: Fixed issue with dots in instance_name when sending internal metrics to Graphite, fixes [#5739](https://github.com/grafana/grafana/issues/5739)
* **Grafana-CLI**: Add default plugin path for MAC OS, fixes [#5806](https://github.com/grafana/grafana/issues/5806)
* **Grafana-CLI**: Improve error message for upgrade-all command, fixes [#5885](https://github.com/grafana/grafana/issues/5885)
# 3.1.1 (2016-08-01)
* **IFrame embedding**: Fixed issue of using full iframe height, fixes [#5605](https://github.com/grafana/grafana/issues/5606)
* **Panel PNG rendering**: Fixed issue detecting render completion, fixes [#5605](https://github.com/grafana/grafana/issues/5606)
* **Elasticsearch**: Fixed issue with templating query and json parse error, fixes [#5615](https://github.com/grafana/grafana/issues/5615)
* **Tech**: Upgraded JQuery to 2.2.4 to fix Security vulnerabilitie in 2.1.4, fixes [#5627](https://github.com/grafana/grafana/issues/5627)
* **Graphite**: Fixed issue with mixed data sources and Graphite, fixes [#5617](https://github.com/grafana/grafana/issues/5617)
* **Templating**: Fixed issue with template variable query was issued multiple times during dashboard load, fixes [#5637](https://github.com/grafana/grafana/issues/5637)
* **Zoom**: Fixed issues with zoom in and out on embedded (iframed) panel, fixes [#4489](https://github.com/grafana/grafana/issues/4489), [#5666](https://github.com/grafana/grafana/issues/5666)
# 3.1.0 stable (2016-07-12)
### Bugfixes & Enhancements,
* **User Alert Notices**: Backend error alert popups did not show properly, fixes [#5435](https://github.com/grafana/grafana/issues/5435)
* **Table**: Added sanitize HTML option to allow links in table cells, fixes [#4596](https://github.com/grafana/grafana/issues/4596)
* **Apps**: App dashboards are automatically synced to DB at startup after plugin update, fixes [#5529](https://github.com/grafana/grafana/issues/5529)
# 3.1.0-beta1 (2016-06-23)
### Enhancements
* **Dashboard Export/Import**: Dashboard export now templetize data sources and constant variables, users pick these on import, closes [#5084](https://github.com/grafana/grafana/issues/5084)
* **Dashboard Url**: Time range changes updates url, closes [#458](https://github.com/grafana/grafana/issues/458)
* **Dashboard Url**: Template variable change updates url, closes [#5002](https://github.com/grafana/grafana/issues/5002)
* **Singlestat**: Add support for range to text mappings, closes [#1319](https://github.com/grafana/grafana/issues/1319)
* **Graph**: Adds sort order options for graph tooltip, closes [#1189](https://github.com/grafana/grafana/issues/1189)
* **Theme**: Add default theme to config file [#5011](https://github.com/grafana/grafana/pull/5011)
* **Page Footer**: Added page footer with links to docs, shows Grafana version and info if new version is available, closes [#4889](https://github.com/grafana/grafana/pull/4889)
* **InfluxDB**: Add spread function, closes [#5211](https://github.com/grafana/grafana/issues/5211)
* **Scripts**: Use restart instead of start for deb package script, closes [#5282](https://github.com/grafana/grafana/pull/5282)
* **Logging**: Moved to structured logging lib, and moved to component specific level filters via config file, closes [#4590](https://github.com/grafana/grafana/issues/4590)
* **OpenTSDB**: Support nested template variables in tag_values function, closes [#4398](https://github.com/grafana/grafana/issues/4398)
* **Datasource**: Pending data source requests are cancelled before new ones are issues (Graphite & Prometheus), closes [#5321](https://github.com/grafana/grafana/issues/5321)
### Breaking changes
* **Logging** : Changed default logging output format (now structured into message, and key value pairs, with logger key acting as component). You can also no change in config to json log ouput.
* **Graphite** : The Graph panel no longer have a Graphite PNG option. closes [#5367](https://github.com/grafana/grafana/issues/5367)
### Bug fixes
* **PNG rendering**: Fixed phantomjs rendering and y-axis label rotation. fixes [#5220](https://github.com/grafana/grafana/issues/5220)
* **CLI**: The cli tool now supports reading plugin.json from dist/plugin.json. fixes [#5410](https://github.com/grafana/grafana/issues/5410)
# 3.0.4 Patch release (2016-05-25)
* **Panel**: Fixed blank dashboard issue when switching to other dashboard while in fullscreen edit mode, fixes [#5163](https://github.com/grafana/grafana/pull/5163)
* **Templating**: Fixed issue with nested multi select variables and cascading and updating child variable selection state, fixes [#4861](https://github.com/grafana/grafana/pull/4861)
* **Templating**: Fixed issue with using templated data source in another template variable query, fixes [#5165](https://github.com/grafana/grafana/pull/5165)
* **Singlestat gauge**: Fixed issue with gauge render position, fixes [#5143](https://github.com/grafana/grafana/pull/5143)
* **Home dashboard**: Fixes broken home dashboard api, fixes [#5167](https://github.com/grafana/grafana/issues/5167)
# 3.0.3 Patch release (2016-05-23)
* **Annotations**: Annotations can now use a template variable as data source, closes [#5054](https://github.com/grafana/grafana/issues/5054)
* **Time picker**: Fixed issue timepicker and UTC when reading time from URL, fixes [#5078](https://github.com/grafana/grafana/issues/5078)
* **CloudWatch**: Support for Multiple Account by AssumeRole, closes [#3522](https://github.com/grafana/grafana/issues/3522)
* **Singlestat**: Fixed alignment and minium height issue, fixes [#5113](https://github.com/grafana/grafana/issues/5113), fixes [#4679](https://github.com/grafana/grafana/issues/4679)
* **Share modal**: Fixed link when using grafana under dashboard sub url, fixes [#5109](https://github.com/grafana/grafana/issues/5109)
* **Prometheus**: Fixed bug in query editor that caused it not to load when reloading page, fixes [#5107](https://github.com/grafana/grafana/issues/5107)
* **Elasticsearch**: Fixed bug when template variable query returns numeric values, fixes [#5097](https://github.com/grafana/grafana/issues/5097), fixes [#5088](https://github.com/grafana/grafana/issues/5088)
* **Logging**: Fixed issue with reading logging level value, fixes [#5079](https://github.com/grafana/grafana/issues/5079)
* **Timepicker**: Fixed issue with timepicker and UTC when reading time from URL, fixes [#5078](https://github.com/grafana/grafana/issues/5078)
* **Docs**: Added docs for org & user preferences HTTP API, closes [#5069](https://github.com/grafana/grafana/issues/5069)
* **Plugin list panel**: Now shows correct enable state for apps when not enabled, fixes [#5068](https://github.com/grafana/grafana/issues/5068)
* **Elasticsearch**: Templating & Annotation queries that use template variables are now formatted correctly, fixes [#5135](https://github.com/grafana/grafana/issues/5135)
# 3.0.2 Patch release (2016-05-16)
* **Templating**: Fixed issue mixing row repeat and panel repeats, fixes [#4988](https://github.com/grafana/grafana/issues/4988)
* **Templating**: Fixed issue detecting dependencies in nested variables, fixes [#4987](https://github.com/grafana/grafana/issues/4987), fixes [#4986](https://github.com/grafana/grafana/issues/4986)
* **Graph**: Fixed broken PNG rendering in graph panel, fixes [#5025](https://github.com/grafana/grafana/issues/5025)
* **Graph**: Fixed broken xaxis on graph panel, fixes [#5024](https://github.com/grafana/grafana/issues/5024)
* **Influxdb**: Fixes crash when hiding middle serie, fixes [#5005](https://github.com/grafana/grafana/issues/5005)
# 3.0.1 Stable (2016-05-11)
### Bug fixes
* **Templating**: Fixed issue with new data source variable not persisting current selected value, fixes [#4934](https://github.com/grafana/grafana/issues/4934)
# 3.0.0-beta7 (2016-05-02)
### Bug fixes
* **Dashboard title**: Fixed max dashboard title width (media query) for large screens, fixes [#4859](https://github.com/grafana/grafana/issues/4859)
* **Annotations**: Fixed issue with entering annotation edit view, fixes [#4857](https://github.com/grafana/grafana/issues/4857)
* **Remove query**: Fixed issue with removing query for data sources without collapsable query editors, fixes [#4856](https://github.com/grafana/grafana/issues/4856)
* **Graphite PNG**: Fixed issue graphite png rendering option, fixes [#4864](https://github.com/grafana/grafana/issues/4864)
* **InfluxDB**: Fixed issue missing plus group by iconn, fixes [#4862](https://github.com/grafana/grafana/issues/4862)
* **Graph**: Fixes missing line mode for thresholds, fixes [#4902](https://github.com/grafana/grafana/pull/4902)
### Enhancements
* **InfluxDB**: Added new functions moving_average and difference to query editor, closes [#4698](https://github.com/grafana/grafana/issues/4698)
# 3.0.0-beta6 (2016-04-29)
### Enhancements
* **Singlestat**: Support for gauges in singlestat panel. closes [#3688](https://github.com/grafana/grafana/pull/3688)
* **Templating**: Support for data source as variable, closes [#816](https://github.com/grafana/grafana/pull/816)
### Bug fixes
* **InfluxDB 0.12**: Fixed issue templating and `show tag values` query only returning tags for first measurement, fixes [#4726](https://github.com/grafana/grafana/issues/4726)
* **Templating**: Fixed issue with regex formating when matching multiple values, fixes [#4755](https://github.com/grafana/grafana/issues/4755)
* **Templating**: Fixed issue with custom all value and escaping, fixes [#4736](https://github.com/grafana/grafana/issues/4736)
* **Dashlist**: Fixed issue dashboard list panel and caching tags, fixes [#4768](https://github.com/grafana/grafana/issues/4768)
* **Graph**: Fixed issue with unneeded scrollbar in legend for Firefox, fixes [#4760](https://github.com/grafana/grafana/issues/4760)
* **Table panel**: Fixed issue table panel formating string array properties, fixes [#4791](https://github.com/grafana/grafana/issues/4791)
* **grafana-cli**: Improve error message when failing to install plugins due to corrupt response, fixes [#4651](https://github.com/grafana/grafana/issues/4651)
* **Singlestat**: Fixes prefix an postfix for gauges, fixes [#4812](https://github.com/grafana/grafana/issues/4812)
* **Singlestat**: Fixes auto-refresh on change for some options, fixes [#4809](https://github.com/grafana/grafana/issues/4809)
### Breaking changes
**Data Source Query Editors**: Issue [#3900](https://github.com/grafana/grafana/issues/3900)
Query editors have been updated to use the new form styles. External data source plugins needs to be
updated to work. Sorry to introduce breaking change this late in beta phase. We wanted to get this change
in before 3.0 stable is released so we don't have to break data sources in next release (3.1). If you are
a data source plugin author and want help for how the new form styles work please ask for help in
slack channel (link to slack channel in readme).
# 3.0.0-beta5 (2016-04-15)
### Bug fixes
* **grafana-cli**: Fixed issue grafana-cli tool, did not detect the right plugin dir, fixes [#4723](https://github.com/grafana/grafana/issues/4723)
* **Graph**: Fixed issue with light theme text color issue in tooltip, fixes [#4702](https://github.com/grafana/grafana/issues/4702)
* **Snapshot**: Fixed issue with empty snapshots, fixes [#4706](https://github.com/grafana/grafana/issues/4706)
# 3.0.0-beta4 (2016-04-13)
### Bug fixes
* **Home dashboard**: Fixed issue with permission denied error on home dashboard, fixes [#4686](https://github.com/grafana/grafana/issues/4686)
* **Templating**: Fixed issue templating variables that use regex extraction, fixes [#4672](https://github.com/grafana/grafana/issues/4672)
# 3.0.0-beta3 (2016-04-12)
### Enhancements
* **InfluxDB**: Changed multi query encoding to work with InfluxDB 0.11 & 0.12, closes [#4533](https://github.com/grafana/grafana/issues/4533)
* **Timepicker**: Add arrows and shortcuts for moving back and forth in current dashboard, closes [#119](https://github.com/grafana/grafana/issues/119)
### Bug fixes
* **Postgres**: Fixed page render crash when using postgres, fixes [#4558](https://github.com/grafana/grafana/issues/4558)
@@ -429,7 +1040,7 @@ Grafana 2.x is fundamentally different from 1.x; it now ships with an integrated
# 1.8.0 (2014-09-22)
Read this [blog post](http://grafana.org/blog/2014/09/11/grafana-1-8-0-rc1-released.html) for an overview of all improvements.
Read this [blog post](https://grafana.com/blog/2014/09/11/grafana-1.8.0-rc1-released) for an overview of all improvements.
**Fixes**
- [Issue #802](https://github.com/grafana/grafana/issues/802). Annotations: Fix when using InfluxDB datasource
+46
View File
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact@grafana.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
-351
View File
@@ -1,351 +0,0 @@
{
"ImportPath": "github.com/grafana/grafana",
"GoVersion": "go1.5.1",
"GodepVersion": "v60",
"Packages": [
"./pkg/..."
],
"Deps": [
{
"ImportPath": "github.com/BurntSushi/toml",
"Comment": "v0.1.0-21-g056c9bc",
"Rev": "056c9bc7be7190eaa7715723883caffa5f8fa3e4"
},
{
"ImportPath": "github.com/Unknwon/com",
"Rev": "d9bcf409c8a368d06c9b347705c381e7c12d54df"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/awserr",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/awsutil",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/client",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/client/metadata",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/corehandlers",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/defaults",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/ec2metadata",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/request",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/session",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/endpoints",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/ec2query",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/signer/v4",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/waiter",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatch",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/ec2",
"Comment": "v1.0.0",
"Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/bmizerany/assert",
"Comment": "release.r60-6-ge17e998",
"Rev": "e17e99893cb6509f428e1728281c2ad60a6b31e3"
},
{
"ImportPath": "github.com/bradfitz/gomemcache/memcache",
"Comment": "release.r60-40-g72a6864",
"Rev": "72a68649ba712ee7c4b5b4a943a626bcd7d90eb8"
},
{
"ImportPath": "github.com/codegangsta/cli",
"Comment": "1.2.0-187-gc31a797",
"Rev": "c31a7975863e7810c92e2e288a9ab074f9a88f29"
},
{
"ImportPath": "github.com/davecgh/go-spew/spew",
"Rev": "2df174808ee097f90d259e432cc04442cf60be21"
},
{
"ImportPath": "github.com/fatih/color",
"Comment": "v0.1-16-g4f7bcef",
"Rev": "4f7bcef27eec7925456d0c30c5e7b0408b3339be"
},
{
"ImportPath": "github.com/franela/goreq",
"Rev": "3ddeded65be21dacb5a2e2d0b95af9ff6862a2b5"
},
{
"ImportPath": "github.com/go-ini/ini",
"Comment": "v0-48-g060d7da",
"Rev": "060d7da055ba6ec5ea7a31f116332fe5efa04ce0"
},
{
"ImportPath": "github.com/go-ldap/ldap",
"Comment": "v2.2.1",
"Rev": "07a7330929b9ee80495c88a4439657d89c7dbd87"
},
{
"ImportPath": "github.com/go-macaron/binding",
"Rev": "2502aaf4bce3a4e6451b4610847bfb8dffdb6266"
},
{
"ImportPath": "github.com/go-macaron/gzip",
"Rev": "4938e9be6b279d8426cb1c89a6bcf7af70b0c21d"
},
{
"ImportPath": "github.com/go-macaron/inject",
"Rev": "c5ab7bf3a307593cd44cb272d1a5beea473dd072"
},
{
"ImportPath": "github.com/go-macaron/session",
"Rev": "66031fcb37a0fff002a1f028eb0b3a815c78306b"
},
{
"ImportPath": "github.com/go-macaron/session/memcache",
"Rev": "66031fcb37a0fff002a1f028eb0b3a815c78306b"
},
{
"ImportPath": "github.com/go-macaron/session/mysql",
"Rev": "66031fcb37a0fff002a1f028eb0b3a815c78306b"
},
{
"ImportPath": "github.com/go-macaron/session/postgres",
"Rev": "66031fcb37a0fff002a1f028eb0b3a815c78306b"
},
{
"ImportPath": "github.com/go-macaron/session/redis",
"Rev": "66031fcb37a0fff002a1f028eb0b3a815c78306b"
},
{
"ImportPath": "github.com/go-sql-driver/mysql",
"Comment": "v1.2-171-g267b128",
"Rev": "267b128680c46286b9ca13475c3cca5de8f79bd7"
},
{
"ImportPath": "github.com/go-xorm/core",
"Comment": "v0.4.4-7-g9e608f7",
"Rev": "9e608f7330b9d16fe2818cfe731128b3f156cb9a"
},
{
"ImportPath": "github.com/go-xorm/xorm",
"Comment": "v0.4.4-44-gf561133",
"Rev": "f56113384f2c63dfe4cd8e768e349f1c35122b58"
},
{
"ImportPath": "github.com/gorilla/websocket",
"Rev": "c45a635370221f34fea2d5163fd156fcb4e38e8a"
},
{
"ImportPath": "github.com/gosimple/slug",
"Rev": "8d258463b4459f161f51d6a357edacd3eef9d663"
},
{
"ImportPath": "github.com/hashicorp/go-version",
"Rev": "7e3c02b30806fa5779d3bdfc152ce4c6f40e7b38"
},
{
"ImportPath": "github.com/jmespath/go-jmespath",
"Comment": "0.2.2",
"Rev": "3433f3ea46d9f8019119e7dd41274e112a2359a9"
},
{
"ImportPath": "github.com/jtolds/gls",
"Rev": "f1ac7f4f24f50328e6bc838ca4437d1612a0243c"
},
{
"ImportPath": "github.com/klauspost/compress/flate",
"Rev": "7b02889a2005228347aef0e76beeaee564d82f8c"
},
{
"ImportPath": "github.com/klauspost/compress/gzip",
"Rev": "7b02889a2005228347aef0e76beeaee564d82f8c"
},
{
"ImportPath": "github.com/klauspost/cpuid",
"Rev": "349c675778172472f5e8f3a3e0fe187e302e5a10"
},
{
"ImportPath": "github.com/klauspost/crc32",
"Rev": "6834731faf32e62a2dd809d99fb24d1e4ae5a92d"
},
{
"ImportPath": "github.com/kr/pretty",
"Comment": "go.weekly.2011-12-22-27-ge6ac2fc",
"Rev": "e6ac2fc51e89a3249e82157fa0bb7a18ef9dd5bb"
},
{
"ImportPath": "github.com/kr/text",
"Rev": "bb797dc4fb8320488f47bf11de07a733d7233e1f"
},
{
"ImportPath": "github.com/lib/pq",
"Comment": "go1.0-cutoff-13-g19eeca3",
"Rev": "19eeca3e30d2577b1761db471ec130810e67f532"
},
{
"ImportPath": "github.com/lib/pq/oid",
"Comment": "go1.0-cutoff-13-g19eeca3",
"Rev": "19eeca3e30d2577b1761db471ec130810e67f532"
},
{
"ImportPath": "github.com/mattn/go-colorable",
"Rev": "9cbef7c35391cca05f15f8181dc0b18bc9736dbb"
},
{
"ImportPath": "github.com/mattn/go-isatty",
"Rev": "56b76bdf51f7708750eac80fa38b952bb9f32639"
},
{
"ImportPath": "github.com/mattn/go-sqlite3",
"Rev": "e28cd440fabdd39b9520344bc26829f61db40ece"
},
{
"ImportPath": "github.com/rainycape/unidecode",
"Rev": "836ef0a715aedf08a12d595ed73ec8ed5b288cac"
},
{
"ImportPath": "github.com/smartystreets/goconvey/convey",
"Comment": "1.5.0-356-gfbc0a1c",
"Rev": "fbc0a1c888f9f96263f9a559d1769905245f1123"
},
{
"ImportPath": "github.com/smartystreets/goconvey/convey/assertions",
"Comment": "1.5.0-356-gfbc0a1c",
"Rev": "fbc0a1c888f9f96263f9a559d1769905245f1123"
},
{
"ImportPath": "github.com/smartystreets/goconvey/convey/assertions/oglematchers",
"Comment": "1.5.0-356-gfbc0a1c",
"Rev": "fbc0a1c888f9f96263f9a559d1769905245f1123"
},
{
"ImportPath": "github.com/smartystreets/goconvey/convey/gotest",
"Comment": "1.5.0-356-gfbc0a1c",
"Rev": "fbc0a1c888f9f96263f9a559d1769905245f1123"
},
{
"ImportPath": "github.com/smartystreets/goconvey/convey/reporting",
"Comment": "1.5.0-356-gfbc0a1c",
"Rev": "fbc0a1c888f9f96263f9a559d1769905245f1123"
},
{
"ImportPath": "github.com/streadway/amqp",
"Rev": "150b7f24d6ad507e6026c13d85ce1f1391ac7400"
},
{
"ImportPath": "golang.org/x/net/context",
"Rev": "972f0c5fbe4ae29e666c3f78c3ed42ae7a448b0a"
},
{
"ImportPath": "golang.org/x/oauth2",
"Rev": "c58fcf0ffc1c772aa2e1ee4894bc19f2649263b2"
},
{
"ImportPath": "golang.org/x/sys/unix",
"Rev": "7a56174f0086b32866ebd746a794417edbc678a1"
},
{
"ImportPath": "gopkg.in/asn1-ber.v1",
"Comment": "v1",
"Rev": "9eae18c3681ae3d3c677ac2b80a8fe57de45fc09"
},
{
"ImportPath": "gopkg.in/bufio.v1",
"Comment": "v1",
"Rev": "567b2bfa514e796916c4747494d6ff5132a1dfce"
},
{
"ImportPath": "gopkg.in/ini.v1",
"Comment": "v0-16-g1772191",
"Rev": "177219109c97e7920c933e21c9b25f874357b237"
},
{
"ImportPath": "gopkg.in/macaron.v1",
"Rev": "1c6dd87797ae9319b4658cbd48d1d0420b279fd5"
},
{
"ImportPath": "gopkg.in/redis.v2",
"Comment": "v2.3.2",
"Rev": "e6179049628164864e6e84e973cfb56335748dea"
}
]
}
Generated
-5
View File
@@ -1,5 +0,0 @@
This directory tree is generated automatically by godep.
Please do not edit.
See https://github.com/tools/godep for more information.
-2
View File
@@ -1,2 +0,0 @@
/pkg
/bin
-24
View File
@@ -1,24 +0,0 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
.idea
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.iml
-140
View File
@@ -1,140 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"fmt"
"runtime"
"strings"
"testing"
)
func TestColorLogS(t *testing.T) {
if runtime.GOOS != "windows" {
// Trace + path.
cls := ColorLogS("[TRAC] Trace level test with path( %s )", "/path/to/somethere")
clsR := fmt.Sprintf(
"[\033[%dmTRAC%s] Trace level test with path(\033[%dm%s%s)",
Blue, EndColor, Yellow, "/path/to/somethere", EndColor)
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
// Error + error.
cls = ColorLogS("[ERRO] Error level test with error[ %s ]", "test error")
clsR = fmt.Sprintf(
"[\033[%dmERRO%s] Error level test with error[\033[%dm%s%s]",
Red, EndColor, Red, "test error", EndColor)
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
// Warning + highlight.
cls = ColorLogS("[WARN] Warnning level test with highlight # %s #", "special offer!")
clsR = fmt.Sprintf(
"[\033[%dmWARN%s] Warnning level test with highlight \033[%dm%s%s",
Magenta, EndColor, Gray, "special offer!", EndColor)
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
// Success.
cls = ColorLogS("[SUCC] Success level test")
clsR = fmt.Sprintf(
"[\033[%dmSUCC%s] Success level test",
Green, EndColor)
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
// Default.
cls = ColorLogS("[INFO] Default level test")
clsR = fmt.Sprintf(
"[INFO] Default level test")
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
} else {
// Trace + path.
cls := ColorLogS("[TRAC] Trace level test with path( %s )", "/path/to/somethere")
clsR := fmt.Sprintf(
"[TRAC] Trace level test with path(%s)",
"/path/to/somethere")
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
// Error + error.
cls = ColorLogS("[ERRO] Error level test with error[ %s ]", "test error")
clsR = fmt.Sprintf(
"[ERRO] Error level test with error[%s]",
"test error")
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
// Warning + highlight.
cls = ColorLogS("[WARN] Warnning level test with highlight # %s #", "special offer!")
clsR = fmt.Sprintf(
"[WARN] Warnning level test with highlight %s",
"special offer!")
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
// Success.
cls = ColorLogS("[SUCC] Success level test")
clsR = fmt.Sprintf(
"[SUCC] Success level test")
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
// Default.
cls = ColorLogS("[INFO] Default level test")
clsR = fmt.Sprintf(
"[INFO] Default level test")
if cls != clsR {
t.Errorf("ColorLogS:\n Expect => %s\n Got => %s\n", clsR, cls)
}
}
}
func TestExecCmd(t *testing.T) {
stdout, stderr, err := ExecCmd("go", "help", "get")
if err != nil {
t.Errorf("ExecCmd:\n Expect => %v\n Got => %v\n", nil, err)
} else if len(stderr) != 0 {
t.Errorf("ExecCmd:\n Expect => %s\n Got => %s\n", "", stderr)
} else if !strings.HasPrefix(stdout, "usage: go get") {
t.Errorf("ExecCmd:\n Expect => %s\n Got => %s\n", "usage: go get", stdout)
}
}
func BenchmarkColorLogS(b *testing.B) {
log := fmt.Sprintf(
"[WARN] This is a tesing log that should be colored, path( %s ),"+
" highlight # %s #, error [ %s ].",
"path to somewhere", "highlighted content", "tesing error")
for i := 0; i < b.N; i++ {
ColorLogS(log)
}
}
func BenchmarkExecCmd(b *testing.B) {
for i := 0; i < b.N; i++ {
ExecCmd("go", "help", "get")
}
}
-56
View File
@@ -1,56 +0,0 @@
// Copyright 2014 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestHexStr2int(t *testing.T) {
Convey("Convert hex format string to decimal", t, func() {
hexDecs := map[string]int{
"1": 1,
"002": 2,
"011": 17,
"0a1": 161,
"35e": 862,
}
for hex, dec := range hexDecs {
val, err := HexStr2int(hex)
So(err, ShouldBeNil)
So(val, ShouldEqual, dec)
}
})
}
func TestInt2HexStr(t *testing.T) {
Convey("Convert decimal to hex format string", t, func() {
decHexs := map[int]string{
1: "1",
2: "2",
17: "11",
161: "a1",
862: "35e",
}
for dec, hex := range decHexs {
val := Int2HexStr(dec)
So(val, ShouldEqual, hex)
}
})
}
-58
View File
@@ -1,58 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"os"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestIsDir(t *testing.T) {
Convey("Check if given path is a directory", t, func() {
Convey("Pass a file name", func() {
So(IsDir("file.go"), ShouldEqual, false)
})
Convey("Pass a directory name", func() {
So(IsDir("testdata"), ShouldEqual, true)
})
Convey("Pass a invalid path", func() {
So(IsDir("foo"), ShouldEqual, false)
})
})
}
func TestCopyDir(t *testing.T) {
Convey("Items of two slices should be same", t, func() {
s1, err := StatDir("testdata", true)
So(err, ShouldEqual, nil)
err = CopyDir("testdata", "testdata2")
So(err, ShouldEqual, nil)
s2, err := StatDir("testdata2", true)
os.RemoveAll("testdata2")
So(err, ShouldEqual, nil)
So(CompareSliceStr(s1, s2), ShouldEqual, true)
})
}
func BenchmarkIsDir(b *testing.B) {
for i := 0; i < b.N; i++ {
IsDir("file.go")
}
}
-299
View File
@@ -1,299 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com_test
import (
"fmt"
"io/ioutil"
"net/http"
"github.com/Unknwon/com"
)
// ------------------------------
// cmd.go
// ------------------------------
func ExampleColorLogS() {
coloredLog := com.ColorLogS(fmt.Sprintf(
"[WARN] This is a tesing log that should be colored, path( %s ),"+
" highlight # %s #, error [ %s ].",
"path to somewhere", "highlighted content", "tesing error"))
fmt.Println(coloredLog)
}
func ExampleColorLog() {
com.ColorLog(fmt.Sprintf(
"[WARN] This is a tesing log that should be colored, path( %s ),"+
" highlight # %s #, error [ %s ].",
"path to somewhere", "highlighted content", "tesing error"))
}
func ExampleExecCmd() {
stdout, stderr, err := com.ExecCmd("go", "help", "get")
fmt.Println(stdout, stderr, err)
}
// ------------- END ------------
// ------------------------------
// html.go
// ------------------------------
func ExampleHtml2JS() {
htm := "<div id=\"button\" class=\"btn\">Click me</div>\n\r"
js := string(com.Html2JS([]byte(htm)))
fmt.Println(js)
// Output: <div id=\"button\" class=\"btn\">Click me</div>\n
}
// ------------- END ------------
// ------------------------------
// path.go
// ------------------------------
func ExampleGetGOPATHs() {
gps := com.GetGOPATHs()
fmt.Println(gps)
}
func ExampleGetSrcPath() {
srcPath, err := com.GetSrcPath("github.com/Unknwon/com")
if err != nil {
fmt.Println(err)
return
}
fmt.Println(srcPath)
}
func ExampleHomeDir() {
hd, err := com.HomeDir()
fmt.Println(hd, err)
}
// ------------- END ------------
// ------------------------------
// file.go
// ------------------------------
func ExampleIsFile() {
if com.IsFile("file.go") {
fmt.Println("file.go exists")
return
}
fmt.Println("file.go is not a file or does not exist")
}
func ExampleIsExist() {
if com.IsExist("file.go") {
fmt.Println("file.go exists")
return
}
fmt.Println("file.go does not exist")
}
// ------------- END ------------
// ------------------------------
// dir.go
// ------------------------------
func ExampleIsDir() {
if com.IsDir("files") {
fmt.Println("directory 'files' exists")
return
}
fmt.Println("'files' is not a directory or does not exist")
}
// ------------- END ------------
// ------------------------------
// string.go
// ------------------------------
func ExampleIsLetter() {
fmt.Println(com.IsLetter('1'))
fmt.Println(com.IsLetter('['))
fmt.Println(com.IsLetter('a'))
fmt.Println(com.IsLetter('Z'))
// Output:
// false
// false
// true
// true
}
func ExampleExpand() {
match := map[string]string{
"domain": "gowalker.org",
"subdomain": "github.com",
}
s := "http://{domain}/{subdomain}/{0}/{1}"
fmt.Println(com.Expand(s, match, "Unknwon", "gowalker"))
// Output: http://gowalker.org/github.com/Unknwon/gowalker
}
// ------------- END ------------
// ------------------------------
// http.go
// ------------------------------
func ExampleHttpGet() ([]byte, error) {
rc, err := com.HttpGet(&http.Client{}, "http://gowalker.org", nil)
if err != nil {
return nil, err
}
p, err := ioutil.ReadAll(rc)
rc.Close()
return p, err
}
func ExampleHttpGetBytes() ([]byte, error) {
p, err := com.HttpGetBytes(&http.Client{}, "http://gowalker.org", nil)
return p, err
}
func ExampleHttpGetJSON() interface{} {
j := com.HttpGetJSON(&http.Client{}, "http://gowalker.org", nil)
return j
}
type rawFile struct {
name string
rawURL string
data []byte
}
func (rf *rawFile) Name() string {
return rf.name
}
func (rf *rawFile) RawUrl() string {
return rf.rawURL
}
func (rf *rawFile) Data() []byte {
return rf.data
}
func (rf *rawFile) SetData(p []byte) {
rf.data = p
}
func ExampleFetchFiles() {
// Code that should be outside of your function body.
// type rawFile struct {
// name string
// rawURL string
// data []byte
// }
// func (rf *rawFile) Name() string {
// return rf.name
// }
// func (rf *rawFile) RawUrl() string {
// return rf.rawURL
// }
// func (rf *rawFile) Data() []byte {
// return rf.data
// }
// func (rf *rawFile) SetData(p []byte) {
// rf.data = p
// }
files := []com.RawFile{
&rawFile{rawURL: "http://example.com"},
&rawFile{rawURL: "http://example.com/foo"},
}
err := com.FetchFiles(&http.Client{}, files, nil)
fmt.Println(err, len(files[0].Data()), len(files[1].Data()))
}
func ExampleFetchFilesCurl() {
// Code that should be outside of your function body.
// type rawFile struct {
// name string
// rawURL string
// data []byte
// }
// func (rf *rawFile) Name() string {
// return rf.name
// }
// func (rf *rawFile) RawUrl() string {
// return rf.rawURL
// }
// func (rf *rawFile) Data() []byte {
// return rf.data
// }
// func (rf *rawFile) SetData(p []byte) {
// rf.data = p
// }
files := []com.RawFile{
&rawFile{rawURL: "http://example.com"},
&rawFile{rawURL: "http://example.com/foo"},
}
err := com.FetchFilesCurl(files)
fmt.Println(err, len(files[0].Data()), len(files[1].Data()))
}
// ------------- END ------------
// ------------------------------
// regex.go
// ------------------------------
func ExampleIsEmail() {
fmt.Println(com.IsEmail("test@example.com"))
fmt.Println(com.IsEmail("@example.com"))
// Output:
// true
// false
}
func ExampleIsUrl() {
fmt.Println(com.IsUrl("http://example.com"))
fmt.Println(com.IsUrl("http//example.com"))
// Output:
// true
// false
}
// ------------- END ------------
// ------------------------------
// slice.go
// ------------------------------
func ExampleAppendStr() {
s := []string{"a"}
s = com.AppendStr(s, "a")
s = com.AppendStr(s, "b")
fmt.Println(s)
// Output: [a b]
}
// ------------- END ------------
-61
View File
@@ -1,61 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestIsFile(t *testing.T) {
if !IsFile("file.go") {
t.Errorf("IsExist:\n Expect => %v\n Got => %v\n", true, false)
}
if IsFile("testdata") {
t.Errorf("IsExist:\n Expect => %v\n Got => %v\n", false, true)
}
if IsFile("files.go") {
t.Errorf("IsExist:\n Expect => %v\n Got => %v\n", false, true)
}
}
func TestIsExist(t *testing.T) {
Convey("Check if file or directory exists", t, func() {
Convey("Pass a file name that exists", func() {
So(IsExist("file.go"), ShouldEqual, true)
})
Convey("Pass a directory name that exists", func() {
So(IsExist("testdata"), ShouldEqual, true)
})
Convey("Pass a directory name that does not exist", func() {
So(IsExist(".hg"), ShouldEqual, false)
})
})
}
func BenchmarkIsFile(b *testing.B) {
for i := 0; i < b.N; i++ {
IsFile("file.go")
}
}
func BenchmarkIsExist(b *testing.B) {
for i := 0; i < b.N; i++ {
IsExist("file.go")
}
}
-111
View File
@@ -1,111 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"io/ioutil"
"net/http"
"strings"
"testing"
)
var examplePrefix = `<!doctype html>
<html>
<head>
<title>Example Domain</title>
`
func TestHttpGet(t *testing.T) {
// 200.
rc, err := HttpGet(&http.Client{}, "http://example.com", nil)
if err != nil {
t.Fatalf("HttpGet:\n Expect => %v\n Got => %s\n", nil, err)
}
p, err := ioutil.ReadAll(rc)
if err != nil {
t.Errorf("HttpGet:\n Expect => %v\n Got => %s\n", nil, err)
}
s := string(p)
if !strings.HasPrefix(s, examplePrefix) {
t.Errorf("HttpGet:\n Expect => %s\n Got => %s\n", examplePrefix, s)
}
}
func TestHttpGetBytes(t *testing.T) {
p, err := HttpGetBytes(&http.Client{}, "http://example.com", nil)
if err != nil {
t.Errorf("HttpGetBytes:\n Expect => %v\n Got => %s\n", nil, err)
}
s := string(p)
if !strings.HasPrefix(s, examplePrefix) {
t.Errorf("HttpGet:\n Expect => %s\n Got => %s\n", examplePrefix, s)
}
}
func TestHttpGetJSON(t *testing.T) {
}
type rawFile struct {
name string
rawURL string
data []byte
}
func (rf *rawFile) Name() string {
return rf.name
}
func (rf *rawFile) RawUrl() string {
return rf.rawURL
}
func (rf *rawFile) Data() []byte {
return rf.data
}
func (rf *rawFile) SetData(p []byte) {
rf.data = p
}
func TestFetchFiles(t *testing.T) {
files := []RawFile{
&rawFile{rawURL: "http://example.com"},
&rawFile{rawURL: "http://example.com"},
}
err := FetchFiles(&http.Client{}, files, nil)
if err != nil {
t.Errorf("FetchFiles:\n Expect => %v\n Got => %s\n", nil, err)
} else if len(files[0].Data()) != 1270 {
t.Errorf("FetchFiles:\n Expect => %d\n Got => %d\n", 1270, len(files[0].Data()))
} else if len(files[1].Data()) != 1270 {
t.Errorf("FetchFiles:\n Expect => %d\n Got => %d\n", 1270, len(files[1].Data()))
}
}
func TestFetchFilesCurl(t *testing.T) {
files := []RawFile{
&rawFile{rawURL: "http://example.com"},
&rawFile{rawURL: "http://example.com"},
}
err := FetchFilesCurl(files)
if err != nil {
t.Errorf("FetchFilesCurl:\n Expect => %v\n Got => %s\n", nil, err)
} else if len(files[0].Data()) != 1270 {
t.Errorf("FetchFilesCurl:\n Expect => %d\n Got => %d\n", 1270, len(files[0].Data()))
} else if len(files[1].Data()) != 1270 {
t.Errorf("FetchFilesCurl:\n Expect => %d\n Got => %d\n", 1270, len(files[1].Data()))
}
}
-67
View File
@@ -1,67 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"os"
"runtime"
"testing"
)
func TestGetGOPATHs(t *testing.T) {
var gpsR []string
if runtime.GOOS != "windows" {
gpsR = []string{"path/to/gopath1", "path/to/gopath2", "path/to/gopath3"}
os.Setenv("GOPATH", "path/to/gopath1:path/to/gopath2:path/to/gopath3")
} else {
gpsR = []string{"path/to/gopath1", "path/to/gopath2", "path/to/gopath3"}
os.Setenv("GOPATH", "path\\to\\gopath1;path\\to\\gopath2;path\\to\\gopath3")
}
gps := GetGOPATHs()
if !CompareSliceStr(gps, gpsR) {
t.Errorf("GetGOPATHs:\n Expect => %s\n Got => %s\n", gpsR, gps)
}
}
func TestGetSrcPath(t *testing.T) {
}
func TestHomeDir(t *testing.T) {
_, err := HomeDir()
if err != nil {
t.Errorf("HomeDir:\n Expect => %v\n Got => %s\n", nil, err)
}
}
func BenchmarkGetGOPATHs(b *testing.B) {
for i := 0; i < b.N; i++ {
GetGOPATHs()
}
}
func BenchmarkGetSrcPath(b *testing.B) {
for i := 0; i < b.N; i++ {
GetSrcPath("github.com/Unknwon/com")
}
}
func BenchmarkHomeDir(b *testing.B) {
for i := 0; i < b.N; i++ {
HomeDir()
}
}
-70
View File
@@ -1,70 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"testing"
)
func TestIsEmail(t *testing.T) {
emails := map[string]bool{
`test@example.com`: true,
`single-character@b.org`: true,
`uncommon_address@test.museum`: true,
`local@sld.UPPER`: true,
`@missing.org`: false,
`missing@.com`: false,
`missing@qq.`: false,
`wrong-ip@127.1.1.1.26`: false,
}
for e, r := range emails {
b := IsEmail(e)
if b != r {
t.Errorf("IsEmail:\n Expect => %v\n Got => %v\n", r, b)
}
}
}
func TestIsUrl(t *testing.T) {
urls := map[string]bool{
"http://www.example.com": true,
"http://example.com": true,
"http://example.com?user=test&password=test": true,
"http://example.com?user=test#login": true,
"ftp://example.com": true,
"https://example.com": true,
"htp://example.com": false,
"http//example.com": false,
"http://example": true,
}
for u, r := range urls {
b := IsUrl(u)
if b != r {
t.Errorf("IsUrl:\n Expect => %v\n Got => %v\n", r, b)
}
}
}
func BenchmarkIsEmail(b *testing.B) {
for i := 0; i < b.N; i++ {
IsEmail("test@example.com")
}
}
func BenchmarkIsUrl(b *testing.B) {
for i := 0; i < b.N; i++ {
IsEmail("http://example.com")
}
}
-99
View File
@@ -1,99 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"fmt"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestAppendStr(t *testing.T) {
Convey("Append a string to a slice with no duplicates", t, func() {
s := []string{"a"}
Convey("Append a string that does not exist in slice", func() {
s = AppendStr(s, "b")
So(len(s), ShouldEqual, 2)
})
Convey("Append a string that does exist in slice", func() {
s = AppendStr(s, "b")
So(len(s), ShouldEqual, 2)
})
})
}
func TestCompareSliceStr(t *testing.T) {
Convey("Compares two 'string' type slices with elements and order", t, func() {
Convey("Compare two slices that do have same elements and order", func() {
So(CompareSliceStr(
[]string{"1", "2", "3"}, []string{"1", "2", "3"}), ShouldBeTrue)
})
Convey("Compare two slices that do have same elements but does not have same order", func() {
So(!CompareSliceStr(
[]string{"2", "1", "3"}, []string{"1", "2", "3"}), ShouldBeTrue)
})
Convey("Compare two slices that have different number of elements", func() {
So(!CompareSliceStr(
[]string{"2", "1"}, []string{"1", "2", "3"}), ShouldBeTrue)
})
})
}
func TestCompareSliceStrU(t *testing.T) {
Convey("Compare two 'string' type slices with elements and ignore the order", t, func() {
Convey("Compare two slices that do have same elements and order", func() {
So(CompareSliceStrU(
[]string{"1", "2", "3"}, []string{"1", "2", "3"}), ShouldBeTrue)
})
Convey("Compare two slices that do have same elements but does not have same order", func() {
So(CompareSliceStrU(
[]string{"2", "1", "3"}, []string{"1", "2", "3"}), ShouldBeTrue)
})
Convey("Compare two slices that have different number of elements", func() {
So(!CompareSliceStrU(
[]string{"2", "1"}, []string{"1", "2", "3"}), ShouldBeTrue)
})
})
}
func BenchmarkAppendStr(b *testing.B) {
s := []string{"a"}
for i := 0; i < b.N; i++ {
s = AppendStr(s, fmt.Sprint(b.N%3))
}
}
func BenchmarkCompareSliceStr(b *testing.B) {
s1 := []string{"1", "2", "3"}
s2 := []string{"1", "2", "3"}
for i := 0; i < b.N; i++ {
CompareSliceStr(s1, s2)
}
}
func BenchmarkCompareSliceStrU(b *testing.B) {
s1 := []string{"1", "4", "2", "3"}
s2 := []string{"1", "2", "3", "4"}
for i := 0; i < b.N; i++ {
CompareSliceStrU(s1, s2)
}
}
-140
View File
@@ -1,140 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"errors"
"io"
r "math/rand"
"strconv"
"strings"
"time"
)
// AESEncrypt encrypts text and given key with AES.
func AESEncrypt(key, text []byte) ([]byte, error) {
block, err := aes.NewCipher(key)
if err != nil {
return nil, err
}
b := base64.StdEncoding.EncodeToString(text)
ciphertext := make([]byte, aes.BlockSize+len(b))
iv := ciphertext[:aes.BlockSize]
if _, err := io.ReadFull(rand.Reader, iv); err != nil {
return nil, err
}
cfb := cipher.NewCFBEncrypter(block, iv)
cfb.XORKeyStream(ciphertext[aes.BlockSize:], []byte(b))
return ciphertext, nil
}
// AESDecrypt decrypts text and given key with AES.
func AESDecrypt(key, text []byte) ([]byte, error) {
block, err := aes.NewCipher(key)
if err != nil {
return nil, err
}
if len(text) < aes.BlockSize {
return nil, errors.New("ciphertext too short")
}
iv := text[:aes.BlockSize]
text = text[aes.BlockSize:]
cfb := cipher.NewCFBDecrypter(block, iv)
cfb.XORKeyStream(text, text)
data, err := base64.StdEncoding.DecodeString(string(text))
if err != nil {
return nil, err
}
return data, nil
}
// IsLetter returns true if the 'l' is an English letter.
func IsLetter(l uint8) bool {
n := (l | 0x20) - 'a'
if n >= 0 && n < 26 {
return true
}
return false
}
// Expand replaces {k} in template with match[k] or subs[atoi(k)] if k is not in match.
func Expand(template string, match map[string]string, subs ...string) string {
var p []byte
var i int
for {
i = strings.Index(template, "{")
if i < 0 {
break
}
p = append(p, template[:i]...)
template = template[i+1:]
i = strings.Index(template, "}")
if s, ok := match[template[:i]]; ok {
p = append(p, s...)
} else {
j, _ := strconv.Atoi(template[:i])
if j >= len(subs) {
p = append(p, []byte("Missing")...)
} else {
p = append(p, subs[j]...)
}
}
template = template[i+1:]
}
p = append(p, template...)
return string(p)
}
// Reverse s string, support unicode
func Reverse(s string) string {
n := len(s)
runes := make([]rune, n)
for _, rune := range s {
n--
runes[n] = rune
}
return string(runes[n:])
}
// RandomCreateBytes generate random []byte by specify chars.
func RandomCreateBytes(n int, alphabets ...byte) []byte {
const alphanum = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
var bytes = make([]byte, n)
var randby bool
if num, err := rand.Read(bytes); num != n || err != nil {
r.Seed(time.Now().UnixNano())
randby = true
}
for i, b := range bytes {
if len(alphabets) == 0 {
if randby {
bytes[i] = alphanum[r.Intn(len(alphanum))]
} else {
bytes[i] = alphanum[b%byte(len(alphanum))]
}
} else {
if randby {
bytes[i] = alphabets[r.Intn(len(alphabets))]
} else {
bytes[i] = alphabets[b%byte(len(alphabets))]
}
}
}
return bytes
}
-82
View File
@@ -1,82 +0,0 @@
// Copyright 2013 com authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package com
import (
"testing"
)
func TestIsLetter(t *testing.T) {
if IsLetter('1') {
t.Errorf("IsLetter:\n Expect => %v\n Got => %v\n", false, true)
}
if IsLetter('[') {
t.Errorf("IsLetter:\n Expect => %v\n Got => %v\n", false, true)
}
if !IsLetter('a') {
t.Errorf("IsLetter:\n Expect => %v\n Got => %v\n", true, false)
}
if !IsLetter('Z') {
t.Errorf("IsLetter:\n Expect => %v\n Got => %v\n", true, false)
}
}
func TestExpand(t *testing.T) {
match := map[string]string{
"domain": "gowalker.org",
"subdomain": "github.com",
}
s := "http://{domain}/{subdomain}/{0}/{1}"
sR := "http://gowalker.org/github.com/Unknwon/gowalker"
if Expand(s, match, "Unknwon", "gowalker") != sR {
t.Errorf("Expand:\n Expect => %s\n Got => %s\n", sR, s)
}
}
func TestReverse(t *testing.T) {
if Reverse("abcdefg") != "gfedcba" {
t.Errorf("Reverse:\n Except => %s\n Got =>%s\n", "gfedcba", Reverse("abcdefg"))
}
if Reverse("上善若水厚德载物") != "物载德厚水若善上" {
t.Errorf("Reverse:\n Except => %s\n Got =>%s\n", "物载德厚水若善上", Reverse("上善若水厚德载物"))
}
}
func BenchmarkIsLetter(b *testing.B) {
for i := 0; i < b.N; i++ {
IsLetter('a')
}
}
func BenchmarkExpand(b *testing.B) {
match := map[string]string{
"domain": "gowalker.org",
"subdomain": "github.com",
}
s := "http://{domain}/{subdomain}/{0}/{1}"
for i := 0; i < b.N; i++ {
Expand(s, match, "Unknwon", "gowalker")
}
}
func BenchmarkReverse(b *testing.B) {
s := "abscef中文"
for i := 0; i < b.N; i++ {
Reverse(s)
}
}
@@ -1,233 +0,0 @@
package awsutil_test
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"testing"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/stretchr/testify/assert"
)
func ExampleCopy() {
type Foo struct {
A int
B []*string
}
// Create the initial value
str1 := "hello"
str2 := "bye bye"
f1 := &Foo{A: 1, B: []*string{&str1, &str2}}
// Do the copy
var f2 Foo
awsutil.Copy(&f2, f1)
// Print the result
fmt.Println(awsutil.Prettify(f2))
// Output:
// {
// A: 1,
// B: ["hello","bye bye"]
// }
}
func TestCopy(t *testing.T) {
type Foo struct {
A int
B []*string
C map[string]*int
}
// Create the initial value
str1 := "hello"
str2 := "bye bye"
int1 := 1
int2 := 2
f1 := &Foo{
A: 1,
B: []*string{&str1, &str2},
C: map[string]*int{
"A": &int1,
"B": &int2,
},
}
// Do the copy
var f2 Foo
awsutil.Copy(&f2, f1)
// Values are equal
assert.Equal(t, f2.A, f1.A)
assert.Equal(t, f2.B, f1.B)
assert.Equal(t, f2.C, f1.C)
// But pointers are not!
str3 := "nothello"
int3 := 57
f2.A = 100
f2.B[0] = &str3
f2.C["B"] = &int3
assert.NotEqual(t, f2.A, f1.A)
assert.NotEqual(t, f2.B, f1.B)
assert.NotEqual(t, f2.C, f1.C)
}
func TestCopyNestedWithUnexported(t *testing.T) {
type Bar struct {
a int
B int
}
type Foo struct {
A string
B Bar
}
f1 := &Foo{A: "string", B: Bar{a: 1, B: 2}}
var f2 Foo
awsutil.Copy(&f2, f1)
// Values match
assert.Equal(t, f2.A, f1.A)
assert.NotEqual(t, f2.B, f1.B)
assert.NotEqual(t, f2.B.a, f1.B.a)
assert.Equal(t, f2.B.B, f2.B.B)
}
func TestCopyIgnoreNilMembers(t *testing.T) {
type Foo struct {
A *string
B []string
C map[string]string
}
f := &Foo{}
assert.Nil(t, f.A)
assert.Nil(t, f.B)
assert.Nil(t, f.C)
var f2 Foo
awsutil.Copy(&f2, f)
assert.Nil(t, f2.A)
assert.Nil(t, f2.B)
assert.Nil(t, f2.C)
fcopy := awsutil.CopyOf(f)
f3 := fcopy.(*Foo)
assert.Nil(t, f3.A)
assert.Nil(t, f3.B)
assert.Nil(t, f3.C)
}
func TestCopyPrimitive(t *testing.T) {
str := "hello"
var s string
awsutil.Copy(&s, &str)
assert.Equal(t, "hello", s)
}
func TestCopyNil(t *testing.T) {
var s string
awsutil.Copy(&s, nil)
assert.Equal(t, "", s)
}
func TestCopyReader(t *testing.T) {
var buf io.Reader = bytes.NewReader([]byte("hello world"))
var r io.Reader
awsutil.Copy(&r, buf)
b, err := ioutil.ReadAll(r)
assert.NoError(t, err)
assert.Equal(t, []byte("hello world"), b)
// empty bytes because this is not a deep copy
b, err = ioutil.ReadAll(buf)
assert.NoError(t, err)
assert.Equal(t, []byte(""), b)
}
func TestCopyDifferentStructs(t *testing.T) {
type SrcFoo struct {
A int
B []*string
C map[string]*int
SrcUnique string
SameNameDiffType int
unexportedPtr *int
ExportedPtr *int
}
type DstFoo struct {
A int
B []*string
C map[string]*int
DstUnique int
SameNameDiffType string
unexportedPtr *int
ExportedPtr *int
}
// Create the initial value
str1 := "hello"
str2 := "bye bye"
int1 := 1
int2 := 2
f1 := &SrcFoo{
A: 1,
B: []*string{&str1, &str2},
C: map[string]*int{
"A": &int1,
"B": &int2,
},
SrcUnique: "unique",
SameNameDiffType: 1,
unexportedPtr: &int1,
ExportedPtr: &int2,
}
// Do the copy
var f2 DstFoo
awsutil.Copy(&f2, f1)
// Values are equal
assert.Equal(t, f2.A, f1.A)
assert.Equal(t, f2.B, f1.B)
assert.Equal(t, f2.C, f1.C)
assert.Equal(t, "unique", f1.SrcUnique)
assert.Equal(t, 1, f1.SameNameDiffType)
assert.Equal(t, 0, f2.DstUnique)
assert.Equal(t, "", f2.SameNameDiffType)
assert.Equal(t, int1, *f1.unexportedPtr)
assert.Nil(t, f2.unexportedPtr)
assert.Equal(t, int2, *f1.ExportedPtr)
assert.Equal(t, int2, *f2.ExportedPtr)
}
func ExampleCopyOf() {
type Foo struct {
A int
B []*string
}
// Create the initial value
str1 := "hello"
str2 := "bye bye"
f1 := &Foo{A: 1, B: []*string{&str1, &str2}}
// Do the copy
v := awsutil.CopyOf(f1)
var f2 *Foo = v.(*Foo)
// Print the result
fmt.Println(awsutil.Prettify(f2))
// Output:
// {
// A: 1,
// B: ["hello","bye bye"]
// }
}
@@ -1,29 +0,0 @@
package awsutil_test
import (
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/stretchr/testify/assert"
)
func TestDeepEqual(t *testing.T) {
cases := []struct {
a, b interface{}
equal bool
}{
{"a", "a", true},
{"a", "b", false},
{"a", aws.String(""), false},
{"a", nil, false},
{"a", aws.String("a"), true},
{(*bool)(nil), (*bool)(nil), true},
{(*bool)(nil), (*string)(nil), false},
{nil, nil, true},
}
for i, c := range cases {
assert.Equal(t, c.equal, awsutil.DeepEqual(c.a, c.b), "%d, a:%v b:%v, %t", i, c.a, c.b, c.equal)
}
}
@@ -1,142 +0,0 @@
package awsutil_test
import (
"testing"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/stretchr/testify/assert"
)
type Struct struct {
A []Struct
z []Struct
B *Struct
D *Struct
C string
E map[string]string
}
var data = Struct{
A: []Struct{{C: "value1"}, {C: "value2"}, {C: "value3"}},
z: []Struct{{C: "value1"}, {C: "value2"}, {C: "value3"}},
B: &Struct{B: &Struct{C: "terminal"}, D: &Struct{C: "terminal2"}},
C: "initial",
}
var data2 = Struct{A: []Struct{
{A: []Struct{{C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}}},
{A: []Struct{{C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}}},
}}
func TestValueAtPathSuccess(t *testing.T) {
var testCases = []struct {
expect []interface{}
data interface{}
path string
}{
{[]interface{}{"initial"}, data, "C"},
{[]interface{}{"value1"}, data, "A[0].C"},
{[]interface{}{"value2"}, data, "A[1].C"},
{[]interface{}{"value3"}, data, "A[2].C"},
{[]interface{}{"value3"}, data, "a[2].c"},
{[]interface{}{"value3"}, data, "A[-1].C"},
{[]interface{}{"value1", "value2", "value3"}, data, "A[].C"},
{[]interface{}{"terminal"}, data, "B . B . C"},
{[]interface{}{"initial"}, data, "A.D.X || C"},
{[]interface{}{"initial"}, data, "A[0].B || C"},
{[]interface{}{
Struct{A: []Struct{{C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}}},
Struct{A: []Struct{{C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}}},
}, data2, "A"},
}
for i, c := range testCases {
v, err := awsutil.ValuesAtPath(c.data, c.path)
assert.NoError(t, err, "case %d, expected no error, %s", i, c.path)
assert.Equal(t, c.expect, v, "case %d, %s", i, c.path)
}
}
func TestValueAtPathFailure(t *testing.T) {
var testCases = []struct {
expect []interface{}
errContains string
data interface{}
path string
}{
{nil, "", data, "C.x"},
{nil, "SyntaxError: Invalid token: tDot", data, ".x"},
{nil, "", data, "X.Y.Z"},
{nil, "", data, "A[100].C"},
{nil, "", data, "A[3].C"},
{nil, "", data, "B.B.C.Z"},
{nil, "", data, "z[-1].C"},
{nil, "", nil, "A.B.C"},
{[]interface{}{}, "", Struct{}, "A"},
{nil, "", data, "A[0].B.C"},
{nil, "", data, "D"},
}
for i, c := range testCases {
v, err := awsutil.ValuesAtPath(c.data, c.path)
if c.errContains != "" {
assert.Contains(t, err.Error(), c.errContains, "case %d, expected error, %s", i, c.path)
continue
} else {
assert.NoError(t, err, "case %d, expected no error, %s", i, c.path)
}
assert.Equal(t, c.expect, v, "case %d, %s", i, c.path)
}
}
func TestSetValueAtPathSuccess(t *testing.T) {
var s Struct
awsutil.SetValueAtPath(&s, "C", "test1")
awsutil.SetValueAtPath(&s, "B.B.C", "test2")
awsutil.SetValueAtPath(&s, "B.D.C", "test3")
assert.Equal(t, "test1", s.C)
assert.Equal(t, "test2", s.B.B.C)
assert.Equal(t, "test3", s.B.D.C)
awsutil.SetValueAtPath(&s, "B.*.C", "test0")
assert.Equal(t, "test0", s.B.B.C)
assert.Equal(t, "test0", s.B.D.C)
var s2 Struct
awsutil.SetValueAtPath(&s2, "b.b.c", "test0")
assert.Equal(t, "test0", s2.B.B.C)
awsutil.SetValueAtPath(&s2, "A", []Struct{{}})
assert.Equal(t, []Struct{{}}, s2.A)
str := "foo"
s3 := Struct{}
awsutil.SetValueAtPath(&s3, "b.b.c", str)
assert.Equal(t, "foo", s3.B.B.C)
s3 = Struct{B: &Struct{B: &Struct{C: str}}}
awsutil.SetValueAtPath(&s3, "b.b.c", nil)
assert.Equal(t, "", s3.B.B.C)
s3 = Struct{}
awsutil.SetValueAtPath(&s3, "b.b.c", nil)
assert.Equal(t, "", s3.B.B.C)
s3 = Struct{}
awsutil.SetValueAtPath(&s3, "b.b.c", &str)
assert.Equal(t, "foo", s3.B.B.C)
var s4 struct{ Name *string }
awsutil.SetValueAtPath(&s4, "Name", str)
assert.Equal(t, str, *s4.Name)
s4 = struct{ Name *string }{}
awsutil.SetValueAtPath(&s4, "Name", nil)
assert.Equal(t, (*string)(nil), s4.Name)
s4 = struct{ Name *string }{Name: &str}
awsutil.SetValueAtPath(&s4, "Name", nil)
assert.Equal(t, (*string)(nil), s4.Name)
s4 = struct{ Name *string }{}
awsutil.SetValueAtPath(&s4, "Name", &str)
assert.Equal(t, str, *s4.Name)
}
@@ -1,45 +0,0 @@
package client
import (
"math"
"math/rand"
"time"
"github.com/aws/aws-sdk-go/aws/request"
)
// DefaultRetryer implements basic retry logic using exponential backoff for
// most services. If you want to implement custom retry logic, implement the
// request.Retryer interface or create a structure type that composes this
// struct and override the specific methods. For example, to override only
// the MaxRetries method:
//
// type retryer struct {
// service.DefaultRetryer
// }
//
// // This implementation always has 100 max retries
// func (d retryer) MaxRetries() uint { return 100 }
type DefaultRetryer struct {
NumMaxRetries int
}
// MaxRetries returns the number of maximum returns the service will use to make
// an individual API request.
func (d DefaultRetryer) MaxRetries() int {
return d.NumMaxRetries
}
// RetryRules returns the delay duration before retrying this request again
func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration {
delay := int(math.Pow(2, float64(r.RetryCount))) * (rand.Intn(30) + 30)
return time.Duration(delay) * time.Millisecond
}
// ShouldRetry returns if the request should be retried.
func (d DefaultRetryer) ShouldRetry(r *request.Request) bool {
if r.HTTPResponse.StatusCode >= 500 {
return true
}
return r.IsErrorRetryable()
}
-270
View File
@@ -1,270 +0,0 @@
package aws
import (
"net/http"
"time"
"github.com/aws/aws-sdk-go/aws/credentials"
)
// UseServiceDefaultRetries instructs the config to use the service's own default
// number of retries. This will be the default action if Config.MaxRetries
// is nil also.
const UseServiceDefaultRetries = -1
// RequestRetryer is an alias for a type that implements the request.Retryer interface.
type RequestRetryer interface{}
// A Config provides service configuration for service clients. By default,
// all clients will use the {defaults.DefaultConfig} structure.
type Config struct {
// The credentials object to use when signing requests. Defaults to
// a chain of credential providers to search for credentials in environment
// variables, shared credential file, and EC2 Instance Roles.
Credentials *credentials.Credentials
// An optional endpoint URL (hostname only or fully qualified URI)
// that overrides the default generated endpoint for a client. Set this
// to `""` to use the default generated endpoint.
//
// @note You must still provide a `Region` value when specifying an
// endpoint for a client.
Endpoint *string
// The region to send requests to. This parameter is required and must
// be configured globally or on a per-client basis unless otherwise
// noted. A full list of regions is found in the "Regions and Endpoints"
// document.
//
// @see http://docs.aws.amazon.com/general/latest/gr/rande.html
// AWS Regions and Endpoints
Region *string
// Set this to `true` to disable SSL when sending requests. Defaults
// to `false`.
DisableSSL *bool
// The HTTP client to use when sending requests. Defaults to
// `http.DefaultClient`.
HTTPClient *http.Client
// An integer value representing the logging level. The default log level
// is zero (LogOff), which represents no logging. To enable logging set
// to a LogLevel Value.
LogLevel *LogLevelType
// The logger writer interface to write logging messages to. Defaults to
// standard out.
Logger Logger
// The maximum number of times that a request will be retried for failures.
// Defaults to -1, which defers the max retry setting to the service specific
// configuration.
MaxRetries *int
// Retryer guides how HTTP requests should be retried in case of recoverable failures.
//
// When nil or the value does not implement the request.Retryer interface,
// the request.DefaultRetryer will be used.
//
// When both Retryer and MaxRetries are non-nil, the former is used and
// the latter ignored.
//
// To set the Retryer field in a type-safe manner and with chaining, use
// the request.WithRetryer helper function:
//
// cfg := request.WithRetryer(aws.NewConfig(), myRetryer)
//
Retryer RequestRetryer
// Disables semantic parameter validation, which validates input for missing
// required fields and/or other semantic request input errors.
DisableParamValidation *bool
// Disables the computation of request and response checksums, e.g.,
// CRC32 checksums in Amazon DynamoDB.
DisableComputeChecksums *bool
// Set this to `true` to force the request to use path-style addressing,
// i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client will
// use virtual hosted bucket addressing when possible
// (`http://BUCKET.s3.amazonaws.com/KEY`).
//
// @note This configuration option is specific to the Amazon S3 service.
// @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
// Amazon S3: Virtual Hosting of Buckets
S3ForcePathStyle *bool
SleepDelay func(time.Duration)
}
// NewConfig returns a new Config pointer that can be chained with builder methods to
// set multiple configuration values inline without using pointers.
//
// svc := s3.New(aws.NewConfig().WithRegion("us-west-2").WithMaxRetries(10))
//
func NewConfig() *Config {
return &Config{}
}
// WithCredentials sets a config Credentials value returning a Config pointer
// for chaining.
func (c *Config) WithCredentials(creds *credentials.Credentials) *Config {
c.Credentials = creds
return c
}
// WithEndpoint sets a config Endpoint value returning a Config pointer for
// chaining.
func (c *Config) WithEndpoint(endpoint string) *Config {
c.Endpoint = &endpoint
return c
}
// WithRegion sets a config Region value returning a Config pointer for
// chaining.
func (c *Config) WithRegion(region string) *Config {
c.Region = &region
return c
}
// WithDisableSSL sets a config DisableSSL value returning a Config pointer
// for chaining.
func (c *Config) WithDisableSSL(disable bool) *Config {
c.DisableSSL = &disable
return c
}
// WithHTTPClient sets a config HTTPClient value returning a Config pointer
// for chaining.
func (c *Config) WithHTTPClient(client *http.Client) *Config {
c.HTTPClient = client
return c
}
// WithMaxRetries sets a config MaxRetries value returning a Config pointer
// for chaining.
func (c *Config) WithMaxRetries(max int) *Config {
c.MaxRetries = &max
return c
}
// WithDisableParamValidation sets a config DisableParamValidation value
// returning a Config pointer for chaining.
func (c *Config) WithDisableParamValidation(disable bool) *Config {
c.DisableParamValidation = &disable
return c
}
// WithDisableComputeChecksums sets a config DisableComputeChecksums value
// returning a Config pointer for chaining.
func (c *Config) WithDisableComputeChecksums(disable bool) *Config {
c.DisableComputeChecksums = &disable
return c
}
// WithLogLevel sets a config LogLevel value returning a Config pointer for
// chaining.
func (c *Config) WithLogLevel(level LogLevelType) *Config {
c.LogLevel = &level
return c
}
// WithLogger sets a config Logger value returning a Config pointer for
// chaining.
func (c *Config) WithLogger(logger Logger) *Config {
c.Logger = logger
return c
}
// WithS3ForcePathStyle sets a config S3ForcePathStyle value returning a Config
// pointer for chaining.
func (c *Config) WithS3ForcePathStyle(force bool) *Config {
c.S3ForcePathStyle = &force
return c
}
// WithSleepDelay overrides the function used to sleep while waiting for the
// next retry. Defaults to time.Sleep.
func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config {
c.SleepDelay = fn
return c
}
// MergeIn merges the passed in configs into the existing config object.
func (c *Config) MergeIn(cfgs ...*Config) {
for _, other := range cfgs {
mergeInConfig(c, other)
}
}
func mergeInConfig(dst *Config, other *Config) {
if other == nil {
return
}
if other.Credentials != nil {
dst.Credentials = other.Credentials
}
if other.Endpoint != nil {
dst.Endpoint = other.Endpoint
}
if other.Region != nil {
dst.Region = other.Region
}
if other.DisableSSL != nil {
dst.DisableSSL = other.DisableSSL
}
if other.HTTPClient != nil {
dst.HTTPClient = other.HTTPClient
}
if other.LogLevel != nil {
dst.LogLevel = other.LogLevel
}
if other.Logger != nil {
dst.Logger = other.Logger
}
if other.MaxRetries != nil {
dst.MaxRetries = other.MaxRetries
}
if other.Retryer != nil {
dst.Retryer = other.Retryer
}
if other.DisableParamValidation != nil {
dst.DisableParamValidation = other.DisableParamValidation
}
if other.DisableComputeChecksums != nil {
dst.DisableComputeChecksums = other.DisableComputeChecksums
}
if other.S3ForcePathStyle != nil {
dst.S3ForcePathStyle = other.S3ForcePathStyle
}
if other.SleepDelay != nil {
dst.SleepDelay = other.SleepDelay
}
}
// Copy will return a shallow copy of the Config object. If any additional
// configurations are provided they will be merged into the new config returned.
func (c *Config) Copy(cfgs ...*Config) *Config {
dst := &Config{}
dst.MergeIn(c)
for _, cfg := range cfgs {
dst.MergeIn(cfg)
}
return dst
}
-86
View File
@@ -1,86 +0,0 @@
package aws
import (
"net/http"
"reflect"
"testing"
"github.com/aws/aws-sdk-go/aws/credentials"
)
var testCredentials = credentials.NewStaticCredentials("AKID", "SECRET", "SESSION")
var copyTestConfig = Config{
Credentials: testCredentials,
Endpoint: String("CopyTestEndpoint"),
Region: String("COPY_TEST_AWS_REGION"),
DisableSSL: Bool(true),
HTTPClient: http.DefaultClient,
LogLevel: LogLevel(LogDebug),
Logger: NewDefaultLogger(),
MaxRetries: Int(3),
DisableParamValidation: Bool(true),
DisableComputeChecksums: Bool(true),
S3ForcePathStyle: Bool(true),
}
func TestCopy(t *testing.T) {
want := copyTestConfig
got := copyTestConfig.Copy()
if !reflect.DeepEqual(*got, want) {
t.Errorf("Copy() = %+v", got)
t.Errorf(" want %+v", want)
}
got.Region = String("other")
if got.Region == want.Region {
t.Errorf("Expect setting copy values not not reflect in source")
}
}
func TestCopyReturnsNewInstance(t *testing.T) {
want := copyTestConfig
got := copyTestConfig.Copy()
if got == &want {
t.Errorf("Copy() = %p; want different instance as source %p", got, &want)
}
}
var mergeTestZeroValueConfig = Config{}
var mergeTestConfig = Config{
Credentials: testCredentials,
Endpoint: String("MergeTestEndpoint"),
Region: String("MERGE_TEST_AWS_REGION"),
DisableSSL: Bool(true),
HTTPClient: http.DefaultClient,
LogLevel: LogLevel(LogDebug),
Logger: NewDefaultLogger(),
MaxRetries: Int(10),
DisableParamValidation: Bool(true),
DisableComputeChecksums: Bool(true),
S3ForcePathStyle: Bool(true),
}
var mergeTests = []struct {
cfg *Config
in *Config
want *Config
}{
{&Config{}, nil, &Config{}},
{&Config{}, &mergeTestZeroValueConfig, &Config{}},
{&Config{}, &mergeTestConfig, &mergeTestConfig},
}
func TestMerge(t *testing.T) {
for i, tt := range mergeTests {
got := tt.cfg.Copy()
got.MergeIn(tt.in)
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("Config %d %+v", i, tt.cfg)
t.Errorf(" Merge(%+v)", tt.in)
t.Errorf(" got %+v", got)
t.Errorf(" want %+v", tt.want)
}
}
}
@@ -1,437 +0,0 @@
package aws
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
var testCasesStringSlice = [][]string{
{"a", "b", "c", "d", "e"},
{"a", "b", "", "", "e"},
}
func TestStringSlice(t *testing.T) {
for idx, in := range testCasesStringSlice {
if in == nil {
continue
}
out := StringSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := StringValueSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesStringValueSlice = [][]*string{
{String("a"), String("b"), nil, String("c")},
}
func TestStringValueSlice(t *testing.T) {
for idx, in := range testCasesStringValueSlice {
if in == nil {
continue
}
out := StringValueSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
if in[i] == nil {
assert.Empty(t, out[i], "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx)
}
}
out2 := StringSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
for i := range out2 {
if in[i] == nil {
assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx)
}
}
}
}
var testCasesStringMap = []map[string]string{
{"a": "1", "b": "2", "c": "3"},
}
func TestStringMap(t *testing.T) {
for idx, in := range testCasesStringMap {
if in == nil {
continue
}
out := StringMap(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := StringValueMap(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesBoolSlice = [][]bool{
{true, true, false, false},
}
func TestBoolSlice(t *testing.T) {
for idx, in := range testCasesBoolSlice {
if in == nil {
continue
}
out := BoolSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := BoolValueSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesBoolValueSlice = [][]*bool{}
func TestBoolValueSlice(t *testing.T) {
for idx, in := range testCasesBoolValueSlice {
if in == nil {
continue
}
out := BoolValueSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
if in[i] == nil {
assert.Empty(t, out[i], "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx)
}
}
out2 := BoolSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
for i := range out2 {
if in[i] == nil {
assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx)
}
}
}
}
var testCasesBoolMap = []map[string]bool{
{"a": true, "b": false, "c": true},
}
func TestBoolMap(t *testing.T) {
for idx, in := range testCasesBoolMap {
if in == nil {
continue
}
out := BoolMap(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := BoolValueMap(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesIntSlice = [][]int{
{1, 2, 3, 4},
}
func TestIntSlice(t *testing.T) {
for idx, in := range testCasesIntSlice {
if in == nil {
continue
}
out := IntSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := IntValueSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesIntValueSlice = [][]*int{}
func TestIntValueSlice(t *testing.T) {
for idx, in := range testCasesIntValueSlice {
if in == nil {
continue
}
out := IntValueSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
if in[i] == nil {
assert.Empty(t, out[i], "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx)
}
}
out2 := IntSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
for i := range out2 {
if in[i] == nil {
assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx)
}
}
}
}
var testCasesIntMap = []map[string]int{
{"a": 3, "b": 2, "c": 1},
}
func TestIntMap(t *testing.T) {
for idx, in := range testCasesIntMap {
if in == nil {
continue
}
out := IntMap(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := IntValueMap(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesInt64Slice = [][]int64{
{1, 2, 3, 4},
}
func TestInt64Slice(t *testing.T) {
for idx, in := range testCasesInt64Slice {
if in == nil {
continue
}
out := Int64Slice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := Int64ValueSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesInt64ValueSlice = [][]*int64{}
func TestInt64ValueSlice(t *testing.T) {
for idx, in := range testCasesInt64ValueSlice {
if in == nil {
continue
}
out := Int64ValueSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
if in[i] == nil {
assert.Empty(t, out[i], "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx)
}
}
out2 := Int64Slice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
for i := range out2 {
if in[i] == nil {
assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx)
}
}
}
}
var testCasesInt64Map = []map[string]int64{
{"a": 3, "b": 2, "c": 1},
}
func TestInt64Map(t *testing.T) {
for idx, in := range testCasesInt64Map {
if in == nil {
continue
}
out := Int64Map(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := Int64ValueMap(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesFloat64Slice = [][]float64{
{1, 2, 3, 4},
}
func TestFloat64Slice(t *testing.T) {
for idx, in := range testCasesFloat64Slice {
if in == nil {
continue
}
out := Float64Slice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := Float64ValueSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesFloat64ValueSlice = [][]*float64{}
func TestFloat64ValueSlice(t *testing.T) {
for idx, in := range testCasesFloat64ValueSlice {
if in == nil {
continue
}
out := Float64ValueSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
if in[i] == nil {
assert.Empty(t, out[i], "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx)
}
}
out2 := Float64Slice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
for i := range out2 {
if in[i] == nil {
assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx)
}
}
}
}
var testCasesFloat64Map = []map[string]float64{
{"a": 3, "b": 2, "c": 1},
}
func TestFloat64Map(t *testing.T) {
for idx, in := range testCasesFloat64Map {
if in == nil {
continue
}
out := Float64Map(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := Float64ValueMap(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesTimeSlice = [][]time.Time{
{time.Now(), time.Now().AddDate(100, 0, 0)},
}
func TestTimeSlice(t *testing.T) {
for idx, in := range testCasesTimeSlice {
if in == nil {
continue
}
out := TimeSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := TimeValueSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
var testCasesTimeValueSlice = [][]*time.Time{}
func TestTimeValueSlice(t *testing.T) {
for idx, in := range testCasesTimeValueSlice {
if in == nil {
continue
}
out := TimeValueSlice(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
if in[i] == nil {
assert.Empty(t, out[i], "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx)
}
}
out2 := TimeSlice(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
for i := range out2 {
if in[i] == nil {
assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx)
} else {
assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx)
}
}
}
}
var testCasesTimeMap = []map[string]time.Time{
{"a": time.Now().AddDate(-100, 0, 0), "b": time.Now()},
}
func TestTimeMap(t *testing.T) {
for idx, in := range testCasesTimeMap {
if in == nil {
continue
}
out := TimeMap(in)
assert.Len(t, out, len(in), "Unexpected len at idx %d", idx)
for i := range out {
assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx)
}
out2 := TimeValueMap(out)
assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx)
assert.Equal(t, in, out2, "Unexpected value at idx %d", idx)
}
}
@@ -1,139 +0,0 @@
package corehandlers
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"regexp"
"runtime"
"strconv"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
)
// Interface for matching types which also have a Len method.
type lener interface {
Len() int
}
// BuildContentLengthHandler builds the content length of a request based on the body,
// or will use the HTTPRequest.Header's "Content-Length" if defined. If unable
// to determine request body length and no "Content-Length" was specified it will panic.
var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLengthHandler", Fn: func(r *request.Request) {
if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" {
length, _ := strconv.ParseInt(slength, 10, 64)
r.HTTPRequest.ContentLength = length
return
}
var length int64
switch body := r.Body.(type) {
case nil:
length = 0
case lener:
length = int64(body.Len())
case io.Seeker:
r.BodyStart, _ = body.Seek(0, 1)
end, _ := body.Seek(0, 2)
body.Seek(r.BodyStart, 0) // make sure to seek back to original location
length = end - r.BodyStart
default:
panic("Cannot get length of body, must provide `ContentLength`")
}
r.HTTPRequest.ContentLength = length
r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length))
}}
// SDKVersionUserAgentHandler is a request handler for adding the SDK Version to the user agent.
var SDKVersionUserAgentHandler = request.NamedHandler{
Name: "core.SDKVersionUserAgentHandler",
Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion,
runtime.Version(), runtime.GOOS, runtime.GOARCH),
}
var reStatusCode = regexp.MustCompile(`^(\d{3})`)
// SendHandler is a request handler to send service request using HTTP client.
var SendHandler = request.NamedHandler{Name: "core.SendHandler", Fn: func(r *request.Request) {
var err error
r.HTTPResponse, err = r.Config.HTTPClient.Do(r.HTTPRequest)
if err != nil {
// Capture the case where url.Error is returned for error processing
// response. e.g. 301 without location header comes back as string
// error and r.HTTPResponse is nil. Other url redirect errors will
// comeback in a similar method.
if e, ok := err.(*url.Error); ok && e.Err != nil {
if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil {
code, _ := strconv.ParseInt(s[1], 10, 64)
r.HTTPResponse = &http.Response{
StatusCode: int(code),
Status: http.StatusText(int(code)),
Body: ioutil.NopCloser(bytes.NewReader([]byte{})),
}
return
}
}
if r.HTTPResponse == nil {
// Add a dummy request response object to ensure the HTTPResponse
// value is consistent.
r.HTTPResponse = &http.Response{
StatusCode: int(0),
Status: http.StatusText(int(0)),
Body: ioutil.NopCloser(bytes.NewReader([]byte{})),
}
}
// Catch all other request errors.
r.Error = awserr.New("RequestError", "send request failed", err)
r.Retryable = aws.Bool(true) // network errors are retryable
}
}}
// ValidateResponseHandler is a request handler to validate service response.
var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) {
if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 {
// this may be replaced by an UnmarshalError handler
r.Error = awserr.New("UnknownError", "unknown error", nil)
}
}}
// AfterRetryHandler performs final checks to determine if the request should
// be retried and how long to delay.
var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn: func(r *request.Request) {
// If one of the other handlers already set the retry state
// we don't want to override it based on the service's state
if r.Retryable == nil {
r.Retryable = aws.Bool(r.ShouldRetry(r))
}
if r.WillRetry() {
r.RetryDelay = r.RetryRules(r)
r.Config.SleepDelay(r.RetryDelay)
// when the expired token exception occurs the credentials
// need to be expired locally so that the next request to
// get credentials will trigger a credentials refresh.
if r.IsErrorExpired() {
r.Config.Credentials.Expire()
}
r.RetryCount++
r.Error = nil
}
}}
// ValidateEndpointHandler is a request handler to validate a request had the
// appropriate Region and Endpoint set. Will set r.Error if the endpoint or
// region is not valid.
var ValidateEndpointHandler = request.NamedHandler{Name: "core.ValidateEndpointHandler", Fn: func(r *request.Request) {
if r.ClientInfo.SigningRegion == "" && aws.StringValue(r.Config.Region) == "" {
r.Error = aws.ErrMissingRegion
} else if r.ClientInfo.Endpoint == "" {
r.Error = aws.ErrMissingEndpoint
}
}}
@@ -1,113 +0,0 @@
package corehandlers_test
import (
"fmt"
"net/http"
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting"
)
func TestValidateEndpointHandler(t *testing.T) {
os.Clearenv()
svc := awstesting.NewClient(aws.NewConfig().WithRegion("us-west-2"))
svc.Handlers.Clear()
svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil)
err := req.Build()
assert.NoError(t, err)
}
func TestValidateEndpointHandlerErrorRegion(t *testing.T) {
os.Clearenv()
svc := awstesting.NewClient()
svc.Handlers.Clear()
svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil)
err := req.Build()
assert.Error(t, err)
assert.Equal(t, aws.ErrMissingRegion, err)
}
type mockCredsProvider struct {
expired bool
retrieveCalled bool
}
func (m *mockCredsProvider) Retrieve() (credentials.Value, error) {
m.retrieveCalled = true
return credentials.Value{}, nil
}
func (m *mockCredsProvider) IsExpired() bool {
return m.expired
}
func TestAfterRetryRefreshCreds(t *testing.T) {
os.Clearenv()
credProvider := &mockCredsProvider{}
svc := awstesting.NewClient(&aws.Config{
Credentials: credentials.NewCredentials(credProvider),
MaxRetries: aws.Int(1),
})
svc.Handlers.Clear()
svc.Handlers.ValidateResponse.PushBack(func(r *request.Request) {
r.Error = awserr.New("UnknownError", "", nil)
r.HTTPResponse = &http.Response{StatusCode: 400}
})
svc.Handlers.UnmarshalError.PushBack(func(r *request.Request) {
r.Error = awserr.New("ExpiredTokenException", "", nil)
})
svc.Handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler)
assert.True(t, svc.Config.Credentials.IsExpired(), "Expect to start out expired")
assert.False(t, credProvider.retrieveCalled)
req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil)
req.Send()
assert.True(t, svc.Config.Credentials.IsExpired())
assert.False(t, credProvider.retrieveCalled)
_, err := svc.Config.Credentials.Get()
assert.NoError(t, err)
assert.True(t, credProvider.retrieveCalled)
}
type testSendHandlerTransport struct{}
func (t *testSendHandlerTransport) RoundTrip(r *http.Request) (*http.Response, error) {
return nil, fmt.Errorf("mock error")
}
func TestSendHandlerError(t *testing.T) {
svc := awstesting.NewClient(&aws.Config{
HTTPClient: &http.Client{
Transport: &testSendHandlerTransport{},
},
})
svc.Handlers.Clear()
svc.Handlers.Send.PushBackNamed(corehandlers.SendHandler)
r := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil)
r.Send()
assert.Error(t, r.Error)
assert.NotNil(t, r.HTTPResponse)
}
@@ -1,144 +0,0 @@
package corehandlers
import (
"fmt"
"reflect"
"strconv"
"strings"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
)
// ValidateParametersHandler is a request handler to validate the input parameters.
// Validating parameters only has meaning if done prior to the request being sent.
var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) {
if r.ParamsFilled() {
v := validator{errors: []string{}}
v.validateAny(reflect.ValueOf(r.Params), "")
if count := len(v.errors); count > 0 {
format := "%d validation errors:\n- %s"
msg := fmt.Sprintf(format, count, strings.Join(v.errors, "\n- "))
r.Error = awserr.New("InvalidParameter", msg, nil)
}
}
}}
// A validator validates values. Collects validations errors which occurs.
type validator struct {
errors []string
}
// validateAny will validate any struct, slice or map type. All validations
// are also performed recursively for nested types.
func (v *validator) validateAny(value reflect.Value, path string) {
value = reflect.Indirect(value)
if !value.IsValid() {
return
}
switch value.Kind() {
case reflect.Struct:
v.validateStruct(value, path)
case reflect.Slice:
for i := 0; i < value.Len(); i++ {
v.validateAny(value.Index(i), path+fmt.Sprintf("[%d]", i))
}
case reflect.Map:
for _, n := range value.MapKeys() {
v.validateAny(value.MapIndex(n), path+fmt.Sprintf("[%q]", n.String()))
}
}
}
// validateStruct will validate the struct value's fields. If the structure has
// nested types those types will be validated also.
func (v *validator) validateStruct(value reflect.Value, path string) {
prefix := "."
if path == "" {
prefix = ""
}
for i := 0; i < value.Type().NumField(); i++ {
f := value.Type().Field(i)
if strings.ToLower(f.Name[0:1]) == f.Name[0:1] {
continue
}
fvalue := value.FieldByName(f.Name)
err := validateField(f, fvalue, validateFieldRequired, validateFieldMin)
if err != nil {
v.errors = append(v.errors, fmt.Sprintf("%s: %s", err.Error(), path+prefix+f.Name))
continue
}
v.validateAny(fvalue, path+prefix+f.Name)
}
}
type validatorFunc func(f reflect.StructField, fvalue reflect.Value) error
func validateField(f reflect.StructField, fvalue reflect.Value, funcs ...validatorFunc) error {
for _, fn := range funcs {
if err := fn(f, fvalue); err != nil {
return err
}
}
return nil
}
// Validates that a field has a valid value provided for required fields.
func validateFieldRequired(f reflect.StructField, fvalue reflect.Value) error {
if f.Tag.Get("required") == "" {
return nil
}
switch fvalue.Kind() {
case reflect.Ptr, reflect.Slice, reflect.Map:
if fvalue.IsNil() {
return fmt.Errorf("missing required parameter")
}
default:
if !fvalue.IsValid() {
return fmt.Errorf("missing required parameter")
}
}
return nil
}
// Validates that if a value is provided for a field, that value must be at
// least a minimum length.
func validateFieldMin(f reflect.StructField, fvalue reflect.Value) error {
minStr := f.Tag.Get("min")
if minStr == "" {
return nil
}
min, _ := strconv.ParseInt(minStr, 10, 64)
kind := fvalue.Kind()
if kind == reflect.Ptr {
if fvalue.IsNil() {
return nil
}
fvalue = fvalue.Elem()
}
switch fvalue.Kind() {
case reflect.String:
if int64(fvalue.Len()) < min {
return fmt.Errorf("field too short, minimum length %d", min)
}
case reflect.Slice, reflect.Map:
if fvalue.IsNil() {
return nil
}
if int64(fvalue.Len()) < min {
return fmt.Errorf("field too short, minimum length %d", min)
}
// TODO min can also apply to number minimum value.
}
return nil
}
@@ -1,134 +0,0 @@
package corehandlers_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/stretchr/testify/require"
)
var testSvc = func() *client.Client {
s := &client.Client{
Config: aws.Config{},
ClientInfo: metadata.ClientInfo{
ServiceName: "mock-service",
APIVersion: "2015-01-01",
},
}
return s
}()
type StructShape struct {
RequiredList []*ConditionalStructShape `required:"true"`
RequiredMap map[string]*ConditionalStructShape `required:"true"`
RequiredBool *bool `required:"true"`
OptionalStruct *ConditionalStructShape
hiddenParameter *string
metadataStructureShape
}
type metadataStructureShape struct {
SDKShapeTraits bool
}
type ConditionalStructShape struct {
Name *string `required:"true"`
SDKShapeTraits bool
}
func TestNoErrors(t *testing.T) {
input := &StructShape{
RequiredList: []*ConditionalStructShape{},
RequiredMap: map[string]*ConditionalStructShape{
"key1": {Name: aws.String("Name")},
"key2": {Name: aws.String("Name")},
},
RequiredBool: aws.Bool(true),
OptionalStruct: &ConditionalStructShape{Name: aws.String("Name")},
}
req := testSvc.NewRequest(&request.Operation{}, input, nil)
corehandlers.ValidateParametersHandler.Fn(req)
require.NoError(t, req.Error)
}
func TestMissingRequiredParameters(t *testing.T) {
input := &StructShape{}
req := testSvc.NewRequest(&request.Operation{}, input, nil)
corehandlers.ValidateParametersHandler.Fn(req)
require.Error(t, req.Error)
assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code())
assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList\n- missing required parameter: RequiredMap\n- missing required parameter: RequiredBool", req.Error.(awserr.Error).Message())
}
func TestNestedMissingRequiredParameters(t *testing.T) {
input := &StructShape{
RequiredList: []*ConditionalStructShape{{}},
RequiredMap: map[string]*ConditionalStructShape{
"key1": {Name: aws.String("Name")},
"key2": {},
},
RequiredBool: aws.Bool(true),
OptionalStruct: &ConditionalStructShape{},
}
req := testSvc.NewRequest(&request.Operation{}, input, nil)
corehandlers.ValidateParametersHandler.Fn(req)
require.Error(t, req.Error)
assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code())
assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList[0].Name\n- missing required parameter: RequiredMap[\"key2\"].Name\n- missing required parameter: OptionalStruct.Name", req.Error.(awserr.Error).Message())
}
type testInput struct {
StringField string `min:"5"`
PtrStrField *string `min:"2"`
ListField []string `min:"3"`
MapField map[string]string `min:"4"`
}
var testsFieldMin = []struct {
err awserr.Error
in testInput
}{
{
err: awserr.New("InvalidParameter", "1 validation errors:\n- field too short, minimum length 5: StringField", nil),
in: testInput{StringField: "abcd"},
},
{
err: awserr.New("InvalidParameter", "2 validation errors:\n- field too short, minimum length 5: StringField\n- field too short, minimum length 3: ListField", nil),
in: testInput{StringField: "abcd", ListField: []string{"a", "b"}},
},
{
err: awserr.New("InvalidParameter", "3 validation errors:\n- field too short, minimum length 5: StringField\n- field too short, minimum length 3: ListField\n- field too short, minimum length 4: MapField", nil),
in: testInput{StringField: "abcd", ListField: []string{"a", "b"}, MapField: map[string]string{"a": "a", "b": "b"}},
},
{
err: awserr.New("InvalidParameter", "1 validation errors:\n- field too short, minimum length 2: PtrStrField", nil),
in: testInput{StringField: "abcde", PtrStrField: aws.String("v")},
},
{
err: nil,
in: testInput{StringField: "abcde", PtrStrField: aws.String("value"),
ListField: []string{"a", "b", "c"}, MapField: map[string]string{"a": "a", "b": "b", "c": "c", "d": "d"}},
},
}
func TestValidateFieldMinParameter(t *testing.T) {
for i, c := range testsFieldMin {
req := testSvc.NewRequest(&request.Operation{}, &c.in, nil)
corehandlers.ValidateParametersHandler.Fn(req)
require.Equal(t, c.err, req.Error, "%d case failed", i)
}
}
@@ -1,73 +0,0 @@
package credentials
import (
"testing"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/stretchr/testify/assert"
)
func TestChainProviderGet(t *testing.T) {
p := &ChainProvider{
Providers: []Provider{
&stubProvider{err: awserr.New("FirstError", "first provider error", nil)},
&stubProvider{err: awserr.New("SecondError", "second provider error", nil)},
&stubProvider{
creds: Value{
AccessKeyID: "AKID",
SecretAccessKey: "SECRET",
SessionToken: "",
},
},
},
}
creds, err := p.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "AKID", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "SECRET", creds.SecretAccessKey, "Expect secret access key to match")
assert.Empty(t, creds.SessionToken, "Expect session token to be empty")
}
func TestChainProviderIsExpired(t *testing.T) {
stubProvider := &stubProvider{expired: true}
p := &ChainProvider{
Providers: []Provider{
stubProvider,
},
}
assert.True(t, p.IsExpired(), "Expect expired to be true before any Retrieve")
_, err := p.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.False(t, p.IsExpired(), "Expect not expired after retrieve")
stubProvider.expired = true
assert.True(t, p.IsExpired(), "Expect return of expired provider")
_, err = p.Retrieve()
assert.False(t, p.IsExpired(), "Expect not expired after retrieve")
}
func TestChainProviderWithNoProvider(t *testing.T) {
p := &ChainProvider{
Providers: []Provider{},
}
assert.True(t, p.IsExpired(), "Expect expired with no providers")
_, err := p.Retrieve()
assert.Equal(t, ErrNoValidProvidersFoundInChain, err, "Expect no providers error returned")
}
func TestChainProviderWithNoValidProvider(t *testing.T) {
p := &ChainProvider{
Providers: []Provider{
&stubProvider{err: awserr.New("FirstError", "first provider error", nil)},
&stubProvider{err: awserr.New("SecondError", "second provider error", nil)},
},
}
assert.True(t, p.IsExpired(), "Expect expired with no providers")
_, err := p.Retrieve()
assert.Equal(t, ErrNoValidProvidersFoundInChain, err, "Expect no providers error returned")
}
@@ -1,62 +0,0 @@
package credentials
import (
"testing"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/stretchr/testify/assert"
)
type stubProvider struct {
creds Value
expired bool
err error
}
func (s *stubProvider) Retrieve() (Value, error) {
s.expired = false
return s.creds, s.err
}
func (s *stubProvider) IsExpired() bool {
return s.expired
}
func TestCredentialsGet(t *testing.T) {
c := NewCredentials(&stubProvider{
creds: Value{
AccessKeyID: "AKID",
SecretAccessKey: "SECRET",
SessionToken: "",
},
expired: true,
})
creds, err := c.Get()
assert.Nil(t, err, "Expected no error")
assert.Equal(t, "AKID", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "SECRET", creds.SecretAccessKey, "Expect secret access key to match")
assert.Empty(t, creds.SessionToken, "Expect session token to be empty")
}
func TestCredentialsGetWithError(t *testing.T) {
c := NewCredentials(&stubProvider{err: awserr.New("provider error", "", nil), expired: true})
_, err := c.Get()
assert.Equal(t, "provider error", err.(awserr.Error).Code(), "Expected provider error")
}
func TestCredentialsExpire(t *testing.T) {
stub := &stubProvider{}
c := NewCredentials(stub)
stub.expired = false
assert.True(t, c.IsExpired(), "Expected to start out expired")
c.Expire()
assert.True(t, c.IsExpired(), "Expected to be expired")
c.forceRefresh = false
assert.False(t, c.IsExpired(), "Expected not to be expired")
stub.expired = true
assert.True(t, c.IsExpired(), "Expected to be expired")
}
@@ -1,159 +0,0 @@
package ec2rolecreds_test
import (
"fmt"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
)
const credsRespTmpl = `{
"Code": "Success",
"Type": "AWS-HMAC",
"AccessKeyId" : "accessKey",
"SecretAccessKey" : "secret",
"Token" : "token",
"Expiration" : "%s",
"LastUpdated" : "2009-11-23T0:00:00Z"
}`
const credsFailRespTmpl = `{
"Code": "ErrorCode",
"Message": "ErrorMsg",
"LastUpdated": "2009-11-23T0:00:00Z"
}`
func initTestServer(expireOn string, failAssume bool) *httptest.Server {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/latest/meta-data/iam/security-credentials" {
fmt.Fprintln(w, "RoleName")
} else if r.URL.Path == "/latest/meta-data/iam/security-credentials/RoleName" {
if failAssume {
fmt.Fprintf(w, credsFailRespTmpl)
} else {
fmt.Fprintf(w, credsRespTmpl, expireOn)
}
} else {
http.Error(w, "bad request", http.StatusBadRequest)
}
}))
return server
}
func TestEC2RoleProvider(t *testing.T) {
server := initTestServer("2014-12-16T01:51:37Z", false)
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
}
creds, err := p.Retrieve()
assert.Nil(t, err, "Expect no error, %v", err)
assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match")
assert.Equal(t, "token", creds.SessionToken, "Expect session token to match")
}
func TestEC2RoleProviderFailAssume(t *testing.T) {
server := initTestServer("2014-12-16T01:51:37Z", true)
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
}
creds, err := p.Retrieve()
assert.Error(t, err, "Expect error")
e := err.(awserr.Error)
assert.Equal(t, "ErrorCode", e.Code())
assert.Equal(t, "ErrorMsg", e.Message())
assert.Nil(t, e.OrigErr())
assert.Equal(t, "", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "", creds.SecretAccessKey, "Expect secret access key to match")
assert.Equal(t, "", creds.SessionToken, "Expect session token to match")
}
func TestEC2RoleProviderIsExpired(t *testing.T) {
server := initTestServer("2014-12-16T01:51:37Z", false)
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
}
p.CurrentTime = func() time.Time {
return time.Date(2014, 12, 15, 21, 26, 0, 0, time.UTC)
}
assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.")
_, err := p.Retrieve()
assert.Nil(t, err, "Expect no error, %v", err)
assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.")
p.CurrentTime = func() time.Time {
return time.Date(3014, 12, 15, 21, 26, 0, 0, time.UTC)
}
assert.True(t, p.IsExpired(), "Expect creds to be expired.")
}
func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) {
server := initTestServer("2014-12-16T01:51:37Z", false)
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
ExpiryWindow: time.Hour * 1,
}
p.CurrentTime = func() time.Time {
return time.Date(2014, 12, 15, 0, 51, 37, 0, time.UTC)
}
assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.")
_, err := p.Retrieve()
assert.Nil(t, err, "Expect no error, %v", err)
assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.")
p.CurrentTime = func() time.Time {
return time.Date(2014, 12, 16, 0, 55, 37, 0, time.UTC)
}
assert.True(t, p.IsExpired(), "Expect creds to be expired.")
}
func BenchmarkEC3RoleProvider(b *testing.B) {
server := initTestServer("2014-12-16T01:51:37Z", false)
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
}
_, err := p.Retrieve()
if err != nil {
b.Fatal(err)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
if _, err := p.Retrieve(); err != nil {
b.Fatal(err)
}
}
}
@@ -1,70 +0,0 @@
package credentials
import (
"github.com/stretchr/testify/assert"
"os"
"testing"
)
func TestEnvProviderRetrieve(t *testing.T) {
os.Clearenv()
os.Setenv("AWS_ACCESS_KEY_ID", "access")
os.Setenv("AWS_SECRET_ACCESS_KEY", "secret")
os.Setenv("AWS_SESSION_TOKEN", "token")
e := EnvProvider{}
creds, err := e.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "access", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match")
assert.Equal(t, "token", creds.SessionToken, "Expect session token to match")
}
func TestEnvProviderIsExpired(t *testing.T) {
os.Clearenv()
os.Setenv("AWS_ACCESS_KEY_ID", "access")
os.Setenv("AWS_SECRET_ACCESS_KEY", "secret")
os.Setenv("AWS_SESSION_TOKEN", "token")
e := EnvProvider{}
assert.True(t, e.IsExpired(), "Expect creds to be expired before retrieve.")
_, err := e.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.False(t, e.IsExpired(), "Expect creds to not be expired after retrieve.")
}
func TestEnvProviderNoAccessKeyID(t *testing.T) {
os.Clearenv()
os.Setenv("AWS_SECRET_ACCESS_KEY", "secret")
e := EnvProvider{}
creds, err := e.Retrieve()
assert.Equal(t, ErrAccessKeyIDNotFound, err, "ErrAccessKeyIDNotFound expected, but was %#v error: %#v", creds, err)
}
func TestEnvProviderNoSecretAccessKey(t *testing.T) {
os.Clearenv()
os.Setenv("AWS_ACCESS_KEY_ID", "access")
e := EnvProvider{}
creds, err := e.Retrieve()
assert.Equal(t, ErrSecretAccessKeyNotFound, err, "ErrSecretAccessKeyNotFound expected, but was %#v error: %#v", creds, err)
}
func TestEnvProviderAlternateNames(t *testing.T) {
os.Clearenv()
os.Setenv("AWS_ACCESS_KEY", "access")
os.Setenv("AWS_SECRET_KEY", "secret")
e := EnvProvider{}
creds, err := e.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "access", creds.AccessKeyID, "Expected access key ID")
assert.Equal(t, "secret", creds.SecretAccessKey, "Expected secret access key")
assert.Empty(t, creds.SessionToken, "Expected no token")
}
@@ -1,100 +0,0 @@
package credentials
import (
"github.com/stretchr/testify/assert"
"os"
"testing"
)
func TestSharedCredentialsProvider(t *testing.T) {
os.Clearenv()
p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""}
creds, err := p.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match")
assert.Equal(t, "token", creds.SessionToken, "Expect session token to match")
}
func TestSharedCredentialsProviderIsExpired(t *testing.T) {
os.Clearenv()
p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""}
assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve")
_, err := p.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve")
}
func TestSharedCredentialsProviderWithAWS_SHARED_CREDENTIALS_FILE(t *testing.T) {
os.Clearenv()
os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "example.ini")
p := SharedCredentialsProvider{}
creds, err := p.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match")
assert.Equal(t, "token", creds.SessionToken, "Expect session token to match")
}
func TestSharedCredentialsProviderWithAWS_PROFILE(t *testing.T) {
os.Clearenv()
os.Setenv("AWS_PROFILE", "no_token")
p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""}
creds, err := p.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match")
assert.Empty(t, creds.SessionToken, "Expect no token")
}
func TestSharedCredentialsProviderWithoutTokenFromProfile(t *testing.T) {
os.Clearenv()
p := SharedCredentialsProvider{Filename: "example.ini", Profile: "no_token"}
creds, err := p.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match")
assert.Empty(t, creds.SessionToken, "Expect no token")
}
func TestSharedCredentialsProviderColonInCredFile(t *testing.T) {
os.Clearenv()
p := SharedCredentialsProvider{Filename: "example.ini", Profile: "with_colon"}
creds, err := p.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match")
assert.Empty(t, creds.SessionToken, "Expect no token")
}
func BenchmarkSharedCredentialsProvider(b *testing.B) {
os.Clearenv()
p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""}
_, err := p.Retrieve()
if err != nil {
b.Fatal(err)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, err := p.Retrieve()
if err != nil {
b.Fatal(err)
}
}
}
@@ -1,34 +0,0 @@
package credentials
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestStaticProviderGet(t *testing.T) {
s := StaticProvider{
Value: Value{
AccessKeyID: "AKID",
SecretAccessKey: "SECRET",
SessionToken: "",
},
}
creds, err := s.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "AKID", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "SECRET", creds.SecretAccessKey, "Expect secret access key to match")
assert.Empty(t, creds.SessionToken, "Expect no session token")
}
func TestStaticProviderIsExpired(t *testing.T) {
s := StaticProvider{
Value: Value{
AccessKeyID: "AKID",
SecretAccessKey: "SECRET",
SessionToken: "",
},
}
assert.False(t, s.IsExpired(), "Expect static credentials to never expire")
}
@@ -1,130 +0,0 @@
// Package stscreds are credential Providers to retrieve STS AWS credentials.
//
// STS provides multiple ways to retrieve credentials which can be used when making
// future AWS service API operation calls.
package stscreds
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/service/sts"
)
// AssumeRoler represents the minimal subset of the STS client API used by this provider.
type AssumeRoler interface {
AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error)
}
// DefaultDuration is the default amount of time in minutes that the credentials
// will be valid for.
var DefaultDuration = time.Duration(15) * time.Minute
// AssumeRoleProvider retrieves temporary credentials from the STS service, and
// keeps track of their expiration time. This provider must be used explicitly,
// as it is not included in the credentials chain.
type AssumeRoleProvider struct {
credentials.Expiry
// STS client to make assume role request with.
Client AssumeRoler
// Role to be assumed.
RoleARN string
// Session name, if you wish to reuse the credentials elsewhere.
RoleSessionName string
// Expiry duration of the STS credentials. Defaults to 15 minutes if not set.
Duration time.Duration
// Optional ExternalID to pass along, defaults to nil if not set.
ExternalID *string
// ExpiryWindow will allow the credentials to trigger refreshing prior to
// the credentials actually expiring. This is beneficial so race conditions
// with expiring credentials do not cause request to fail unexpectedly
// due to ExpiredTokenException exceptions.
//
// So a ExpiryWindow of 10s would cause calls to IsExpired() to return true
// 10 seconds before the credentials are actually expired.
//
// If ExpiryWindow is 0 or less it will be ignored.
ExpiryWindow time.Duration
}
// NewCredentials returns a pointer to a new Credentials object wrapping the
// AssumeRoleProvider. The credentials will expire every 15 minutes and the
// role will be named after a nanosecond timestamp of this operation.
//
// Takes a Config provider to create the STS client. The ConfigProvider is
// satisfied by the session.Session type.
func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
p := &AssumeRoleProvider{
Client: sts.New(c),
RoleARN: roleARN,
Duration: DefaultDuration,
}
for _, option := range options {
option(p)
}
return credentials.NewCredentials(p)
}
// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the
// AssumeRoleProvider. The credentials will expire every 15 minutes and the
// role will be named after a nanosecond timestamp of this operation.
//
// Takes an AssumeRoler which can be satisfiede by the STS client.
func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
p := &AssumeRoleProvider{
Client: svc,
RoleARN: roleARN,
Duration: DefaultDuration,
}
for _, option := range options {
option(p)
}
return credentials.NewCredentials(p)
}
// Retrieve generates a new set of temporary credentials using STS.
func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
// Apply defaults where parameters are not set.
if p.RoleSessionName == "" {
// Try to work out a role name that will hopefully end up unique.
p.RoleSessionName = fmt.Sprintf("%d", time.Now().UTC().UnixNano())
}
if p.Duration == 0 {
// Expire as often as AWS permits.
p.Duration = DefaultDuration
}
roleOutput, err := p.Client.AssumeRole(&sts.AssumeRoleInput{
DurationSeconds: aws.Int64(int64(p.Duration / time.Second)),
RoleArn: aws.String(p.RoleARN),
RoleSessionName: aws.String(p.RoleSessionName),
ExternalId: p.ExternalID,
})
if err != nil {
return credentials.Value{}, err
}
// We will proactively generate new credentials before they expire.
p.SetExpiration(*roleOutput.Credentials.Expiration, p.ExpiryWindow)
return credentials.Value{
AccessKeyID: *roleOutput.Credentials.AccessKeyId,
SecretAccessKey: *roleOutput.Credentials.SecretAccessKey,
SessionToken: *roleOutput.Credentials.SessionToken,
}, nil
}
@@ -1,56 +0,0 @@
package stscreds
import (
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/stretchr/testify/assert"
)
type stubSTS struct {
}
func (s *stubSTS) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) {
expiry := time.Now().Add(60 * time.Minute)
return &sts.AssumeRoleOutput{
Credentials: &sts.Credentials{
// Just reflect the role arn to the provider.
AccessKeyId: input.RoleArn,
SecretAccessKey: aws.String("assumedSecretAccessKey"),
SessionToken: aws.String("assumedSessionToken"),
Expiration: &expiry,
},
}, nil
}
func TestAssumeRoleProvider(t *testing.T) {
stub := &stubSTS{}
p := &AssumeRoleProvider{
Client: stub,
RoleARN: "roleARN",
}
creds, err := p.Retrieve()
assert.Nil(t, err, "Expect no error")
assert.Equal(t, "roleARN", creds.AccessKeyID, "Expect access key ID to be reflected role ARN")
assert.Equal(t, "assumedSecretAccessKey", creds.SecretAccessKey, "Expect secret access key to match")
assert.Equal(t, "assumedSessionToken", creds.SessionToken, "Expect session token to match")
}
func BenchmarkAssumeRoleProvider(b *testing.B) {
stub := &stubSTS{}
p := &AssumeRoleProvider{
Client: stub,
RoleARN: "roleARN",
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
if _, err := p.Retrieve(); err != nil {
b.Fatal(err)
}
}
}
@@ -1,76 +0,0 @@
// Package defaults is a collection of helpers to retrieve the SDK's default
// configuration and handlers.
package defaults
import (
"net/http"
"os"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/endpoints"
)
// A Defaults provides a collection of default values for SDK clients.
type Defaults struct {
Config *aws.Config
Handlers request.Handlers
}
// Get returns the SDK's default values with Config and handlers pre-configured.
func Get() Defaults {
cfg := Config()
handlers := Handlers()
cfg.Credentials = CredChain(cfg, handlers)
return Defaults{
Config: cfg,
Handlers: handlers,
}
}
// Config returns the default configuration.
func Config() *aws.Config {
return aws.NewConfig().
WithCredentials(credentials.AnonymousCredentials).
WithRegion(os.Getenv("AWS_REGION")).
WithHTTPClient(http.DefaultClient).
WithMaxRetries(aws.UseServiceDefaultRetries).
WithLogger(aws.NewDefaultLogger()).
WithLogLevel(aws.LogOff).
WithSleepDelay(time.Sleep)
}
// Handlers returns the default request handlers.
func Handlers() request.Handlers {
var handlers request.Handlers
handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler)
handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
handlers.Send.PushBackNamed(corehandlers.SendHandler)
handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler)
handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler)
return handlers
}
// CredChain returns the default credential chain.
func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials {
endpoint, signingRegion := endpoints.EndpointForRegion(ec2metadata.ServiceName, *cfg.Region, true)
return credentials.NewChainCredentials(
[]credentials.Provider{
&credentials.EnvProvider{},
&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
&ec2rolecreds.EC2RoleProvider{
Client: ec2metadata.NewClient(*cfg, handlers, endpoint, signingRegion),
ExpiryWindow: 5 * time.Minute,
},
})
}
-43
View File
@@ -1,43 +0,0 @@
package ec2metadata
import (
"path"
"github.com/aws/aws-sdk-go/aws/request"
)
// GetMetadata uses the path provided to request
func (c *EC2Metadata) GetMetadata(p string) (string, error) {
op := &request.Operation{
Name: "GetMetadata",
HTTPMethod: "GET",
HTTPPath: path.Join("/", "meta-data", p),
}
output := &metadataOutput{}
req := c.NewRequest(op, nil, output)
return output.Content, req.Send()
}
// Region returns the region the instance is running in.
func (c *EC2Metadata) Region() (string, error) {
resp, err := c.GetMetadata("placement/availability-zone")
if err != nil {
return "", err
}
// returns region without the suffix. Eg: us-west-2a becomes us-west-2
return resp[:len(resp)-1], nil
}
// Available returns if the application has access to the EC2 Metadata service.
// Can be used to determine if application is running within an EC2 Instance and
// the metadata service is available.
func (c *EC2Metadata) Available() bool {
if _, err := c.GetMetadata("instance-id"); err != nil {
return false
}
return true
}
@@ -1,101 +0,0 @@
package ec2metadata_test
import (
"bytes"
"io/ioutil"
"net/http"
"net/http/httptest"
"path"
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
)
func initTestServer(path string, resp string) *httptest.Server {
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.RequestURI != path {
http.Error(w, "not found", http.StatusNotFound)
return
}
w.Write([]byte(resp))
}))
}
func TestEndpoint(t *testing.T) {
c := ec2metadata.New(session.New())
op := &request.Operation{
Name: "GetMetadata",
HTTPMethod: "GET",
HTTPPath: path.Join("/", "meta-data", "testpath"),
}
req := c.NewRequest(op, nil, nil)
assert.Equal(t, "http://169.254.169.254/latest", req.ClientInfo.Endpoint)
assert.Equal(t, "http://169.254.169.254/latest/meta-data/testpath", req.HTTPRequest.URL.String())
}
func TestGetMetadata(t *testing.T) {
server := initTestServer(
"/latest/meta-data/some/path",
"success", // real response includes suffix
)
defer server.Close()
c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")})
resp, err := c.GetMetadata("some/path")
assert.NoError(t, err)
assert.Equal(t, "success", resp)
}
func TestGetRegion(t *testing.T) {
server := initTestServer(
"/latest/meta-data/placement/availability-zone",
"us-west-2a", // real response includes suffix
)
defer server.Close()
c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")})
region, err := c.Region()
assert.NoError(t, err)
assert.Equal(t, "us-west-2", region)
}
func TestMetadataAvailable(t *testing.T) {
server := initTestServer(
"/latest/meta-data/instance-id",
"instance-id",
)
defer server.Close()
c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")})
available := c.Available()
assert.True(t, available)
}
func TestMetadataNotAvailable(t *testing.T) {
c := ec2metadata.New(session.New())
c.Handlers.Send.Clear()
c.Handlers.Send.PushBack(func(r *request.Request) {
r.HTTPResponse = &http.Response{
StatusCode: int(0),
Status: http.StatusText(int(0)),
Body: ioutil.NopCloser(bytes.NewReader([]byte{})),
}
r.Error = awserr.New("RequestError", "send request failed", nil)
r.Retryable = aws.Bool(true) // network errors are retryable
})
available := c.Available()
assert.False(t, available)
}
-140
View File
@@ -1,140 +0,0 @@
package request
import (
"fmt"
"strings"
)
// A Handlers provides a collection of request handlers for various
// stages of handling requests.
type Handlers struct {
Validate HandlerList
Build HandlerList
Sign HandlerList
Send HandlerList
ValidateResponse HandlerList
Unmarshal HandlerList
UnmarshalMeta HandlerList
UnmarshalError HandlerList
Retry HandlerList
AfterRetry HandlerList
}
// Copy returns of this handler's lists.
func (h *Handlers) Copy() Handlers {
return Handlers{
Validate: h.Validate.copy(),
Build: h.Build.copy(),
Sign: h.Sign.copy(),
Send: h.Send.copy(),
ValidateResponse: h.ValidateResponse.copy(),
Unmarshal: h.Unmarshal.copy(),
UnmarshalError: h.UnmarshalError.copy(),
UnmarshalMeta: h.UnmarshalMeta.copy(),
Retry: h.Retry.copy(),
AfterRetry: h.AfterRetry.copy(),
}
}
// Clear removes callback functions for all handlers
func (h *Handlers) Clear() {
h.Validate.Clear()
h.Build.Clear()
h.Send.Clear()
h.Sign.Clear()
h.Unmarshal.Clear()
h.UnmarshalMeta.Clear()
h.UnmarshalError.Clear()
h.ValidateResponse.Clear()
h.Retry.Clear()
h.AfterRetry.Clear()
}
// A HandlerList manages zero or more handlers in a list.
type HandlerList struct {
list []NamedHandler
}
// A NamedHandler is a struct that contains a name and function callback.
type NamedHandler struct {
Name string
Fn func(*Request)
}
// copy creates a copy of the handler list.
func (l *HandlerList) copy() HandlerList {
var n HandlerList
n.list = append([]NamedHandler{}, l.list...)
return n
}
// Clear clears the handler list.
func (l *HandlerList) Clear() {
l.list = []NamedHandler{}
}
// Len returns the number of handlers in the list.
func (l *HandlerList) Len() int {
return len(l.list)
}
// PushBack pushes handler f to the back of the handler list.
func (l *HandlerList) PushBack(f func(*Request)) {
l.list = append(l.list, NamedHandler{"__anonymous", f})
}
// PushFront pushes handler f to the front of the handler list.
func (l *HandlerList) PushFront(f func(*Request)) {
l.list = append([]NamedHandler{{"__anonymous", f}}, l.list...)
}
// PushBackNamed pushes named handler f to the back of the handler list.
func (l *HandlerList) PushBackNamed(n NamedHandler) {
l.list = append(l.list, n)
}
// PushFrontNamed pushes named handler f to the front of the handler list.
func (l *HandlerList) PushFrontNamed(n NamedHandler) {
l.list = append([]NamedHandler{n}, l.list...)
}
// Remove removes a NamedHandler n
func (l *HandlerList) Remove(n NamedHandler) {
newlist := []NamedHandler{}
for _, m := range l.list {
if m.Name != n.Name {
newlist = append(newlist, m)
}
}
l.list = newlist
}
// Run executes all handlers in the list with a given request object.
func (l *HandlerList) Run(r *Request) {
for _, f := range l.list {
f.Fn(r)
}
}
// MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request
// header. If the extra parameters are provided they will be added as metadata to the
// name/version pair resulting in the following format.
// "name/version (extra0; extra1; ...)"
// The user agent part will be concatenated with this current request's user agent string.
func MakeAddToUserAgentHandler(name, version string, extra ...string) func(*Request) {
ua := fmt.Sprintf("%s/%s", name, version)
if len(extra) > 0 {
ua += fmt.Sprintf(" (%s)", strings.Join(extra, "; "))
}
return func(r *Request) {
AddToUserAgent(r, ua)
}
}
// MakeAddToUserAgentFreeFormHandler adds the input to the User-Agent request header.
// The input string will be concatenated with the current request's user agent string.
func MakeAddToUserAgentFreeFormHandler(s string) func(*Request) {
return func(r *Request) {
AddToUserAgent(r, s)
}
}
@@ -1,47 +0,0 @@
package request_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
func TestHandlerList(t *testing.T) {
s := ""
r := &request.Request{}
l := request.HandlerList{}
l.PushBack(func(r *request.Request) {
s += "a"
r.Data = s
})
l.Run(r)
assert.Equal(t, "a", s)
assert.Equal(t, "a", r.Data)
}
func TestMultipleHandlers(t *testing.T) {
r := &request.Request{}
l := request.HandlerList{}
l.PushBack(func(r *request.Request) { r.Data = nil })
l.PushFront(func(r *request.Request) { r.Data = aws.Bool(true) })
l.Run(r)
if r.Data != nil {
t.Error("Expected handler to execute")
}
}
func TestNamedHandlers(t *testing.T) {
l := request.HandlerList{}
named := request.NamedHandler{Name: "Name", Fn: func(r *request.Request) {}}
named2 := request.NamedHandler{Name: "NotName", Fn: func(r *request.Request) {}}
l.PushBackNamed(named)
l.PushBackNamed(named)
l.PushBackNamed(named2)
l.PushBack(func(r *request.Request) {})
assert.Equal(t, 4, l.Len())
l.Remove(named)
assert.Equal(t, 2, l.Len())
}
-279
View File
@@ -1,279 +0,0 @@
package request
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"reflect"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client/metadata"
)
// A Request is the service request to be made.
type Request struct {
Config aws.Config
ClientInfo metadata.ClientInfo
Handlers Handlers
Retryer
Time time.Time
ExpireTime time.Duration
Operation *Operation
HTTPRequest *http.Request
HTTPResponse *http.Response
Body io.ReadSeeker
BodyStart int64 // offset from beginning of Body that the request body starts
Params interface{}
Error error
Data interface{}
RequestID string
RetryCount int
Retryable *bool
RetryDelay time.Duration
built bool
}
// An Operation is the service API operation to be made.
type Operation struct {
Name string
HTTPMethod string
HTTPPath string
*Paginator
}
// Paginator keeps track of pagination configuration for an API operation.
type Paginator struct {
InputTokens []string
OutputTokens []string
LimitToken string
TruncationToken string
}
// New returns a new Request pointer for the service API
// operation and parameters.
//
// Params is any value of input parameters to be the request payload.
// Data is pointer value to an object which the request's response
// payload will be deserialized to.
func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers,
retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request {
method := operation.HTTPMethod
if method == "" {
method = "POST"
}
p := operation.HTTPPath
if p == "" {
p = "/"
}
httpReq, _ := http.NewRequest(method, "", nil)
httpReq.URL, _ = url.Parse(clientInfo.Endpoint + p)
r := &Request{
Config: cfg,
ClientInfo: clientInfo,
Handlers: handlers.Copy(),
Retryer: retryer,
Time: time.Now(),
ExpireTime: 0,
Operation: operation,
HTTPRequest: httpReq,
Body: nil,
Params: params,
Error: nil,
Data: data,
}
r.SetBufferBody([]byte{})
return r
}
// WillRetry returns if the request's can be retried.
func (r *Request) WillRetry() bool {
return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries()
}
// ParamsFilled returns if the request's parameters have been populated
// and the parameters are valid. False is returned if no parameters are
// provided or invalid.
func (r *Request) ParamsFilled() bool {
return r.Params != nil && reflect.ValueOf(r.Params).Elem().IsValid()
}
// DataFilled returns true if the request's data for response deserialization
// target has been set and is a valid. False is returned if data is not
// set, or is invalid.
func (r *Request) DataFilled() bool {
return r.Data != nil && reflect.ValueOf(r.Data).Elem().IsValid()
}
// SetBufferBody will set the request's body bytes that will be sent to
// the service API.
func (r *Request) SetBufferBody(buf []byte) {
r.SetReaderBody(bytes.NewReader(buf))
}
// SetStringBody sets the body of the request to be backed by a string.
func (r *Request) SetStringBody(s string) {
r.SetReaderBody(strings.NewReader(s))
}
// SetReaderBody will set the request's body reader.
func (r *Request) SetReaderBody(reader io.ReadSeeker) {
r.HTTPRequest.Body = ioutil.NopCloser(reader)
r.Body = reader
}
// Presign returns the request's signed URL. Error will be returned
// if the signing fails.
func (r *Request) Presign(expireTime time.Duration) (string, error) {
r.ExpireTime = expireTime
r.Sign()
if r.Error != nil {
return "", r.Error
}
return r.HTTPRequest.URL.String(), nil
}
func debugLogReqError(r *Request, stage string, retrying bool, err error) {
if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) {
return
}
retryStr := "not retrying"
if retrying {
retryStr = "will retry"
}
r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v",
stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err))
}
// Build will build the request's object so it can be signed and sent
// to the service. Build will also validate all the request's parameters.
// Anny additional build Handlers set on this request will be run
// in the order they were set.
//
// The request will only be built once. Multiple calls to build will have
// no effect.
//
// If any Validate or Build errors occur the build will stop and the error
// which occurred will be returned.
func (r *Request) Build() error {
if !r.built {
r.Error = nil
r.Handlers.Validate.Run(r)
if r.Error != nil {
debugLogReqError(r, "Validate Request", false, r.Error)
return r.Error
}
r.Handlers.Build.Run(r)
r.built = true
}
return r.Error
}
// Sign will sign the request retuning error if errors are encountered.
//
// Send will build the request prior to signing. All Sign Handlers will
// be executed in the order they were set.
func (r *Request) Sign() error {
r.Build()
if r.Error != nil {
debugLogReqError(r, "Build Request", false, r.Error)
return r.Error
}
r.Handlers.Sign.Run(r)
return r.Error
}
// Send will send the request returning error if errors are encountered.
//
// Send will sign the request prior to sending. All Send Handlers will
// be executed in the order they were set.
func (r *Request) Send() error {
for {
r.Sign()
if r.Error != nil {
return r.Error
}
if aws.BoolValue(r.Retryable) {
if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount))
}
// Re-seek the body back to the original point in for a retry so that
// send will send the body's contents again in the upcoming request.
r.Body.Seek(r.BodyStart, 0)
r.HTTPRequest.Body = ioutil.NopCloser(r.Body)
}
r.Retryable = nil
r.Handlers.Send.Run(r)
if r.Error != nil {
err := r.Error
r.Handlers.Retry.Run(r)
r.Handlers.AfterRetry.Run(r)
if r.Error != nil {
debugLogReqError(r, "Send Request", false, r.Error)
return r.Error
}
debugLogReqError(r, "Send Request", true, err)
continue
}
r.Handlers.UnmarshalMeta.Run(r)
r.Handlers.ValidateResponse.Run(r)
if r.Error != nil {
err := r.Error
r.Handlers.UnmarshalError.Run(r)
r.Handlers.Retry.Run(r)
r.Handlers.AfterRetry.Run(r)
if r.Error != nil {
debugLogReqError(r, "Validate Response", false, r.Error)
return r.Error
}
debugLogReqError(r, "Validate Response", true, err)
continue
}
r.Handlers.Unmarshal.Run(r)
if r.Error != nil {
err := r.Error
r.Handlers.Retry.Run(r)
r.Handlers.AfterRetry.Run(r)
if r.Error != nil {
debugLogReqError(r, "Unmarshal Response", false, r.Error)
return r.Error
}
debugLogReqError(r, "Unmarshal Response", true, err)
continue
}
break
}
return nil
}
// AddToUserAgent adds the string to the end of the request's current user agent.
func AddToUserAgent(r *Request, s string) {
curUA := r.HTTPRequest.Header.Get("User-Agent")
if len(curUA) > 0 {
s = curUA + " " + s
}
r.HTTPRequest.Header.Set("User-Agent", s)
}
@@ -1,104 +0,0 @@
package request
import (
"reflect"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
)
//type Paginater interface {
// HasNextPage() bool
// NextPage() *Request
// EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error
//}
// HasNextPage returns true if this request has more pages of data available.
func (r *Request) HasNextPage() bool {
return len(r.nextPageTokens()) > 0
}
// nextPageTokens returns the tokens to use when asking for the next page of
// data.
func (r *Request) nextPageTokens() []interface{} {
if r.Operation.Paginator == nil {
return nil
}
if r.Operation.TruncationToken != "" {
tr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken)
if len(tr) == 0 {
return nil
}
switch v := tr[0].(type) {
case *bool:
if !aws.BoolValue(v) {
return nil
}
case bool:
if v == false {
return nil
}
}
}
tokens := []interface{}{}
tokenAdded := false
for _, outToken := range r.Operation.OutputTokens {
v, _ := awsutil.ValuesAtPath(r.Data, outToken)
if len(v) > 0 {
tokens = append(tokens, v[0])
tokenAdded = true
} else {
tokens = append(tokens, nil)
}
}
if !tokenAdded {
return nil
}
return tokens
}
// NextPage returns a new Request that can be executed to return the next
// page of result data. Call .Send() on this request to execute it.
func (r *Request) NextPage() *Request {
tokens := r.nextPageTokens()
if len(tokens) == 0 {
return nil
}
data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface()
nr := New(r.Config, r.ClientInfo, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data)
for i, intok := range nr.Operation.InputTokens {
awsutil.SetValueAtPath(nr.Params, intok, tokens[i])
}
return nr
}
// EachPage iterates over each page of a paginated request object. The fn
// parameter should be a function with the following sample signature:
//
// func(page *T, lastPage bool) bool {
// return true // return false to stop iterating
// }
//
// Where "T" is the structure type matching the output structure of the given
// operation. For example, a request object generated by
// DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput
// as the structure "T". The lastPage value represents whether the page is
// the last page of data or not. The return value of this function should
// return true to keep iterating or false to stop.
func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error {
for page := r; page != nil; page = page.NextPage() {
if err := page.Send(); err != nil {
return err
}
if getNextPage := fn(page.Data, !page.HasNextPage()); !getNextPage {
return page.Error
}
}
return nil
}
@@ -1,455 +0,0 @@
package request_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting/unit"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/route53"
"github.com/aws/aws-sdk-go/service/s3"
)
// Use DynamoDB methods for simplicity
func TestPaginationQueryPage(t *testing.T) {
db := dynamodb.New(unit.Session)
tokens, pages, numPages, gotToEnd := []map[string]*dynamodb.AttributeValue{}, []map[string]*dynamodb.AttributeValue{}, 0, false
reqNum := 0
resps := []*dynamodb.QueryOutput{
{
LastEvaluatedKey: map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}},
Count: aws.Int64(1),
Items: []map[string]*dynamodb.AttributeValue{
map[string]*dynamodb.AttributeValue{
"key": {S: aws.String("key1")},
},
},
},
{
LastEvaluatedKey: map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}},
Count: aws.Int64(1),
Items: []map[string]*dynamodb.AttributeValue{
map[string]*dynamodb.AttributeValue{
"key": {S: aws.String("key2")},
},
},
},
{
LastEvaluatedKey: map[string]*dynamodb.AttributeValue{},
Count: aws.Int64(1),
Items: []map[string]*dynamodb.AttributeValue{
map[string]*dynamodb.AttributeValue{
"key": {S: aws.String("key3")},
},
},
},
}
db.Handlers.Send.Clear() // mock sending
db.Handlers.Unmarshal.Clear()
db.Handlers.UnmarshalMeta.Clear()
db.Handlers.ValidateResponse.Clear()
db.Handlers.Build.PushBack(func(r *request.Request) {
in := r.Params.(*dynamodb.QueryInput)
if in == nil {
tokens = append(tokens, nil)
} else if len(in.ExclusiveStartKey) != 0 {
tokens = append(tokens, in.ExclusiveStartKey)
}
})
db.Handlers.Unmarshal.PushBack(func(r *request.Request) {
r.Data = resps[reqNum]
reqNum++
})
params := &dynamodb.QueryInput{
Limit: aws.Int64(2),
TableName: aws.String("tablename"),
}
err := db.QueryPages(params, func(p *dynamodb.QueryOutput, last bool) bool {
numPages++
for _, item := range p.Items {
pages = append(pages, item)
}
if last {
if gotToEnd {
assert.Fail(t, "last=true happened twice")
}
gotToEnd = true
}
return true
})
assert.Nil(t, err)
assert.Equal(t,
[]map[string]*dynamodb.AttributeValue{
map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}},
map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}},
}, tokens)
assert.Equal(t,
[]map[string]*dynamodb.AttributeValue{
map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}},
map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}},
map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key3")}},
}, pages)
assert.Equal(t, 3, numPages)
assert.True(t, gotToEnd)
assert.Nil(t, params.ExclusiveStartKey)
}
// Use DynamoDB methods for simplicity
func TestPagination(t *testing.T) {
db := dynamodb.New(unit.Session)
tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false
reqNum := 0
resps := []*dynamodb.ListTablesOutput{
{TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")},
{TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")},
{TableNames: []*string{aws.String("Table5")}},
}
db.Handlers.Send.Clear() // mock sending
db.Handlers.Unmarshal.Clear()
db.Handlers.UnmarshalMeta.Clear()
db.Handlers.ValidateResponse.Clear()
db.Handlers.Build.PushBack(func(r *request.Request) {
in := r.Params.(*dynamodb.ListTablesInput)
if in == nil {
tokens = append(tokens, "")
} else if in.ExclusiveStartTableName != nil {
tokens = append(tokens, *in.ExclusiveStartTableName)
}
})
db.Handlers.Unmarshal.PushBack(func(r *request.Request) {
r.Data = resps[reqNum]
reqNum++
})
params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)}
err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool {
numPages++
for _, t := range p.TableNames {
pages = append(pages, *t)
}
if last {
if gotToEnd {
assert.Fail(t, "last=true happened twice")
}
gotToEnd = true
}
return true
})
assert.Equal(t, []string{"Table2", "Table4"}, tokens)
assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages)
assert.Equal(t, 3, numPages)
assert.True(t, gotToEnd)
assert.Nil(t, err)
assert.Nil(t, params.ExclusiveStartTableName)
}
// Use DynamoDB methods for simplicity
func TestPaginationEachPage(t *testing.T) {
db := dynamodb.New(unit.Session)
tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false
reqNum := 0
resps := []*dynamodb.ListTablesOutput{
{TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")},
{TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")},
{TableNames: []*string{aws.String("Table5")}},
}
db.Handlers.Send.Clear() // mock sending
db.Handlers.Unmarshal.Clear()
db.Handlers.UnmarshalMeta.Clear()
db.Handlers.ValidateResponse.Clear()
db.Handlers.Build.PushBack(func(r *request.Request) {
in := r.Params.(*dynamodb.ListTablesInput)
if in == nil {
tokens = append(tokens, "")
} else if in.ExclusiveStartTableName != nil {
tokens = append(tokens, *in.ExclusiveStartTableName)
}
})
db.Handlers.Unmarshal.PushBack(func(r *request.Request) {
r.Data = resps[reqNum]
reqNum++
})
params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)}
req, _ := db.ListTablesRequest(params)
err := req.EachPage(func(p interface{}, last bool) bool {
numPages++
for _, t := range p.(*dynamodb.ListTablesOutput).TableNames {
pages = append(pages, *t)
}
if last {
if gotToEnd {
assert.Fail(t, "last=true happened twice")
}
gotToEnd = true
}
return true
})
assert.Equal(t, []string{"Table2", "Table4"}, tokens)
assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages)
assert.Equal(t, 3, numPages)
assert.True(t, gotToEnd)
assert.Nil(t, err)
}
// Use DynamoDB methods for simplicity
func TestPaginationEarlyExit(t *testing.T) {
db := dynamodb.New(unit.Session)
numPages, gotToEnd := 0, false
reqNum := 0
resps := []*dynamodb.ListTablesOutput{
{TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")},
{TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")},
{TableNames: []*string{aws.String("Table5")}},
}
db.Handlers.Send.Clear() // mock sending
db.Handlers.Unmarshal.Clear()
db.Handlers.UnmarshalMeta.Clear()
db.Handlers.ValidateResponse.Clear()
db.Handlers.Unmarshal.PushBack(func(r *request.Request) {
r.Data = resps[reqNum]
reqNum++
})
params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)}
err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool {
numPages++
if numPages == 2 {
return false
}
if last {
if gotToEnd {
assert.Fail(t, "last=true happened twice")
}
gotToEnd = true
}
return true
})
assert.Equal(t, 2, numPages)
assert.False(t, gotToEnd)
assert.Nil(t, err)
}
func TestSkipPagination(t *testing.T) {
client := s3.New(unit.Session)
client.Handlers.Send.Clear() // mock sending
client.Handlers.Unmarshal.Clear()
client.Handlers.UnmarshalMeta.Clear()
client.Handlers.ValidateResponse.Clear()
client.Handlers.Unmarshal.PushBack(func(r *request.Request) {
r.Data = &s3.HeadBucketOutput{}
})
req, _ := client.HeadBucketRequest(&s3.HeadBucketInput{Bucket: aws.String("bucket")})
numPages, gotToEnd := 0, false
req.EachPage(func(p interface{}, last bool) bool {
numPages++
if last {
gotToEnd = true
}
return true
})
assert.Equal(t, 1, numPages)
assert.True(t, gotToEnd)
}
// Use S3 for simplicity
func TestPaginationTruncation(t *testing.T) {
client := s3.New(unit.Session)
reqNum := 0
resps := []*s3.ListObjectsOutput{
{IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key1")}}},
{IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key2")}}},
{IsTruncated: aws.Bool(false), Contents: []*s3.Object{{Key: aws.String("Key3")}}},
{IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key4")}}},
}
client.Handlers.Send.Clear() // mock sending
client.Handlers.Unmarshal.Clear()
client.Handlers.UnmarshalMeta.Clear()
client.Handlers.ValidateResponse.Clear()
client.Handlers.Unmarshal.PushBack(func(r *request.Request) {
r.Data = resps[reqNum]
reqNum++
})
params := &s3.ListObjectsInput{Bucket: aws.String("bucket")}
results := []string{}
err := client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool {
results = append(results, *p.Contents[0].Key)
return true
})
assert.Equal(t, []string{"Key1", "Key2", "Key3"}, results)
assert.Nil(t, err)
// Try again without truncation token at all
reqNum = 0
resps[1].IsTruncated = nil
resps[2].IsTruncated = aws.Bool(true)
results = []string{}
err = client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool {
results = append(results, *p.Contents[0].Key)
return true
})
assert.Equal(t, []string{"Key1", "Key2"}, results)
assert.Nil(t, err)
}
func TestPaginationNilToken(t *testing.T) {
client := route53.New(unit.Session)
reqNum := 0
resps := []*route53.ListResourceRecordSetsOutput{
{
ResourceRecordSets: []*route53.ResourceRecordSet{
{Name: aws.String("first.example.com.")},
},
IsTruncated: aws.Bool(true),
NextRecordName: aws.String("second.example.com."),
NextRecordType: aws.String("MX"),
NextRecordIdentifier: aws.String("second"),
MaxItems: aws.String("1"),
},
{
ResourceRecordSets: []*route53.ResourceRecordSet{
{Name: aws.String("second.example.com.")},
},
IsTruncated: aws.Bool(true),
NextRecordName: aws.String("third.example.com."),
NextRecordType: aws.String("MX"),
MaxItems: aws.String("1"),
},
{
ResourceRecordSets: []*route53.ResourceRecordSet{
{Name: aws.String("third.example.com.")},
},
IsTruncated: aws.Bool(false),
MaxItems: aws.String("1"),
},
}
client.Handlers.Send.Clear() // mock sending
client.Handlers.Unmarshal.Clear()
client.Handlers.UnmarshalMeta.Clear()
client.Handlers.ValidateResponse.Clear()
idents := []string{}
client.Handlers.Build.PushBack(func(r *request.Request) {
p := r.Params.(*route53.ListResourceRecordSetsInput)
idents = append(idents, aws.StringValue(p.StartRecordIdentifier))
})
client.Handlers.Unmarshal.PushBack(func(r *request.Request) {
r.Data = resps[reqNum]
reqNum++
})
params := &route53.ListResourceRecordSetsInput{
HostedZoneId: aws.String("id-zone"),
}
results := []string{}
err := client.ListResourceRecordSetsPages(params, func(p *route53.ListResourceRecordSetsOutput, last bool) bool {
results = append(results, *p.ResourceRecordSets[0].Name)
return true
})
assert.NoError(t, err)
assert.Equal(t, []string{"", "second", ""}, idents)
assert.Equal(t, []string{"first.example.com.", "second.example.com.", "third.example.com."}, results)
}
// Benchmarks
var benchResps = []*dynamodb.ListTablesOutput{
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")},
{TableNames: []*string{aws.String("TABLE")}},
}
var benchDb = func() *dynamodb.DynamoDB {
db := dynamodb.New(unit.Session)
db.Handlers.Send.Clear() // mock sending
db.Handlers.Unmarshal.Clear()
db.Handlers.UnmarshalMeta.Clear()
db.Handlers.ValidateResponse.Clear()
return db
}
func BenchmarkCodegenIterator(b *testing.B) {
reqNum := 0
db := benchDb()
db.Handlers.Unmarshal.PushBack(func(r *request.Request) {
r.Data = benchResps[reqNum]
reqNum++
})
input := &dynamodb.ListTablesInput{Limit: aws.Int64(2)}
iter := func(fn func(*dynamodb.ListTablesOutput, bool) bool) error {
page, _ := db.ListTablesRequest(input)
for ; page != nil; page = page.NextPage() {
page.Send()
out := page.Data.(*dynamodb.ListTablesOutput)
if result := fn(out, !page.HasNextPage()); page.Error != nil || !result {
return page.Error
}
}
return nil
}
for i := 0; i < b.N; i++ {
reqNum = 0
iter(func(p *dynamodb.ListTablesOutput, last bool) bool {
return true
})
}
}
func BenchmarkEachPageIterator(b *testing.B) {
reqNum := 0
db := benchDb()
db.Handlers.Unmarshal.PushBack(func(r *request.Request) {
r.Data = benchResps[reqNum]
reqNum++
})
input := &dynamodb.ListTablesInput{Limit: aws.Int64(2)}
for i := 0; i < b.N; i++ {
reqNum = 0
req, _ := db.ListTablesRequest(input)
req.EachPage(func(p interface{}, last bool) bool {
return true
})
}
}
@@ -1,261 +0,0 @@
package request_test
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"runtime"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting"
)
type testData struct {
Data string
}
func body(str string) io.ReadCloser {
return ioutil.NopCloser(bytes.NewReader([]byte(str)))
}
func unmarshal(req *request.Request) {
defer req.HTTPResponse.Body.Close()
if req.Data != nil {
json.NewDecoder(req.HTTPResponse.Body).Decode(req.Data)
}
return
}
func unmarshalError(req *request.Request) {
bodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body)
if err != nil {
req.Error = awserr.New("UnmarshaleError", req.HTTPResponse.Status, err)
return
}
if len(bodyBytes) == 0 {
req.Error = awserr.NewRequestFailure(
awserr.New("UnmarshaleError", req.HTTPResponse.Status, fmt.Errorf("empty body")),
req.HTTPResponse.StatusCode,
"",
)
return
}
var jsonErr jsonErrorResponse
if err := json.Unmarshal(bodyBytes, &jsonErr); err != nil {
req.Error = awserr.New("UnmarshaleError", "JSON unmarshal", err)
return
}
req.Error = awserr.NewRequestFailure(
awserr.New(jsonErr.Code, jsonErr.Message, nil),
req.HTTPResponse.StatusCode,
"",
)
}
type jsonErrorResponse struct {
Code string `json:"__type"`
Message string `json:"message"`
}
// test that retries occur for 5xx status codes
func TestRequestRecoverRetry5xx(t *testing.T) {
reqNum := 0
reqs := []http.Response{
{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)},
{StatusCode: 501, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)},
{StatusCode: 200, Body: body(`{"data":"valid"}`)},
}
s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10))
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
s.Handlers.Send.Clear() // mock sending
s.Handlers.Send.PushBack(func(r *request.Request) {
r.HTTPResponse = &reqs[reqNum]
reqNum++
})
out := &testData{}
r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out)
err := r.Send()
assert.Nil(t, err)
assert.Equal(t, 2, int(r.RetryCount))
assert.Equal(t, "valid", out.Data)
}
// test that retries occur for 4xx status codes with a response type that can be retried - see `shouldRetry`
func TestRequestRecoverRetry4xxRetryable(t *testing.T) {
reqNum := 0
reqs := []http.Response{
{StatusCode: 400, Body: body(`{"__type":"Throttling","message":"Rate exceeded."}`)},
{StatusCode: 429, Body: body(`{"__type":"ProvisionedThroughputExceededException","message":"Rate exceeded."}`)},
{StatusCode: 200, Body: body(`{"data":"valid"}`)},
}
s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10))
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
s.Handlers.Send.Clear() // mock sending
s.Handlers.Send.PushBack(func(r *request.Request) {
r.HTTPResponse = &reqs[reqNum]
reqNum++
})
out := &testData{}
r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out)
err := r.Send()
assert.Nil(t, err)
assert.Equal(t, 2, int(r.RetryCount))
assert.Equal(t, "valid", out.Data)
}
// test that retries don't occur for 4xx status codes with a response type that can't be retried
func TestRequest4xxUnretryable(t *testing.T) {
s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10))
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
s.Handlers.Send.Clear() // mock sending
s.Handlers.Send.PushBack(func(r *request.Request) {
r.HTTPResponse = &http.Response{StatusCode: 401, Body: body(`{"__type":"SignatureDoesNotMatch","message":"Signature does not match."}`)}
})
out := &testData{}
r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out)
err := r.Send()
assert.NotNil(t, err)
if e, ok := err.(awserr.RequestFailure); ok {
assert.Equal(t, 401, e.StatusCode())
} else {
assert.Fail(t, "Expected error to be a service failure")
}
assert.Equal(t, "SignatureDoesNotMatch", err.(awserr.Error).Code())
assert.Equal(t, "Signature does not match.", err.(awserr.Error).Message())
assert.Equal(t, 0, int(r.RetryCount))
}
func TestRequestExhaustRetries(t *testing.T) {
delays := []time.Duration{}
sleepDelay := func(delay time.Duration) {
delays = append(delays, delay)
}
reqNum := 0
reqs := []http.Response{
{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)},
{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)},
{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)},
{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)},
}
s := awstesting.NewClient(aws.NewConfig().WithSleepDelay(sleepDelay))
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
s.Handlers.Send.Clear() // mock sending
s.Handlers.Send.PushBack(func(r *request.Request) {
r.HTTPResponse = &reqs[reqNum]
reqNum++
})
r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, nil)
err := r.Send()
assert.NotNil(t, err)
if e, ok := err.(awserr.RequestFailure); ok {
assert.Equal(t, 500, e.StatusCode())
} else {
assert.Fail(t, "Expected error to be a service failure")
}
assert.Equal(t, "UnknownError", err.(awserr.Error).Code())
assert.Equal(t, "An error occurred.", err.(awserr.Error).Message())
assert.Equal(t, 3, int(r.RetryCount))
expectDelays := []struct{ min, max time.Duration }{{30, 59}, {60, 118}, {120, 236}}
for i, v := range delays {
min := expectDelays[i].min * time.Millisecond
max := expectDelays[i].max * time.Millisecond
assert.True(t, min <= v && v <= max,
"Expect delay to be within range, i:%d, v:%s, min:%s, max:%s", i, v, min, max)
}
}
// test that the request is retried after the credentials are expired.
func TestRequestRecoverExpiredCreds(t *testing.T) {
reqNum := 0
reqs := []http.Response{
{StatusCode: 400, Body: body(`{"__type":"ExpiredTokenException","message":"expired token"}`)},
{StatusCode: 200, Body: body(`{"data":"valid"}`)},
}
s := awstesting.NewClient(&aws.Config{MaxRetries: aws.Int(10), Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "")})
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
credExpiredBeforeRetry := false
credExpiredAfterRetry := false
s.Handlers.AfterRetry.PushBack(func(r *request.Request) {
credExpiredAfterRetry = r.Config.Credentials.IsExpired()
})
s.Handlers.Sign.Clear()
s.Handlers.Sign.PushBack(func(r *request.Request) {
r.Config.Credentials.Get()
})
s.Handlers.Send.Clear() // mock sending
s.Handlers.Send.PushBack(func(r *request.Request) {
r.HTTPResponse = &reqs[reqNum]
reqNum++
})
out := &testData{}
r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out)
err := r.Send()
assert.Nil(t, err)
assert.False(t, credExpiredBeforeRetry, "Expect valid creds before retry check")
assert.True(t, credExpiredAfterRetry, "Expect expired creds after retry check")
assert.False(t, s.Config.Credentials.IsExpired(), "Expect valid creds after cred expired recovery")
assert.Equal(t, 1, int(r.RetryCount))
assert.Equal(t, "valid", out.Data)
}
func TestMakeAddtoUserAgentHandler(t *testing.T) {
fn := request.MakeAddToUserAgentHandler("name", "version", "extra1", "extra2")
r := &request.Request{HTTPRequest: &http.Request{Header: http.Header{}}}
r.HTTPRequest.Header.Set("User-Agent", "foo/bar")
fn(r)
assert.Equal(t, "foo/bar name/version (extra1; extra2)", r.HTTPRequest.Header.Get("User-Agent"))
}
func TestMakeAddtoUserAgentFreeFormHandler(t *testing.T) {
fn := request.MakeAddToUserAgentFreeFormHandler("name/version (extra1; extra2)")
r := &request.Request{HTTPRequest: &http.Request{Header: http.Header{}}}
r.HTTPRequest.Header.Set("User-Agent", "foo/bar")
fn(r)
assert.Equal(t, "foo/bar name/version (extra1; extra2)", r.HTTPRequest.Header.Get("User-Agent"))
}
func TestRequestUserAgent(t *testing.T) {
s := awstesting.NewClient(&aws.Config{Region: aws.String("us-east-1")})
// s.Handlers.Validate.Clear()
req := s.NewRequest(&request.Operation{Name: "Operation"}, nil, &testData{})
req.HTTPRequest.Header.Set("User-Agent", "foo/bar")
assert.NoError(t, req.Build())
expectUA := fmt.Sprintf("foo/bar %s/%s (%s; %s; %s)",
aws.SDKName, aws.SDKVersion, runtime.Version(), runtime.GOOS, runtime.GOARCH)
assert.Equal(t, expectUA, req.HTTPRequest.Header.Get("User-Agent"))
}
-82
View File
@@ -1,82 +0,0 @@
package request
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
)
// Retryer is an interface to control retry logic for a given service.
// The default implementation used by most services is the service.DefaultRetryer
// structure, which contains basic retry logic using exponential backoff.
type Retryer interface {
RetryRules(*Request) time.Duration
ShouldRetry(*Request) bool
MaxRetries() int
}
// WithRetryer sets a config Retryer value to the given Config returning it
// for chaining.
func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config {
cfg.Retryer = retryer
return cfg
}
// retryableCodes is a collection of service response codes which are retry-able
// without any further action.
var retryableCodes = map[string]struct{}{
"RequestError": {},
"RequestTimeout": {},
"ProvisionedThroughputExceededException": {},
"Throttling": {},
"ThrottlingException": {},
"RequestLimitExceeded": {},
"RequestThrottled": {},
"LimitExceededException": {}, // Deleting 10+ DynamoDb tables at once
"TooManyRequestsException": {}, // Lambda functions
}
// credsExpiredCodes is a collection of error codes which signify the credentials
// need to be refreshed. Expired tokens require refreshing of credentials, and
// resigning before the request can be retried.
var credsExpiredCodes = map[string]struct{}{
"ExpiredToken": {},
"ExpiredTokenException": {},
"RequestExpired": {}, // EC2 Only
}
func isCodeRetryable(code string) bool {
if _, ok := retryableCodes[code]; ok {
return true
}
return isCodeExpiredCreds(code)
}
func isCodeExpiredCreds(code string) bool {
_, ok := credsExpiredCodes[code]
return ok
}
// IsErrorRetryable returns whether the error is retryable, based on its Code.
// Returns false if the request has no Error set.
func (r *Request) IsErrorRetryable() bool {
if r.Error != nil {
if err, ok := r.Error.(awserr.Error); ok {
return isCodeRetryable(err.Code())
}
}
return false
}
// IsErrorExpired returns whether the error code is a credential expiry error.
// Returns false if the request has no Error set.
func (r *Request) IsErrorExpired() bool {
if r.Error != nil {
if err, ok := r.Error.(awserr.Error); ok {
return isCodeExpiredCreds(err.Code())
}
}
return false
}
-105
View File
@@ -1,105 +0,0 @@
// Package session provides a way to create service clients with shared configuration
// and handlers.
package session
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/defaults"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/endpoints"
)
// A Session provides a central location to create service clients from and
// store configurations and request handlers for those services.
//
// Sessions are safe to create service clients concurrently, but it is not safe
// to mutate the session concurrently.
type Session struct {
Config *aws.Config
Handlers request.Handlers
}
// New creates a new instance of the handlers merging in the provided Configs
// on top of the SDK's default configurations. Once the session is created it
// can be mutated to modify Configs or Handlers. The session is safe to be read
// concurrently, but it should not be written to concurrently.
//
// Example:
// // Create a session with the default config and request handlers.
// sess := session.New()
//
// // Create a session with a custom region
// sess := session.New(&aws.Config{Region: aws.String("us-east-1")})
//
// // Create a session, and add additional handlers for all service
// // clients created with the session to inherit. Adds logging handler.
// sess := session.New()
// sess.Handlers.Send.PushFront(func(r *request.Request) {
// // Log every request made and its payload
// logger.Println("Request: %s/%s, Payload: %s", r.ClientInfo.ServiceName, r.Operation, r.Params)
// })
//
// // Create a S3 client instance from a session
// sess := session.New()
// svc := s3.New(sess)
func New(cfgs ...*aws.Config) *Session {
def := defaults.Get()
s := &Session{
Config: def.Config,
Handlers: def.Handlers,
}
s.Config.MergeIn(cfgs...)
initHandlers(s)
return s
}
func initHandlers(s *Session) {
// Add the Validate parameter handler if it is not disabled.
s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler)
if !aws.BoolValue(s.Config.DisableParamValidation) {
s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler)
}
}
// Copy creates and returns a copy of the current session, coping the config
// and handlers. If any additional configs are provided they will be merged
// on top of the session's copied config.
//
// Example:
// // Create a copy of the current session, configured for the us-west-2 region.
// sess.Copy(&aws.Config{Region: aws.String("us-west-2"})
func (s *Session) Copy(cfgs ...*aws.Config) *Session {
newSession := &Session{
Config: s.Config.Copy(cfgs...),
Handlers: s.Handlers.Copy(),
}
initHandlers(newSession)
return newSession
}
// ClientConfig satisfies the client.ConfigProvider interface and is used to
// configure the service client instances. Passing the Session to the service
// client's constructor (New) will use this method to configure the client.
//
// Example:
// sess := session.New()
// s3.New(sess)
func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config {
s = s.Copy(cfgs...)
endpoint, signingRegion := endpoints.NormalizeEndpoint(
aws.StringValue(s.Config.Endpoint), serviceName,
aws.StringValue(s.Config.Region), aws.BoolValue(s.Config.DisableSSL))
return client.Config{
Config: s.Config,
Handlers: s.Handlers,
Endpoint: endpoint,
SigningRegion: signingRegion,
}
}
@@ -1,20 +0,0 @@
package session_test
import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
)
func TestNewDefaultSession(t *testing.T) {
s := session.New(&aws.Config{Region: aws.String("region")})
assert.Equal(t, "region", *s.Config.Region)
assert.Equal(t, http.DefaultClient, s.Config.HTTPClient)
assert.NotNil(t, s.Config.Logger)
assert.Equal(t, aws.LogOff, *s.Config.LogLevel)
}
-56
View File
@@ -1,56 +0,0 @@
package aws
import (
"math/rand"
"testing"
"github.com/stretchr/testify/assert"
)
func TestWriteAtBuffer(t *testing.T) {
b := &WriteAtBuffer{}
n, err := b.WriteAt([]byte{1}, 0)
assert.NoError(t, err)
assert.Equal(t, 1, n)
n, err = b.WriteAt([]byte{1, 1, 1}, 5)
assert.NoError(t, err)
assert.Equal(t, 3, n)
n, err = b.WriteAt([]byte{2}, 1)
assert.NoError(t, err)
assert.Equal(t, 1, n)
n, err = b.WriteAt([]byte{3}, 2)
assert.NoError(t, err)
assert.Equal(t, 1, n)
assert.Equal(t, []byte{1, 2, 3, 0, 0, 1, 1, 1}, b.Bytes())
}
func BenchmarkWriteAtBuffer(b *testing.B) {
buf := &WriteAtBuffer{}
r := rand.New(rand.NewSource(1))
b.ResetTimer()
for i := 0; i < b.N; i++ {
to := r.Intn(10) * 4096
bs := make([]byte, to)
buf.WriteAt(bs, r.Int63n(10)*4096)
}
}
func BenchmarkWriteAtBufferParallel(b *testing.B) {
buf := &WriteAtBuffer{}
r := rand.New(rand.NewSource(1))
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
to := r.Intn(10) * 4096
bs := make([]byte, to)
buf.WriteAt(bs, r.Int63n(10)*4096)
}
})
}
@@ -1,31 +0,0 @@
// Package endpoints validates regional endpoints for services.
package endpoints
//go:generate go run ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go
//go:generate gofmt -s -w endpoints_map.go
import "strings"
// EndpointForRegion returns an endpoint and its signing region for a service and region.
// if the service and region pair are not found endpoint and signingRegion will be empty.
func EndpointForRegion(svcName, region string) (endpoint, signingRegion string) {
derivedKeys := []string{
region + "/" + svcName,
region + "/*",
"*/" + svcName,
"*/*",
}
for _, key := range derivedKeys {
if val, ok := endpointsMap.Endpoints[key]; ok {
ep := val.Endpoint
ep = strings.Replace(ep, "{region}", region, -1)
ep = strings.Replace(ep, "{service}", svcName, -1)
endpoint = ep
signingRegion = val.SigningRegion
return
}
}
return
}
@@ -1,77 +0,0 @@
{
"version": 2,
"endpoints": {
"*/*": {
"endpoint": "{service}.{region}.amazonaws.com"
},
"cn-north-1/*": {
"endpoint": "{service}.{region}.amazonaws.com.cn",
"signatureVersion": "v4"
},
"us-gov-west-1/iam": {
"endpoint": "iam.us-gov.amazonaws.com"
},
"us-gov-west-1/sts": {
"endpoint": "sts.us-gov-west-1.amazonaws.com"
},
"us-gov-west-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"*/cloudfront": {
"endpoint": "cloudfront.amazonaws.com",
"signingRegion": "us-east-1"
},
"*/cloudsearchdomain": {
"endpoint": "",
"signingRegion": "us-east-1"
},
"*/iam": {
"endpoint": "iam.amazonaws.com",
"signingRegion": "us-east-1"
},
"*/importexport": {
"endpoint": "importexport.amazonaws.com",
"signingRegion": "us-east-1"
},
"*/route53": {
"endpoint": "route53.amazonaws.com",
"signingRegion": "us-east-1"
},
"*/sts": {
"endpoint": "sts.amazonaws.com",
"signingRegion": "us-east-1"
},
"us-east-1/sdb": {
"endpoint": "sdb.amazonaws.com",
"signingRegion": "us-east-1"
},
"us-east-1/s3": {
"endpoint": "s3.amazonaws.com"
},
"us-west-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"us-west-2/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"eu-west-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"ap-southeast-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"ap-southeast-2/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"ap-northeast-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"sa-east-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"eu-central-1/s3": {
"endpoint": "{service}.{region}.amazonaws.com",
"signatureVersion": "v4"
}
}
}
@@ -1,89 +0,0 @@
package endpoints
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
type endpointStruct struct {
Version int
Endpoints map[string]endpointEntry
}
type endpointEntry struct {
Endpoint string
SigningRegion string
}
var endpointsMap = endpointStruct{
Version: 2,
Endpoints: map[string]endpointEntry{
"*/*": {
Endpoint: "{service}.{region}.amazonaws.com",
},
"*/cloudfront": {
Endpoint: "cloudfront.amazonaws.com",
SigningRegion: "us-east-1",
},
"*/cloudsearchdomain": {
Endpoint: "",
SigningRegion: "us-east-1",
},
"*/iam": {
Endpoint: "iam.amazonaws.com",
SigningRegion: "us-east-1",
},
"*/importexport": {
Endpoint: "importexport.amazonaws.com",
SigningRegion: "us-east-1",
},
"*/route53": {
Endpoint: "route53.amazonaws.com",
SigningRegion: "us-east-1",
},
"*/sts": {
Endpoint: "sts.amazonaws.com",
SigningRegion: "us-east-1",
},
"ap-northeast-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"ap-southeast-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"ap-southeast-2/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"cn-north-1/*": {
Endpoint: "{service}.{region}.amazonaws.com.cn",
},
"eu-central-1/s3": {
Endpoint: "{service}.{region}.amazonaws.com",
},
"eu-west-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"sa-east-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"us-east-1/s3": {
Endpoint: "s3.amazonaws.com",
},
"us-east-1/sdb": {
Endpoint: "sdb.amazonaws.com",
SigningRegion: "us-east-1",
},
"us-gov-west-1/iam": {
Endpoint: "iam.us-gov.amazonaws.com",
},
"us-gov-west-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"us-gov-west-1/sts": {
Endpoint: "sts.us-gov-west-1.amazonaws.com",
},
"us-west-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"us-west-2/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
},
}
@@ -1,28 +0,0 @@
package endpoints
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGlobalEndpoints(t *testing.T) {
region := "mock-region-1"
svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts"}
for _, name := range svcs {
ep, sr := EndpointForRegion(name, region)
assert.Equal(t, name+".amazonaws.com", ep)
assert.Equal(t, "us-east-1", sr)
}
}
func TestServicesInCN(t *testing.T) {
region := "cn-north-1"
svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "s3"}
for _, name := range svcs {
ep, _ := EndpointForRegion(name, region)
assert.Equal(t, name+"."+region+".amazonaws.com.cn", ep)
}
}
@@ -1,32 +0,0 @@
// Package ec2query provides serialisation of AWS EC2 requests and responses.
package ec2query
//go:generate go run ../../fixtures/protocol/generate.go ../../fixtures/protocol/input/ec2.json build_test.go
import (
"net/url"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/internal/protocol/query/queryutil"
)
// Build builds a request for the EC2 protocol.
func Build(r *aws.Request) {
body := url.Values{
"Action": {r.Operation.Name},
"Version": {r.Service.APIVersion},
}
if err := queryutil.Parse(body, r.Params, true); err != nil {
r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err)
}
if r.ExpireTime == 0 {
r.HTTPRequest.Method = "POST"
r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
r.SetBufferBody([]byte(body.Encode()))
} else { // This is a pre-signed request
r.HTTPRequest.Method = "GET"
r.HTTPRequest.URL.RawQuery = body.Encode()
}
}
@@ -1,860 +0,0 @@
package ec2query_test
import (
"bytes"
"encoding/json"
"encoding/xml"
"io"
"io/ioutil"
"net/http"
"net/url"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/internal/protocol/ec2query"
"github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil"
"github.com/aws/aws-sdk-go/internal/signer/v4"
"github.com/aws/aws-sdk-go/internal/util"
"github.com/stretchr/testify/assert"
)
var _ bytes.Buffer // always import bytes
var _ http.Request
var _ json.Marshaler
var _ time.Time
var _ xmlutil.XMLNode
var _ xml.Attr
var _ = ioutil.Discard
var _ = util.Trim("")
var _ = url.Values{}
var _ = io.EOF
type InputService1ProtocolTest struct {
*aws.Service
}
// New returns a new InputService1ProtocolTest client.
func NewInputService1ProtocolTest(config *aws.Config) *InputService1ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "inputservice1protocoltest",
APIVersion: "2014-01-01",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &InputService1ProtocolTest{service}
}
// newRequest creates a new request for a InputService1ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService1ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opInputService1TestCaseOperation1 = "OperationName"
// InputService1TestCaseOperation1Request generates a request for the InputService1TestCaseOperation1 operation.
func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputShape) (req *aws.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) {
op := &aws.Operation{
Name: opInputService1TestCaseOperation1,
}
if input == nil {
input = &InputService1TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
output = &InputService1TestShapeInputService1TestCaseOperation1Output{}
req.Data = output
return
}
func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) {
req, out := c.InputService1TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type InputService1TestShapeInputService1TestCaseOperation1Output struct {
metadataInputService1TestShapeInputService1TestCaseOperation1Output `json:"-" xml:"-"`
}
type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService1TestShapeInputShape struct {
Bar *string `type:"string"`
Foo *string `type:"string"`
metadataInputService1TestShapeInputShape `json:"-" xml:"-"`
}
type metadataInputService1TestShapeInputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService2ProtocolTest struct {
*aws.Service
}
// New returns a new InputService2ProtocolTest client.
func NewInputService2ProtocolTest(config *aws.Config) *InputService2ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "inputservice2protocoltest",
APIVersion: "2014-01-01",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &InputService2ProtocolTest{service}
}
// newRequest creates a new request for a InputService2ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService2ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opInputService2TestCaseOperation1 = "OperationName"
// InputService2TestCaseOperation1Request generates a request for the InputService2TestCaseOperation1 operation.
func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputShape) (req *aws.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) {
op := &aws.Operation{
Name: opInputService2TestCaseOperation1,
}
if input == nil {
input = &InputService2TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
output = &InputService2TestShapeInputService2TestCaseOperation1Output{}
req.Data = output
return
}
func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputShape) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) {
req, out := c.InputService2TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type InputService2TestShapeInputService2TestCaseOperation1Output struct {
metadataInputService2TestShapeInputService2TestCaseOperation1Output `json:"-" xml:"-"`
}
type metadataInputService2TestShapeInputService2TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService2TestShapeInputShape struct {
Bar *string `locationName:"barLocationName" type:"string"`
Foo *string `type:"string"`
Yuck *string `locationName:"yuckLocationName" queryName:"yuckQueryName" type:"string"`
metadataInputService2TestShapeInputShape `json:"-" xml:"-"`
}
type metadataInputService2TestShapeInputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService3ProtocolTest struct {
*aws.Service
}
// New returns a new InputService3ProtocolTest client.
func NewInputService3ProtocolTest(config *aws.Config) *InputService3ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "inputservice3protocoltest",
APIVersion: "2014-01-01",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &InputService3ProtocolTest{service}
}
// newRequest creates a new request for a InputService3ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService3ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opInputService3TestCaseOperation1 = "OperationName"
// InputService3TestCaseOperation1Request generates a request for the InputService3TestCaseOperation1 operation.
func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputShape) (req *aws.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) {
op := &aws.Operation{
Name: opInputService3TestCaseOperation1,
}
if input == nil {
input = &InputService3TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
output = &InputService3TestShapeInputService3TestCaseOperation1Output{}
req.Data = output
return
}
func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) {
req, out := c.InputService3TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type InputService3TestShapeInputService3TestCaseOperation1Output struct {
metadataInputService3TestShapeInputService3TestCaseOperation1Output `json:"-" xml:"-"`
}
type metadataInputService3TestShapeInputService3TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService3TestShapeInputShape struct {
StructArg *InputService3TestShapeStructType `locationName:"Struct" type:"structure"`
metadataInputService3TestShapeInputShape `json:"-" xml:"-"`
}
type metadataInputService3TestShapeInputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService3TestShapeStructType struct {
ScalarArg *string `locationName:"Scalar" type:"string"`
metadataInputService3TestShapeStructType `json:"-" xml:"-"`
}
type metadataInputService3TestShapeStructType struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService4ProtocolTest struct {
*aws.Service
}
// New returns a new InputService4ProtocolTest client.
func NewInputService4ProtocolTest(config *aws.Config) *InputService4ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "inputservice4protocoltest",
APIVersion: "2014-01-01",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &InputService4ProtocolTest{service}
}
// newRequest creates a new request for a InputService4ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService4ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opInputService4TestCaseOperation1 = "OperationName"
// InputService4TestCaseOperation1Request generates a request for the InputService4TestCaseOperation1 operation.
func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputShape) (req *aws.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) {
op := &aws.Operation{
Name: opInputService4TestCaseOperation1,
}
if input == nil {
input = &InputService4TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
output = &InputService4TestShapeInputService4TestCaseOperation1Output{}
req.Data = output
return
}
func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) {
req, out := c.InputService4TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type InputService4TestShapeInputService4TestCaseOperation1Output struct {
metadataInputService4TestShapeInputService4TestCaseOperation1Output `json:"-" xml:"-"`
}
type metadataInputService4TestShapeInputService4TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService4TestShapeInputShape struct {
ListArg []*string `type:"list"`
metadataInputService4TestShapeInputShape `json:"-" xml:"-"`
}
type metadataInputService4TestShapeInputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService5ProtocolTest struct {
*aws.Service
}
// New returns a new InputService5ProtocolTest client.
func NewInputService5ProtocolTest(config *aws.Config) *InputService5ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "inputservice5protocoltest",
APIVersion: "2014-01-01",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &InputService5ProtocolTest{service}
}
// newRequest creates a new request for a InputService5ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService5ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opInputService5TestCaseOperation1 = "OperationName"
// InputService5TestCaseOperation1Request generates a request for the InputService5TestCaseOperation1 operation.
func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputShape) (req *aws.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) {
op := &aws.Operation{
Name: opInputService5TestCaseOperation1,
}
if input == nil {
input = &InputService5TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
output = &InputService5TestShapeInputService5TestCaseOperation1Output{}
req.Data = output
return
}
func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) {
req, out := c.InputService5TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type InputService5TestShapeInputService5TestCaseOperation1Output struct {
metadataInputService5TestShapeInputService5TestCaseOperation1Output `json:"-" xml:"-"`
}
type metadataInputService5TestShapeInputService5TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService5TestShapeInputShape struct {
ListArg []*string `locationName:"ListMemberName" locationNameList:"item" type:"list"`
metadataInputService5TestShapeInputShape `json:"-" xml:"-"`
}
type metadataInputService5TestShapeInputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService6ProtocolTest struct {
*aws.Service
}
// New returns a new InputService6ProtocolTest client.
func NewInputService6ProtocolTest(config *aws.Config) *InputService6ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "inputservice6protocoltest",
APIVersion: "2014-01-01",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &InputService6ProtocolTest{service}
}
// newRequest creates a new request for a InputService6ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService6ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opInputService6TestCaseOperation1 = "OperationName"
// InputService6TestCaseOperation1Request generates a request for the InputService6TestCaseOperation1 operation.
func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputShape) (req *aws.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) {
op := &aws.Operation{
Name: opInputService6TestCaseOperation1,
}
if input == nil {
input = &InputService6TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
output = &InputService6TestShapeInputService6TestCaseOperation1Output{}
req.Data = output
return
}
func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputShape) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) {
req, out := c.InputService6TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type InputService6TestShapeInputService6TestCaseOperation1Output struct {
metadataInputService6TestShapeInputService6TestCaseOperation1Output `json:"-" xml:"-"`
}
type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService6TestShapeInputShape struct {
ListArg []*string `locationName:"ListMemberName" queryName:"ListQueryName" locationNameList:"item" type:"list"`
metadataInputService6TestShapeInputShape `json:"-" xml:"-"`
}
type metadataInputService6TestShapeInputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService7ProtocolTest struct {
*aws.Service
}
// New returns a new InputService7ProtocolTest client.
func NewInputService7ProtocolTest(config *aws.Config) *InputService7ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "inputservice7protocoltest",
APIVersion: "2014-01-01",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &InputService7ProtocolTest{service}
}
// newRequest creates a new request for a InputService7ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService7ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opInputService7TestCaseOperation1 = "OperationName"
// InputService7TestCaseOperation1Request generates a request for the InputService7TestCaseOperation1 operation.
func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputShape) (req *aws.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) {
op := &aws.Operation{
Name: opInputService7TestCaseOperation1,
}
if input == nil {
input = &InputService7TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
output = &InputService7TestShapeInputService7TestCaseOperation1Output{}
req.Data = output
return
}
func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputShape) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) {
req, out := c.InputService7TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type InputService7TestShapeInputService7TestCaseOperation1Output struct {
metadataInputService7TestShapeInputService7TestCaseOperation1Output `json:"-" xml:"-"`
}
type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService7TestShapeInputShape struct {
BlobArg []byte `type:"blob"`
metadataInputService7TestShapeInputShape `json:"-" xml:"-"`
}
type metadataInputService7TestShapeInputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService8ProtocolTest struct {
*aws.Service
}
// New returns a new InputService8ProtocolTest client.
func NewInputService8ProtocolTest(config *aws.Config) *InputService8ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "inputservice8protocoltest",
APIVersion: "2014-01-01",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &InputService8ProtocolTest{service}
}
// newRequest creates a new request for a InputService8ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService8ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opInputService8TestCaseOperation1 = "OperationName"
// InputService8TestCaseOperation1Request generates a request for the InputService8TestCaseOperation1 operation.
func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input *InputService8TestShapeInputShape) (req *aws.Request, output *InputService8TestShapeInputService8TestCaseOperation1Output) {
op := &aws.Operation{
Name: opInputService8TestCaseOperation1,
}
if input == nil {
input = &InputService8TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
output = &InputService8TestShapeInputService8TestCaseOperation1Output{}
req.Data = output
return
}
func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputShape) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) {
req, out := c.InputService8TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type InputService8TestShapeInputService8TestCaseOperation1Output struct {
metadataInputService8TestShapeInputService8TestCaseOperation1Output `json:"-" xml:"-"`
}
type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
type InputService8TestShapeInputShape struct {
TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"`
metadataInputService8TestShapeInputShape `json:"-" xml:"-"`
}
type metadataInputService8TestShapeInputShape struct {
SDKShapeTraits bool `type:"structure"`
}
//
// Tests begin here
//
func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) {
svc := NewInputService1ProtocolTest(nil)
svc.Endpoint = "https://test"
input := &InputService1TestShapeInputShape{
Bar: aws.String("val2"),
Foo: aws.String("val1"),
}
req, _ := svc.InputService1TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
// assert body
assert.NotNil(t, r.Body)
body, _ := ioutil.ReadAll(r.Body)
assert.Equal(t, util.Trim(`Action=OperationName&Bar=val2&Foo=val1&Version=2014-01-01`), util.Trim(string(body)))
// assert URL
assert.Equal(t, "https://test/", r.URL.String())
// assert headers
}
func TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedToMembersCase1(t *testing.T) {
svc := NewInputService2ProtocolTest(nil)
svc.Endpoint = "https://test"
input := &InputService2TestShapeInputShape{
Bar: aws.String("val2"),
Foo: aws.String("val1"),
Yuck: aws.String("val3"),
}
req, _ := svc.InputService2TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
// assert body
assert.NotNil(t, r.Body)
body, _ := ioutil.ReadAll(r.Body)
assert.Equal(t, util.Trim(`Action=OperationName&BarLocationName=val2&Foo=val1&Version=2014-01-01&yuckQueryName=val3`), util.Trim(string(body)))
// assert URL
assert.Equal(t, "https://test/", r.URL.String())
// assert headers
}
func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) {
svc := NewInputService3ProtocolTest(nil)
svc.Endpoint = "https://test"
input := &InputService3TestShapeInputShape{
StructArg: &InputService3TestShapeStructType{
ScalarArg: aws.String("foo"),
},
}
req, _ := svc.InputService3TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
// assert body
assert.NotNil(t, r.Body)
body, _ := ioutil.ReadAll(r.Body)
assert.Equal(t, util.Trim(`Action=OperationName&Struct.Scalar=foo&Version=2014-01-01`), util.Trim(string(body)))
// assert URL
assert.Equal(t, "https://test/", r.URL.String())
// assert headers
}
func TestInputService4ProtocolTestListTypesCase1(t *testing.T) {
svc := NewInputService4ProtocolTest(nil)
svc.Endpoint = "https://test"
input := &InputService4TestShapeInputShape{
ListArg: []*string{
aws.String("foo"),
aws.String("bar"),
aws.String("baz"),
},
}
req, _ := svc.InputService4TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
// assert body
assert.NotNil(t, r.Body)
body, _ := ioutil.ReadAll(r.Body)
assert.Equal(t, util.Trim(`Action=OperationName&ListArg.1=foo&ListArg.2=bar&ListArg.3=baz&Version=2014-01-01`), util.Trim(string(body)))
// assert URL
assert.Equal(t, "https://test/", r.URL.String())
// assert headers
}
func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *testing.T) {
svc := NewInputService5ProtocolTest(nil)
svc.Endpoint = "https://test"
input := &InputService5TestShapeInputShape{
ListArg: []*string{
aws.String("a"),
aws.String("b"),
aws.String("c"),
},
}
req, _ := svc.InputService5TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
// assert body
assert.NotNil(t, r.Body)
body, _ := ioutil.ReadAll(r.Body)
assert.Equal(t, util.Trim(`Action=OperationName&ListMemberName.1=a&ListMemberName.2=b&ListMemberName.3=c&Version=2014-01-01`), util.Trim(string(body)))
// assert URL
assert.Equal(t, "https://test/", r.URL.String())
// assert headers
}
func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(t *testing.T) {
svc := NewInputService6ProtocolTest(nil)
svc.Endpoint = "https://test"
input := &InputService6TestShapeInputShape{
ListArg: []*string{
aws.String("a"),
aws.String("b"),
aws.String("c"),
},
}
req, _ := svc.InputService6TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
// assert body
assert.NotNil(t, r.Body)
body, _ := ioutil.ReadAll(r.Body)
assert.Equal(t, util.Trim(`Action=OperationName&ListQueryName.1=a&ListQueryName.2=b&ListQueryName.3=c&Version=2014-01-01`), util.Trim(string(body)))
// assert URL
assert.Equal(t, "https://test/", r.URL.String())
// assert headers
}
func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
svc := NewInputService7ProtocolTest(nil)
svc.Endpoint = "https://test"
input := &InputService7TestShapeInputShape{
BlobArg: []byte("foo"),
}
req, _ := svc.InputService7TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
// assert body
assert.NotNil(t, r.Body)
body, _ := ioutil.ReadAll(r.Body)
assert.Equal(t, util.Trim(`Action=OperationName&BlobArg=Zm9v&Version=2014-01-01`), util.Trim(string(body)))
// assert URL
assert.Equal(t, "https://test/", r.URL.String())
// assert headers
}
func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) {
svc := NewInputService8ProtocolTest(nil)
svc.Endpoint = "https://test"
input := &InputService8TestShapeInputShape{
TimeArg: aws.Time(time.Unix(1422172800, 0)),
}
req, _ := svc.InputService8TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
// assert body
assert.NotNil(t, r.Body)
body, _ := ioutil.ReadAll(r.Body)
assert.Equal(t, util.Trim(`Action=OperationName&TimeArg=2015-01-25T08%3A00%3A00Z&Version=2014-01-01`), util.Trim(string(body)))
// assert URL
assert.Equal(t, "https://test/", r.URL.String())
// assert headers
}
@@ -1,54 +0,0 @@
package ec2query
//go:generate go run ../../fixtures/protocol/generate.go ../../fixtures/protocol/output/ec2.json unmarshal_test.go
import (
"encoding/xml"
"io"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil"
)
// Unmarshal unmarshals a response body for the EC2 protocol.
func Unmarshal(r *aws.Request) {
defer r.HTTPResponse.Body.Close()
if r.DataFilled() {
decoder := xml.NewDecoder(r.HTTPResponse.Body)
err := xmlutil.UnmarshalXML(r.Data, decoder, "")
if err != nil {
r.Error = awserr.New("SerializationError", "failed decoding EC2 Query response", err)
return
}
}
}
// UnmarshalMeta unmarshals response headers for the EC2 protocol.
func UnmarshalMeta(r *aws.Request) {
// TODO implement unmarshaling of request IDs
}
type xmlErrorResponse struct {
XMLName xml.Name `xml:"Response"`
Code string `xml:"Errors>Error>Code"`
Message string `xml:"Errors>Error>Message"`
RequestID string `xml:"RequestId"`
}
// UnmarshalError unmarshals a response error for the EC2 protocol.
func UnmarshalError(r *aws.Request) {
defer r.HTTPResponse.Body.Close()
resp := &xmlErrorResponse{}
err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp)
if err != nil && err != io.EOF {
r.Error = awserr.New("SerializationError", "failed decoding EC2 Query error response", err)
} else {
r.Error = awserr.NewRequestFailure(
awserr.New(resp.Code, resp.Message, nil),
r.HTTPResponse.StatusCode,
resp.RequestID,
)
}
}
@@ -1,816 +0,0 @@
package ec2query_test
import (
"bytes"
"encoding/json"
"encoding/xml"
"io"
"io/ioutil"
"net/http"
"net/url"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/internal/protocol/ec2query"
"github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil"
"github.com/aws/aws-sdk-go/internal/signer/v4"
"github.com/aws/aws-sdk-go/internal/util"
"github.com/stretchr/testify/assert"
)
var _ bytes.Buffer // always import bytes
var _ http.Request
var _ json.Marshaler
var _ time.Time
var _ xmlutil.XMLNode
var _ xml.Attr
var _ = ioutil.Discard
var _ = util.Trim("")
var _ = url.Values{}
var _ = io.EOF
type OutputService1ProtocolTest struct {
*aws.Service
}
// New returns a new OutputService1ProtocolTest client.
func NewOutputService1ProtocolTest(config *aws.Config) *OutputService1ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "outputservice1protocoltest",
APIVersion: "",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &OutputService1ProtocolTest{service}
}
// newRequest creates a new request for a OutputService1ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService1ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opOutputService1TestCaseOperation1 = "OperationName"
// OutputService1TestCaseOperation1Request generates a request for the OutputService1TestCaseOperation1 operation.
func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *aws.Request, output *OutputService1TestShapeOutputShape) {
op := &aws.Operation{
Name: opOutputService1TestCaseOperation1,
}
if input == nil {
input = &OutputService1TestShapeOutputService1TestCaseOperation1Input{}
}
req = c.newRequest(op, input, output)
output = &OutputService1TestShapeOutputShape{}
req.Data = output
return
}
func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputShape, error) {
req, out := c.OutputService1TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type OutputService1TestShapeOutputService1TestCaseOperation1Input struct {
metadataOutputService1TestShapeOutputService1TestCaseOperation1Input `json:"-" xml:"-"`
}
type metadataOutputService1TestShapeOutputService1TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService1TestShapeOutputShape struct {
Char *string `type:"character"`
Double *float64 `type:"double"`
FalseBool *bool `type:"boolean"`
Float *float64 `type:"float"`
Long *int64 `type:"long"`
Num *int64 `locationName:"FooNum" type:"integer"`
Str *string `type:"string"`
TrueBool *bool `type:"boolean"`
metadataOutputService1TestShapeOutputShape `json:"-" xml:"-"`
}
type metadataOutputService1TestShapeOutputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService2ProtocolTest struct {
*aws.Service
}
// New returns a new OutputService2ProtocolTest client.
func NewOutputService2ProtocolTest(config *aws.Config) *OutputService2ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "outputservice2protocoltest",
APIVersion: "",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &OutputService2ProtocolTest{service}
}
// newRequest creates a new request for a OutputService2ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService2ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opOutputService2TestCaseOperation1 = "OperationName"
// OutputService2TestCaseOperation1Request generates a request for the OutputService2TestCaseOperation1 operation.
func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *aws.Request, output *OutputService2TestShapeOutputShape) {
op := &aws.Operation{
Name: opOutputService2TestCaseOperation1,
}
if input == nil {
input = &OutputService2TestShapeOutputService2TestCaseOperation1Input{}
}
req = c.newRequest(op, input, output)
output = &OutputService2TestShapeOutputShape{}
req.Data = output
return
}
func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputShape, error) {
req, out := c.OutputService2TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type OutputService2TestShapeOutputService2TestCaseOperation1Input struct {
metadataOutputService2TestShapeOutputService2TestCaseOperation1Input `json:"-" xml:"-"`
}
type metadataOutputService2TestShapeOutputService2TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService2TestShapeOutputShape struct {
Blob []byte `type:"blob"`
metadataOutputService2TestShapeOutputShape `json:"-" xml:"-"`
}
type metadataOutputService2TestShapeOutputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService3ProtocolTest struct {
*aws.Service
}
// New returns a new OutputService3ProtocolTest client.
func NewOutputService3ProtocolTest(config *aws.Config) *OutputService3ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "outputservice3protocoltest",
APIVersion: "",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &OutputService3ProtocolTest{service}
}
// newRequest creates a new request for a OutputService3ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService3ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opOutputService3TestCaseOperation1 = "OperationName"
// OutputService3TestCaseOperation1Request generates a request for the OutputService3TestCaseOperation1 operation.
func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *aws.Request, output *OutputService3TestShapeOutputShape) {
op := &aws.Operation{
Name: opOutputService3TestCaseOperation1,
}
if input == nil {
input = &OutputService3TestShapeOutputService3TestCaseOperation1Input{}
}
req = c.newRequest(op, input, output)
output = &OutputService3TestShapeOutputShape{}
req.Data = output
return
}
func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputShape, error) {
req, out := c.OutputService3TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type OutputService3TestShapeOutputService3TestCaseOperation1Input struct {
metadataOutputService3TestShapeOutputService3TestCaseOperation1Input `json:"-" xml:"-"`
}
type metadataOutputService3TestShapeOutputService3TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService3TestShapeOutputShape struct {
ListMember []*string `type:"list"`
metadataOutputService3TestShapeOutputShape `json:"-" xml:"-"`
}
type metadataOutputService3TestShapeOutputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService4ProtocolTest struct {
*aws.Service
}
// New returns a new OutputService4ProtocolTest client.
func NewOutputService4ProtocolTest(config *aws.Config) *OutputService4ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "outputservice4protocoltest",
APIVersion: "",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &OutputService4ProtocolTest{service}
}
// newRequest creates a new request for a OutputService4ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService4ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opOutputService4TestCaseOperation1 = "OperationName"
// OutputService4TestCaseOperation1Request generates a request for the OutputService4TestCaseOperation1 operation.
func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *aws.Request, output *OutputService4TestShapeOutputShape) {
op := &aws.Operation{
Name: opOutputService4TestCaseOperation1,
}
if input == nil {
input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{}
}
req = c.newRequest(op, input, output)
output = &OutputService4TestShapeOutputShape{}
req.Data = output
return
}
func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputShape, error) {
req, out := c.OutputService4TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type OutputService4TestShapeOutputService4TestCaseOperation1Input struct {
metadataOutputService4TestShapeOutputService4TestCaseOperation1Input `json:"-" xml:"-"`
}
type metadataOutputService4TestShapeOutputService4TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService4TestShapeOutputShape struct {
ListMember []*string `locationNameList:"item" type:"list"`
metadataOutputService4TestShapeOutputShape `json:"-" xml:"-"`
}
type metadataOutputService4TestShapeOutputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService5ProtocolTest struct {
*aws.Service
}
// New returns a new OutputService5ProtocolTest client.
func NewOutputService5ProtocolTest(config *aws.Config) *OutputService5ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "outputservice5protocoltest",
APIVersion: "",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &OutputService5ProtocolTest{service}
}
// newRequest creates a new request for a OutputService5ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService5ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opOutputService5TestCaseOperation1 = "OperationName"
// OutputService5TestCaseOperation1Request generates a request for the OutputService5TestCaseOperation1 operation.
func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *aws.Request, output *OutputService5TestShapeOutputShape) {
op := &aws.Operation{
Name: opOutputService5TestCaseOperation1,
}
if input == nil {
input = &OutputService5TestShapeOutputService5TestCaseOperation1Input{}
}
req = c.newRequest(op, input, output)
output = &OutputService5TestShapeOutputShape{}
req.Data = output
return
}
func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputShape, error) {
req, out := c.OutputService5TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type OutputService5TestShapeOutputService5TestCaseOperation1Input struct {
metadataOutputService5TestShapeOutputService5TestCaseOperation1Input `json:"-" xml:"-"`
}
type metadataOutputService5TestShapeOutputService5TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService5TestShapeOutputShape struct {
ListMember []*string `type:"list" flattened:"true"`
metadataOutputService5TestShapeOutputShape `json:"-" xml:"-"`
}
type metadataOutputService5TestShapeOutputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService6ProtocolTest struct {
*aws.Service
}
// New returns a new OutputService6ProtocolTest client.
func NewOutputService6ProtocolTest(config *aws.Config) *OutputService6ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "outputservice6protocoltest",
APIVersion: "",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &OutputService6ProtocolTest{service}
}
// newRequest creates a new request for a OutputService6ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService6ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opOutputService6TestCaseOperation1 = "OperationName"
// OutputService6TestCaseOperation1Request generates a request for the OutputService6TestCaseOperation1 operation.
func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *aws.Request, output *OutputService6TestShapeOutputShape) {
op := &aws.Operation{
Name: opOutputService6TestCaseOperation1,
}
if input == nil {
input = &OutputService6TestShapeOutputService6TestCaseOperation1Input{}
}
req = c.newRequest(op, input, output)
output = &OutputService6TestShapeOutputShape{}
req.Data = output
return
}
func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputShape, error) {
req, out := c.OutputService6TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type OutputService6TestShapeOutputService6TestCaseOperation1Input struct {
metadataOutputService6TestShapeOutputService6TestCaseOperation1Input `json:"-" xml:"-"`
}
type metadataOutputService6TestShapeOutputService6TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService6TestShapeOutputShape struct {
Map map[string]*OutputService6TestShapeStructureType `type:"map"`
metadataOutputService6TestShapeOutputShape `json:"-" xml:"-"`
}
type metadataOutputService6TestShapeOutputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService6TestShapeStructureType struct {
Foo *string `locationName:"foo" type:"string"`
metadataOutputService6TestShapeStructureType `json:"-" xml:"-"`
}
type metadataOutputService6TestShapeStructureType struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService7ProtocolTest struct {
*aws.Service
}
// New returns a new OutputService7ProtocolTest client.
func NewOutputService7ProtocolTest(config *aws.Config) *OutputService7ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "outputservice7protocoltest",
APIVersion: "",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &OutputService7ProtocolTest{service}
}
// newRequest creates a new request for a OutputService7ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService7ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opOutputService7TestCaseOperation1 = "OperationName"
// OutputService7TestCaseOperation1Request generates a request for the OutputService7TestCaseOperation1 operation.
func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *aws.Request, output *OutputService7TestShapeOutputShape) {
op := &aws.Operation{
Name: opOutputService7TestCaseOperation1,
}
if input == nil {
input = &OutputService7TestShapeOutputService7TestCaseOperation1Input{}
}
req = c.newRequest(op, input, output)
output = &OutputService7TestShapeOutputShape{}
req.Data = output
return
}
func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputShape, error) {
req, out := c.OutputService7TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type OutputService7TestShapeOutputService7TestCaseOperation1Input struct {
metadataOutputService7TestShapeOutputService7TestCaseOperation1Input `json:"-" xml:"-"`
}
type metadataOutputService7TestShapeOutputService7TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService7TestShapeOutputShape struct {
Map map[string]*string `type:"map" flattened:"true"`
metadataOutputService7TestShapeOutputShape `json:"-" xml:"-"`
}
type metadataOutputService7TestShapeOutputShape struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService8ProtocolTest struct {
*aws.Service
}
// New returns a new OutputService8ProtocolTest client.
func NewOutputService8ProtocolTest(config *aws.Config) *OutputService8ProtocolTest {
service := &aws.Service{
Config: aws.DefaultConfig.Merge(config),
ServiceName: "outputservice8protocoltest",
APIVersion: "",
}
service.Initialize()
// Handlers
service.Handlers.Sign.PushBack(v4.Sign)
service.Handlers.Build.PushBack(ec2query.Build)
service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
return &OutputService8ProtocolTest{service}
}
// newRequest creates a new request for a OutputService8ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService8ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request {
req := aws.NewRequest(c.Service, op, params, data)
return req
}
const opOutputService8TestCaseOperation1 = "OperationName"
// OutputService8TestCaseOperation1Request generates a request for the OutputService8TestCaseOperation1 operation.
func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *aws.Request, output *OutputService8TestShapeOutputShape) {
op := &aws.Operation{
Name: opOutputService8TestCaseOperation1,
}
if input == nil {
input = &OutputService8TestShapeOutputService8TestCaseOperation1Input{}
}
req = c.newRequest(op, input, output)
output = &OutputService8TestShapeOutputShape{}
req.Data = output
return
}
func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputShape, error) {
req, out := c.OutputService8TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
type OutputService8TestShapeOutputService8TestCaseOperation1Input struct {
metadataOutputService8TestShapeOutputService8TestCaseOperation1Input `json:"-" xml:"-"`
}
type metadataOutputService8TestShapeOutputService8TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
}
type OutputService8TestShapeOutputShape struct {
Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"`
metadataOutputService8TestShapeOutputShape `json:"-" xml:"-"`
}
type metadataOutputService8TestShapeOutputShape struct {
SDKShapeTraits bool `type:"structure"`
}
//
// Tests begin here
//
func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
svc := NewOutputService1ProtocolTest(nil)
buf := bytes.NewReader([]byte("<OperationNameResponse><Str>myname</Str><FooNum>123</FooNum><FalseBool>false</FalseBool><TrueBool>true</TrueBool><Float>1.2</Float><Double>1.3</Double><Long>200</Long><Char>a</Char><RequestId>request-id</RequestId></OperationNameResponse>"))
req, out := svc.OutputService1TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "a", *out.Char)
assert.Equal(t, 1.3, *out.Double)
assert.Equal(t, false, *out.FalseBool)
assert.Equal(t, 1.2, *out.Float)
assert.Equal(t, int64(200), *out.Long)
assert.Equal(t, int64(123), *out.Num)
assert.Equal(t, "myname", *out.Str)
assert.Equal(t, true, *out.TrueBool)
}
func TestOutputService2ProtocolTestBlobCase1(t *testing.T) {
svc := NewOutputService2ProtocolTest(nil)
buf := bytes.NewReader([]byte("<OperationNameResponse><Blob>dmFsdWU=</Blob><RequestId>requestid</RequestId></OperationNameResponse>"))
req, out := svc.OutputService2TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "value", string(out.Blob))
}
func TestOutputService3ProtocolTestListsCase1(t *testing.T) {
svc := NewOutputService3ProtocolTest(nil)
buf := bytes.NewReader([]byte("<OperationNameResponse><ListMember><member>abc</member><member>123</member></ListMember><RequestId>requestid</RequestId></OperationNameResponse>"))
req, out := svc.OutputService3TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "abc", *out.ListMember[0])
assert.Equal(t, "123", *out.ListMember[1])
}
func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
svc := NewOutputService4ProtocolTest(nil)
buf := bytes.NewReader([]byte("<OperationNameResponse><ListMember><item>abc</item><item>123</item></ListMember><RequestId>requestid</RequestId></OperationNameResponse>"))
req, out := svc.OutputService4TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "abc", *out.ListMember[0])
assert.Equal(t, "123", *out.ListMember[1])
}
func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) {
svc := NewOutputService5ProtocolTest(nil)
buf := bytes.NewReader([]byte("<OperationNameResponse><ListMember>abc</ListMember><ListMember>123</ListMember><RequestId>requestid</RequestId></OperationNameResponse>"))
req, out := svc.OutputService5TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "abc", *out.ListMember[0])
assert.Equal(t, "123", *out.ListMember[1])
}
func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) {
svc := NewOutputService6ProtocolTest(nil)
buf := bytes.NewReader([]byte("<OperationNameResponse><Map><entry><key>qux</key><value><foo>bar</foo></value></entry><entry><key>baz</key><value><foo>bam</foo></value></entry></Map><RequestId>requestid</RequestId></OperationNameResponse>"))
req, out := svc.OutputService6TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "bam", *out.Map["baz"].Foo)
assert.Equal(t, "bar", *out.Map["qux"].Foo)
}
func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) {
svc := NewOutputService7ProtocolTest(nil)
buf := bytes.NewReader([]byte("<OperationNameResponse><Map><key>qux</key><value>bar</value></Map><Map><key>baz</key><value>bam</value></Map><RequestId>requestid</RequestId></OperationNameResponse>"))
req, out := svc.OutputService7TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "bam", *out.Map["baz"])
assert.Equal(t, "bar", *out.Map["qux"])
}
func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) {
svc := NewOutputService8ProtocolTest(nil)
buf := bytes.NewReader([]byte("<OperationNameResponse><Map><foo>qux</foo><bar>bar</bar></Map><Map><foo>baz</foo><bar>bam</bar></Map><RequestId>requestid</RequestId></OperationNameResponse>"))
req, out := svc.OutputService8TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "bam", *out.Map["baz"])
assert.Equal(t, "bar", *out.Map["qux"])
}
@@ -1,33 +0,0 @@
// Package query provides serialisation of AWS query requests, and responses.
package query
//go:generate go run ../../fixtures/protocol/generate.go ../../fixtures/protocol/input/query.json build_test.go
import (
"net/url"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/internal/protocol/query/queryutil"
)
// Build builds a request for an AWS Query service.
func Build(r *aws.Request) {
body := url.Values{
"Action": {r.Operation.Name},
"Version": {r.Service.APIVersion},
}
if err := queryutil.Parse(body, r.Params, false); err != nil {
r.Error = awserr.New("SerializationError", "failed encoding Query request", err)
return
}
if r.ExpireTime == 0 {
r.HTTPRequest.Method = "POST"
r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
r.SetBufferBody([]byte(body.Encode()))
} else { // This is a pre-signed request
r.HTTPRequest.Method = "GET"
r.HTTPRequest.URL.RawQuery = body.Encode()
}
}
File diff suppressed because it is too large Load Diff
@@ -1,223 +0,0 @@
package queryutil
import (
"encoding/base64"
"fmt"
"net/url"
"reflect"
"sort"
"strconv"
"strings"
"time"
)
// Parse parses an object i and fills a url.Values object. The isEC2 flag
// indicates if this is the EC2 Query sub-protocol.
func Parse(body url.Values, i interface{}, isEC2 bool) error {
q := queryParser{isEC2: isEC2}
return q.parseValue(body, reflect.ValueOf(i), "", "")
}
func elemOf(value reflect.Value) reflect.Value {
for value.Kind() == reflect.Ptr {
value = value.Elem()
}
return value
}
type queryParser struct {
isEC2 bool
}
func (q *queryParser) parseValue(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
value = elemOf(value)
// no need to handle zero values
if !value.IsValid() {
return nil
}
t := tag.Get("type")
if t == "" {
switch value.Kind() {
case reflect.Struct:
t = "structure"
case reflect.Slice:
t = "list"
case reflect.Map:
t = "map"
}
}
switch t {
case "structure":
return q.parseStruct(v, value, prefix)
case "list":
return q.parseList(v, value, prefix, tag)
case "map":
return q.parseMap(v, value, prefix, tag)
default:
return q.parseScalar(v, value, prefix, tag)
}
}
func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix string) error {
if !value.IsValid() {
return nil
}
t := value.Type()
for i := 0; i < value.NumField(); i++ {
if c := t.Field(i).Name[0:1]; strings.ToLower(c) == c {
continue // ignore unexported fields
}
value := elemOf(value.Field(i))
field := t.Field(i)
var name string
if q.isEC2 {
name = field.Tag.Get("queryName")
}
if name == "" {
if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" {
name = field.Tag.Get("locationNameList")
} else if locName := field.Tag.Get("locationName"); locName != "" {
name = locName
}
if name != "" && q.isEC2 {
name = strings.ToUpper(name[0:1]) + name[1:]
}
}
if name == "" {
name = field.Name
}
if prefix != "" {
name = prefix + "." + name
}
if err := q.parseValue(v, value, name, field.Tag); err != nil {
return err
}
}
return nil
}
func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
// If it's empty, generate an empty value
if !value.IsNil() && value.Len() == 0 {
v.Set(prefix, "")
return nil
}
// check for unflattened list member
if !q.isEC2 && tag.Get("flattened") == "" {
prefix += ".member"
}
for i := 0; i < value.Len(); i++ {
slicePrefix := prefix
if slicePrefix == "" {
slicePrefix = strconv.Itoa(i + 1)
} else {
slicePrefix = slicePrefix + "." + strconv.Itoa(i+1)
}
if err := q.parseValue(v, value.Index(i), slicePrefix, ""); err != nil {
return err
}
}
return nil
}
func (q *queryParser) parseMap(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
// If it's empty, generate an empty value
if !value.IsNil() && value.Len() == 0 {
v.Set(prefix, "")
return nil
}
// check for unflattened list member
if !q.isEC2 && tag.Get("flattened") == "" {
prefix += ".entry"
}
// sort keys for improved serialization consistency.
// this is not strictly necessary for protocol support.
mapKeyValues := value.MapKeys()
mapKeys := map[string]reflect.Value{}
mapKeyNames := make([]string, len(mapKeyValues))
for i, mapKey := range mapKeyValues {
name := mapKey.String()
mapKeys[name] = mapKey
mapKeyNames[i] = name
}
sort.Strings(mapKeyNames)
for i, mapKeyName := range mapKeyNames {
mapKey := mapKeys[mapKeyName]
mapValue := value.MapIndex(mapKey)
kname := tag.Get("locationNameKey")
if kname == "" {
kname = "key"
}
vname := tag.Get("locationNameValue")
if vname == "" {
vname = "value"
}
// serialize key
var keyName string
if prefix == "" {
keyName = strconv.Itoa(i+1) + "." + kname
} else {
keyName = prefix + "." + strconv.Itoa(i+1) + "." + kname
}
if err := q.parseValue(v, mapKey, keyName, ""); err != nil {
return err
}
// serialize value
var valueName string
if prefix == "" {
valueName = strconv.Itoa(i+1) + "." + vname
} else {
valueName = prefix + "." + strconv.Itoa(i+1) + "." + vname
}
if err := q.parseValue(v, mapValue, valueName, ""); err != nil {
return err
}
}
return nil
}
func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, tag reflect.StructTag) error {
switch value := r.Interface().(type) {
case string:
v.Set(name, value)
case []byte:
if !r.IsNil() {
v.Set(name, base64.StdEncoding.EncodeToString(value))
}
case bool:
v.Set(name, strconv.FormatBool(value))
case int64:
v.Set(name, strconv.FormatInt(value, 10))
case int:
v.Set(name, strconv.Itoa(value))
case float64:
v.Set(name, strconv.FormatFloat(value, 'f', -1, 64))
case float32:
v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32))
case time.Time:
const ISO8601UTC = "2006-01-02T15:04:05Z"
v.Set(name, value.UTC().Format(ISO8601UTC))
default:
return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name())
}
return nil
}
@@ -1,29 +0,0 @@
package query
//go:generate go run ../../fixtures/protocol/generate.go ../../fixtures/protocol/output/query.json unmarshal_test.go
import (
"encoding/xml"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil"
)
// Unmarshal unmarshals a response for an AWS Query service.
func Unmarshal(r *aws.Request) {
defer r.HTTPResponse.Body.Close()
if r.DataFilled() {
decoder := xml.NewDecoder(r.HTTPResponse.Body)
err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result")
if err != nil {
r.Error = awserr.New("SerializationError", "failed decoding Query response", err)
return
}
}
}
// UnmarshalMeta unmarshals header response values for an AWS Query service.
func UnmarshalMeta(r *aws.Request) {
// TODO implement unmarshaling of request IDs
}
@@ -1,33 +0,0 @@
package query
import (
"encoding/xml"
"io"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
)
type xmlErrorResponse struct {
XMLName xml.Name `xml:"ErrorResponse"`
Code string `xml:"Error>Code"`
Message string `xml:"Error>Message"`
RequestID string `xml:"RequestId"`
}
// UnmarshalError unmarshals an error response for an AWS Query service.
func UnmarshalError(r *aws.Request) {
defer r.HTTPResponse.Body.Close()
resp := &xmlErrorResponse{}
err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp)
if err != nil && err != io.EOF {
r.Error = awserr.New("SerializationError", "failed to decode query XML error response", err)
} else {
r.Error = awserr.NewRequestFailure(
awserr.New(resp.Code, resp.Message, nil),
r.HTTPResponse.StatusCode,
resp.RequestID,
)
}
}
File diff suppressed because it is too large Load Diff
@@ -1,217 +0,0 @@
// Package rest provides RESTful serialisation of AWS requests and responses.
package rest
import (
"bytes"
"encoding/base64"
"fmt"
"io"
"net/url"
"path"
"reflect"
"strconv"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
)
// RFC822 returns an RFC822 formatted timestamp for AWS protocols
const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT"
// Whether the byte value can be sent without escaping in AWS URLs
var noEscape [256]bool
func init() {
for i := 0; i < len(noEscape); i++ {
// AWS expects every character except these to be escaped
noEscape[i] = (i >= 'A' && i <= 'Z') ||
(i >= 'a' && i <= 'z') ||
(i >= '0' && i <= '9') ||
i == '-' ||
i == '.' ||
i == '_' ||
i == '~'
}
}
// Build builds the REST component of a service request.
func Build(r *aws.Request) {
if r.ParamsFilled() {
v := reflect.ValueOf(r.Params).Elem()
buildLocationElements(r, v)
buildBody(r, v)
}
}
func buildLocationElements(r *aws.Request, v reflect.Value) {
query := r.HTTPRequest.URL.Query()
for i := 0; i < v.NumField(); i++ {
m := v.Field(i)
if n := v.Type().Field(i).Name; n[0:1] == strings.ToLower(n[0:1]) {
continue
}
if m.IsValid() {
field := v.Type().Field(i)
name := field.Tag.Get("locationName")
if name == "" {
name = field.Name
}
if m.Kind() == reflect.Ptr {
m = m.Elem()
}
if !m.IsValid() {
continue
}
switch field.Tag.Get("location") {
case "headers": // header maps
buildHeaderMap(r, m, field.Tag.Get("locationName"))
case "header":
buildHeader(r, m, name)
case "uri":
buildURI(r, m, name)
case "querystring":
buildQueryString(r, m, name, query)
}
}
if r.Error != nil {
return
}
}
r.HTTPRequest.URL.RawQuery = query.Encode()
updatePath(r.HTTPRequest.URL, r.HTTPRequest.URL.Path)
}
func buildBody(r *aws.Request, v reflect.Value) {
if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok {
if payloadName := field.Tag.Get("payload"); payloadName != "" {
pfield, _ := v.Type().FieldByName(payloadName)
if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" {
payload := reflect.Indirect(v.FieldByName(payloadName))
if payload.IsValid() && payload.Interface() != nil {
switch reader := payload.Interface().(type) {
case io.ReadSeeker:
r.SetReaderBody(reader)
case []byte:
r.SetBufferBody(reader)
case string:
r.SetStringBody(reader)
default:
r.Error = awserr.New("SerializationError",
"failed to encode REST request",
fmt.Errorf("unknown payload type %s", payload.Type()))
}
}
}
}
}
}
func buildHeader(r *aws.Request, v reflect.Value, name string) {
str, err := convertType(v)
if err != nil {
r.Error = awserr.New("SerializationError", "failed to encode REST request", err)
} else if str != nil {
r.HTTPRequest.Header.Add(name, *str)
}
}
func buildHeaderMap(r *aws.Request, v reflect.Value, prefix string) {
for _, key := range v.MapKeys() {
str, err := convertType(v.MapIndex(key))
if err != nil {
r.Error = awserr.New("SerializationError", "failed to encode REST request", err)
} else if str != nil {
r.HTTPRequest.Header.Add(prefix+key.String(), *str)
}
}
}
func buildURI(r *aws.Request, v reflect.Value, name string) {
value, err := convertType(v)
if err != nil {
r.Error = awserr.New("SerializationError", "failed to encode REST request", err)
} else if value != nil {
uri := r.HTTPRequest.URL.Path
uri = strings.Replace(uri, "{"+name+"}", EscapePath(*value, true), -1)
uri = strings.Replace(uri, "{"+name+"+}", EscapePath(*value, false), -1)
r.HTTPRequest.URL.Path = uri
}
}
func buildQueryString(r *aws.Request, v reflect.Value, name string, query url.Values) {
str, err := convertType(v)
if err != nil {
r.Error = awserr.New("SerializationError", "failed to encode REST request", err)
} else if str != nil {
query.Set(name, *str)
}
}
func updatePath(url *url.URL, urlPath string) {
scheme, query := url.Scheme, url.RawQuery
hasSlash := strings.HasSuffix(urlPath, "/")
// clean up path
urlPath = path.Clean(urlPath)
if hasSlash && !strings.HasSuffix(urlPath, "/") {
urlPath += "/"
}
// get formatted URL minus scheme so we can build this into Opaque
url.Scheme, url.Path, url.RawQuery = "", "", ""
s := url.String()
url.Scheme = scheme
url.RawQuery = query
// build opaque URI
url.Opaque = s + urlPath
}
// EscapePath escapes part of a URL path in Amazon style
func EscapePath(path string, encodeSep bool) string {
var buf bytes.Buffer
for i := 0; i < len(path); i++ {
c := path[i]
if noEscape[c] || (c == '/' && !encodeSep) {
buf.WriteByte(c)
} else {
buf.WriteByte('%')
buf.WriteString(strings.ToUpper(strconv.FormatUint(uint64(c), 16)))
}
}
return buf.String()
}
func convertType(v reflect.Value) (*string, error) {
v = reflect.Indirect(v)
if !v.IsValid() {
return nil, nil
}
var str string
switch value := v.Interface().(type) {
case string:
str = value
case []byte:
str = base64.StdEncoding.EncodeToString(value)
case bool:
str = strconv.FormatBool(value)
case int64:
str = strconv.FormatInt(value, 10)
case float64:
str = strconv.FormatFloat(value, 'f', -1, 64)
case time.Time:
str = value.UTC().Format(RFC822)
default:
err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type())
return nil, err
}
return &str, nil
}
@@ -1,174 +0,0 @@
package rest
import (
"encoding/base64"
"fmt"
"io/ioutil"
"net/http"
"reflect"
"strconv"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
)
// Unmarshal unmarshals the REST component of a response in a REST service.
func Unmarshal(r *aws.Request) {
if r.DataFilled() {
v := reflect.Indirect(reflect.ValueOf(r.Data))
unmarshalBody(r, v)
unmarshalLocationElements(r, v)
}
}
func unmarshalBody(r *aws.Request, v reflect.Value) {
if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok {
if payloadName := field.Tag.Get("payload"); payloadName != "" {
pfield, _ := v.Type().FieldByName(payloadName)
if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" {
payload := v.FieldByName(payloadName)
if payload.IsValid() {
switch payload.Interface().(type) {
case []byte:
b, err := ioutil.ReadAll(r.HTTPResponse.Body)
if err != nil {
r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
} else {
payload.Set(reflect.ValueOf(b))
}
case *string:
b, err := ioutil.ReadAll(r.HTTPResponse.Body)
if err != nil {
r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
} else {
str := string(b)
payload.Set(reflect.ValueOf(&str))
}
default:
switch payload.Type().String() {
case "io.ReadSeeker":
payload.Set(reflect.ValueOf(aws.ReadSeekCloser(r.HTTPResponse.Body)))
case "aws.ReadSeekCloser", "io.ReadCloser":
payload.Set(reflect.ValueOf(r.HTTPResponse.Body))
default:
r.Error = awserr.New("SerializationError",
"failed to decode REST response",
fmt.Errorf("unknown payload type %s", payload.Type()))
}
}
}
}
}
}
}
func unmarshalLocationElements(r *aws.Request, v reflect.Value) {
for i := 0; i < v.NumField(); i++ {
m, field := v.Field(i), v.Type().Field(i)
if n := field.Name; n[0:1] == strings.ToLower(n[0:1]) {
continue
}
if m.IsValid() {
name := field.Tag.Get("locationName")
if name == "" {
name = field.Name
}
switch field.Tag.Get("location") {
case "statusCode":
unmarshalStatusCode(m, r.HTTPResponse.StatusCode)
case "header":
err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name))
if err != nil {
r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
break
}
case "headers":
prefix := field.Tag.Get("locationName")
err := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix)
if err != nil {
r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
break
}
}
}
if r.Error != nil {
return
}
}
}
func unmarshalStatusCode(v reflect.Value, statusCode int) {
if !v.IsValid() {
return
}
switch v.Interface().(type) {
case *int64:
s := int64(statusCode)
v.Set(reflect.ValueOf(&s))
}
}
func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error {
switch r.Interface().(type) {
case map[string]*string: // we only support string map value types
out := map[string]*string{}
for k, v := range headers {
k = http.CanonicalHeaderKey(k)
if strings.HasPrefix(strings.ToLower(k), strings.ToLower(prefix)) {
out[k[len(prefix):]] = &v[0]
}
}
r.Set(reflect.ValueOf(out))
}
return nil
}
func unmarshalHeader(v reflect.Value, header string) error {
if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) {
return nil
}
switch v.Interface().(type) {
case *string:
v.Set(reflect.ValueOf(&header))
case []byte:
b, err := base64.StdEncoding.DecodeString(header)
if err != nil {
return err
}
v.Set(reflect.ValueOf(&b))
case *bool:
b, err := strconv.ParseBool(header)
if err != nil {
return err
}
v.Set(reflect.ValueOf(&b))
case *int64:
i, err := strconv.ParseInt(header, 10, 64)
if err != nil {
return err
}
v.Set(reflect.ValueOf(&i))
case *float64:
f, err := strconv.ParseFloat(header, 64)
if err != nil {
return err
}
v.Set(reflect.ValueOf(&f))
case *time.Time:
t, err := time.Parse(RFC822, header)
if err != nil {
return err
}
v.Set(reflect.ValueOf(&t))
default:
err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type())
return err
}
return nil
}
@@ -1,287 +0,0 @@
// Package xmlutil provides XML serialisation of AWS requests and responses.
package xmlutil
import (
"encoding/base64"
"encoding/xml"
"fmt"
"reflect"
"sort"
"strconv"
"strings"
"time"
)
// BuildXML will serialize params into an xml.Encoder.
// Error will be returned if the serialization of any of the params or nested values fails.
func BuildXML(params interface{}, e *xml.Encoder) error {
b := xmlBuilder{encoder: e, namespaces: map[string]string{}}
root := NewXMLElement(xml.Name{})
if err := b.buildValue(reflect.ValueOf(params), root, ""); err != nil {
return err
}
for _, c := range root.Children {
for _, v := range c {
return StructToXML(e, v, false)
}
}
return nil
}
// Returns the reflection element of a value, if it is a pointer.
func elemOf(value reflect.Value) reflect.Value {
for value.Kind() == reflect.Ptr {
value = value.Elem()
}
return value
}
// A xmlBuilder serializes values from Go code to XML
type xmlBuilder struct {
encoder *xml.Encoder
namespaces map[string]string
}
// buildValue generic XMLNode builder for any type. Will build value for their specific type
// struct, list, map, scalar.
//
// Also takes a "type" tag value to set what type a value should be converted to XMLNode as. If
// type is not provided reflect will be used to determine the value's type.
func (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
value = elemOf(value)
if !value.IsValid() { // no need to handle zero values
return nil
} else if tag.Get("location") != "" { // don't handle non-body location values
return nil
}
t := tag.Get("type")
if t == "" {
switch value.Kind() {
case reflect.Struct:
t = "structure"
case reflect.Slice:
t = "list"
case reflect.Map:
t = "map"
}
}
switch t {
case "structure":
if field, ok := value.Type().FieldByName("SDKShapeTraits"); ok {
tag = tag + reflect.StructTag(" ") + field.Tag
}
return b.buildStruct(value, current, tag)
case "list":
return b.buildList(value, current, tag)
case "map":
return b.buildMap(value, current, tag)
default:
return b.buildScalar(value, current, tag)
}
}
// buildStruct adds a struct and its fields to the current XMLNode. All fields any any nested
// types are converted to XMLNodes also.
func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
if !value.IsValid() {
return nil
}
fieldAdded := false
// unwrap payloads
if payload := tag.Get("payload"); payload != "" {
field, _ := value.Type().FieldByName(payload)
tag = field.Tag
value = elemOf(value.FieldByName(payload))
if !value.IsValid() {
return nil
}
}
child := NewXMLElement(xml.Name{Local: tag.Get("locationName")})
// there is an xmlNamespace associated with this struct
if prefix, uri := tag.Get("xmlPrefix"), tag.Get("xmlURI"); uri != "" {
ns := xml.Attr{
Name: xml.Name{Local: "xmlns"},
Value: uri,
}
if prefix != "" {
b.namespaces[prefix] = uri // register the namespace
ns.Name.Local = "xmlns:" + prefix
}
child.Attr = append(child.Attr, ns)
}
t := value.Type()
for i := 0; i < value.NumField(); i++ {
if c := t.Field(i).Name[0:1]; strings.ToLower(c) == c {
continue // ignore unexported fields
}
member := elemOf(value.Field(i))
field := t.Field(i)
mTag := field.Tag
if mTag.Get("location") != "" { // skip non-body members
continue
}
memberName := mTag.Get("locationName")
if memberName == "" {
memberName = field.Name
mTag = reflect.StructTag(string(mTag) + ` locationName:"` + memberName + `"`)
}
if err := b.buildValue(member, child, mTag); err != nil {
return err
}
fieldAdded = true
}
if fieldAdded { // only append this child if we have one ore more valid members
current.AddChild(child)
}
return nil
}
// buildList adds the value's list items to the current XMLNode as children nodes. All
// nested values in the list are converted to XMLNodes also.
func (b *xmlBuilder) buildList(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
if value.IsNil() { // don't build omitted lists
return nil
}
// check for unflattened list member
flattened := tag.Get("flattened") != ""
xname := xml.Name{Local: tag.Get("locationName")}
if flattened {
for i := 0; i < value.Len(); i++ {
child := NewXMLElement(xname)
current.AddChild(child)
if err := b.buildValue(value.Index(i), child, ""); err != nil {
return err
}
}
} else {
list := NewXMLElement(xname)
current.AddChild(list)
for i := 0; i < value.Len(); i++ {
iname := tag.Get("locationNameList")
if iname == "" {
iname = "member"
}
child := NewXMLElement(xml.Name{Local: iname})
list.AddChild(child)
if err := b.buildValue(value.Index(i), child, ""); err != nil {
return err
}
}
}
return nil
}
// buildMap adds the value's key/value pairs to the current XMLNode as children nodes. All
// nested values in the map are converted to XMLNodes also.
//
// Error will be returned if it is unable to build the map's values into XMLNodes
func (b *xmlBuilder) buildMap(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
if value.IsNil() { // don't build omitted maps
return nil
}
maproot := NewXMLElement(xml.Name{Local: tag.Get("locationName")})
current.AddChild(maproot)
current = maproot
kname, vname := "key", "value"
if n := tag.Get("locationNameKey"); n != "" {
kname = n
}
if n := tag.Get("locationNameValue"); n != "" {
vname = n
}
// sorting is not required for compliance, but it makes testing easier
keys := make([]string, value.Len())
for i, k := range value.MapKeys() {
keys[i] = k.String()
}
sort.Strings(keys)
for _, k := range keys {
v := value.MapIndex(reflect.ValueOf(k))
mapcur := current
if tag.Get("flattened") == "" { // add "entry" tag to non-flat maps
child := NewXMLElement(xml.Name{Local: "entry"})
mapcur.AddChild(child)
mapcur = child
}
kchild := NewXMLElement(xml.Name{Local: kname})
kchild.Text = k
vchild := NewXMLElement(xml.Name{Local: vname})
mapcur.AddChild(kchild)
mapcur.AddChild(vchild)
if err := b.buildValue(v, vchild, ""); err != nil {
return err
}
}
return nil
}
// buildScalar will convert the value into a string and append it as a attribute or child
// of the current XMLNode.
//
// The value will be added as an attribute if tag contains a "xmlAttribute" attribute value.
//
// Error will be returned if the value type is unsupported.
func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
var str string
switch converted := value.Interface().(type) {
case string:
str = converted
case []byte:
if !value.IsNil() {
str = base64.StdEncoding.EncodeToString(converted)
}
case bool:
str = strconv.FormatBool(converted)
case int64:
str = strconv.FormatInt(converted, 10)
case int:
str = strconv.Itoa(converted)
case float64:
str = strconv.FormatFloat(converted, 'f', -1, 64)
case float32:
str = strconv.FormatFloat(float64(converted), 'f', -1, 32)
case time.Time:
const ISO8601UTC = "2006-01-02T15:04:05Z"
str = converted.UTC().Format(ISO8601UTC)
default:
return fmt.Errorf("unsupported value for param %s: %v (%s)",
tag.Get("locationName"), value.Interface(), value.Type().Name())
}
xname := xml.Name{Local: tag.Get("locationName")}
if tag.Get("xmlAttribute") != "" { // put into current node's attribute list
attr := xml.Attr{Name: xname, Value: str}
current.Attr = append(current.Attr, attr)
} else { // regular text node
current.AddChild(&XMLNode{Name: xname, Text: str})
}
return nil
}
@@ -1,105 +0,0 @@
package xmlutil
import (
"encoding/xml"
"io"
"sort"
)
// A XMLNode contains the values to be encoded or decoded.
type XMLNode struct {
Name xml.Name `json:",omitempty"`
Children map[string][]*XMLNode `json:",omitempty"`
Text string `json:",omitempty"`
Attr []xml.Attr `json:",omitempty"`
}
// NewXMLElement returns a pointer to a new XMLNode initialized to default values.
func NewXMLElement(name xml.Name) *XMLNode {
return &XMLNode{
Name: name,
Children: map[string][]*XMLNode{},
Attr: []xml.Attr{},
}
}
// AddChild adds child to the XMLNode.
func (n *XMLNode) AddChild(child *XMLNode) {
if _, ok := n.Children[child.Name.Local]; !ok {
n.Children[child.Name.Local] = []*XMLNode{}
}
n.Children[child.Name.Local] = append(n.Children[child.Name.Local], child)
}
// XMLToStruct converts a xml.Decoder stream to XMLNode with nested values.
func XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error) {
out := &XMLNode{}
for {
tok, err := d.Token()
if tok == nil || err == io.EOF {
break
}
if err != nil {
return out, err
}
switch typed := tok.(type) {
case xml.CharData:
out.Text = string(typed.Copy())
case xml.StartElement:
el := typed.Copy()
out.Attr = el.Attr
if out.Children == nil {
out.Children = map[string][]*XMLNode{}
}
name := typed.Name.Local
slice := out.Children[name]
if slice == nil {
slice = []*XMLNode{}
}
node, e := XMLToStruct(d, &el)
if e != nil {
return out, e
}
node.Name = typed.Name
slice = append(slice, node)
out.Children[name] = slice
case xml.EndElement:
if s != nil && s.Name.Local == typed.Name.Local { // matching end token
return out, nil
}
}
}
return out, nil
}
// StructToXML writes an XMLNode to a xml.Encoder as tokens.
func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error {
e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr})
if node.Text != "" {
e.EncodeToken(xml.CharData([]byte(node.Text)))
} else if sorted {
sortedNames := []string{}
for k := range node.Children {
sortedNames = append(sortedNames, k)
}
sort.Strings(sortedNames)
for _, k := range sortedNames {
for _, v := range node.Children[k] {
StructToXML(e, v, sorted)
}
}
} else {
for _, c := range node.Children {
for _, v := range c {
StructToXML(e, v, sorted)
}
}
}
e.EncodeToken(xml.EndElement{Name: node.Name})
return e.Flush()
}
@@ -1,43 +0,0 @@
package v4_test
import (
"net/url"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/internal/test/unit"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/stretchr/testify/assert"
)
var _ = unit.Imported
func TestPresignHandler(t *testing.T) {
svc := s3.New(nil)
req, _ := svc.PutObjectRequest(&s3.PutObjectInput{
Bucket: aws.String("bucket"),
Key: aws.String("key"),
ContentDisposition: aws.String("a+b c$d"),
ACL: aws.String("public-read"),
})
req.Time = time.Unix(0, 0)
urlstr, err := req.Presign(5 * time.Minute)
assert.NoError(t, err)
expectedDate := "19700101T000000Z"
expectedHeaders := "host;x-amz-acl"
expectedSig := "7edcb4e3a1bf12f4989018d75acbe3a7f03df24bd6f3112602d59fc551f0e4e2"
expectedCred := "AKID/19700101/mock-region/s3/aws4_request"
u, _ := url.Parse(urlstr)
urlQ := u.Query()
assert.Equal(t, expectedSig, urlQ.Get("X-Amz-Signature"))
assert.Equal(t, expectedCred, urlQ.Get("X-Amz-Credential"))
assert.Equal(t, expectedHeaders, urlQ.Get("X-Amz-SignedHeaders"))
assert.Equal(t, expectedDate, urlQ.Get("X-Amz-Date"))
assert.Equal(t, "300", urlQ.Get("X-Amz-Expires"))
assert.NotContains(t, urlstr, "+") // + encoded as %20
}
@@ -1,364 +0,0 @@
// Package v4 implements signing for AWS V4 signer
package v4
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"net/http"
"net/url"
"sort"
"strconv"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/internal/protocol/rest"
)
const (
authHeaderPrefix = "AWS4-HMAC-SHA256"
timeFormat = "20060102T150405Z"
shortTimeFormat = "20060102"
)
var ignoredHeaders = map[string]bool{
"Authorization": true,
"Content-Type": true,
"Content-Length": true,
"User-Agent": true,
}
type signer struct {
Request *http.Request
Time time.Time
ExpireTime time.Duration
ServiceName string
Region string
CredValues credentials.Value
Credentials *credentials.Credentials
Query url.Values
Body io.ReadSeeker
Debug aws.LogLevelType
Logger aws.Logger
isPresign bool
formattedTime string
formattedShortTime string
signedHeaders string
canonicalHeaders string
canonicalString string
credentialString string
stringToSign string
signature string
authorization string
}
// Sign requests with signature version 4.
//
// Will sign the requests with the service config's Credentials object
// Signing is skipped if the credentials is the credentials.AnonymousCredentials
// object.
func Sign(req *aws.Request) {
// If the request does not need to be signed ignore the signing of the
// request if the AnonymousCredentials object is used.
if req.Service.Config.Credentials == credentials.AnonymousCredentials {
return
}
region := req.Service.SigningRegion
if region == "" {
region = aws.StringValue(req.Service.Config.Region)
}
name := req.Service.SigningName
if name == "" {
name = req.Service.ServiceName
}
s := signer{
Request: req.HTTPRequest,
Time: req.Time,
ExpireTime: req.ExpireTime,
Query: req.HTTPRequest.URL.Query(),
Body: req.Body,
ServiceName: name,
Region: region,
Credentials: req.Service.Config.Credentials,
Debug: req.Service.Config.LogLevel.Value(),
Logger: req.Service.Config.Logger,
}
req.Error = s.sign()
}
func (v4 *signer) sign() error {
if v4.ExpireTime != 0 {
v4.isPresign = true
}
if v4.isRequestSigned() {
if !v4.Credentials.IsExpired() {
// If the request is already signed, and the credentials have not
// expired yet ignore the signing request.
return nil
}
// The credentials have expired for this request. The current signing
// is invalid, and needs to be request because the request will fail.
if v4.isPresign {
v4.removePresign()
// Update the request's query string to ensure the values stays in
// sync in the case retrieving the new credentials fails.
v4.Request.URL.RawQuery = v4.Query.Encode()
}
}
var err error
v4.CredValues, err = v4.Credentials.Get()
if err != nil {
return err
}
if v4.isPresign {
v4.Query.Set("X-Amz-Algorithm", authHeaderPrefix)
if v4.CredValues.SessionToken != "" {
v4.Query.Set("X-Amz-Security-Token", v4.CredValues.SessionToken)
} else {
v4.Query.Del("X-Amz-Security-Token")
}
} else if v4.CredValues.SessionToken != "" {
v4.Request.Header.Set("X-Amz-Security-Token", v4.CredValues.SessionToken)
}
v4.build()
if v4.Debug.Matches(aws.LogDebugWithSigning) {
v4.logSigningInfo()
}
return nil
}
const logSignInfoMsg = `DEBUG: Request Signiture:
---[ CANONICAL STRING ]-----------------------------
%s
---[ STRING TO SIGN ]--------------------------------
%s%s
-----------------------------------------------------`
const logSignedURLMsg = `
---[ SIGNED URL ]------------------------------------
%s`
func (v4 *signer) logSigningInfo() {
signedURLMsg := ""
if v4.isPresign {
signedURLMsg = fmt.Sprintf(logSignedURLMsg, v4.Request.URL.String())
}
msg := fmt.Sprintf(logSignInfoMsg, v4.canonicalString, v4.stringToSign, signedURLMsg)
v4.Logger.Log(msg)
}
func (v4 *signer) build() {
v4.buildTime() // no depends
v4.buildCredentialString() // no depends
if v4.isPresign {
v4.buildQuery() // no depends
}
v4.buildCanonicalHeaders() // depends on cred string
v4.buildCanonicalString() // depends on canon headers / signed headers
v4.buildStringToSign() // depends on canon string
v4.buildSignature() // depends on string to sign
if v4.isPresign {
v4.Request.URL.RawQuery += "&X-Amz-Signature=" + v4.signature
} else {
parts := []string{
authHeaderPrefix + " Credential=" + v4.CredValues.AccessKeyID + "/" + v4.credentialString,
"SignedHeaders=" + v4.signedHeaders,
"Signature=" + v4.signature,
}
v4.Request.Header.Set("Authorization", strings.Join(parts, ", "))
}
}
func (v4 *signer) buildTime() {
v4.formattedTime = v4.Time.UTC().Format(timeFormat)
v4.formattedShortTime = v4.Time.UTC().Format(shortTimeFormat)
if v4.isPresign {
duration := int64(v4.ExpireTime / time.Second)
v4.Query.Set("X-Amz-Date", v4.formattedTime)
v4.Query.Set("X-Amz-Expires", strconv.FormatInt(duration, 10))
} else {
v4.Request.Header.Set("X-Amz-Date", v4.formattedTime)
}
}
func (v4 *signer) buildCredentialString() {
v4.credentialString = strings.Join([]string{
v4.formattedShortTime,
v4.Region,
v4.ServiceName,
"aws4_request",
}, "/")
if v4.isPresign {
v4.Query.Set("X-Amz-Credential", v4.CredValues.AccessKeyID+"/"+v4.credentialString)
}
}
func (v4 *signer) buildQuery() {
for k, h := range v4.Request.Header {
if strings.HasPrefix(http.CanonicalHeaderKey(k), "X-Amz-") {
continue // never hoist x-amz-* headers, they must be signed
}
if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok {
continue // never hoist ignored headers
}
v4.Request.Header.Del(k)
v4.Query.Del(k)
for _, v := range h {
v4.Query.Add(k, v)
}
}
}
func (v4 *signer) buildCanonicalHeaders() {
var headers []string
headers = append(headers, "host")
for k := range v4.Request.Header {
if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok {
continue // ignored header
}
headers = append(headers, strings.ToLower(k))
}
sort.Strings(headers)
v4.signedHeaders = strings.Join(headers, ";")
if v4.isPresign {
v4.Query.Set("X-Amz-SignedHeaders", v4.signedHeaders)
}
headerValues := make([]string, len(headers))
for i, k := range headers {
if k == "host" {
headerValues[i] = "host:" + v4.Request.URL.Host
} else {
headerValues[i] = k + ":" +
strings.Join(v4.Request.Header[http.CanonicalHeaderKey(k)], ",")
}
}
v4.canonicalHeaders = strings.Join(headerValues, "\n")
}
func (v4 *signer) buildCanonicalString() {
v4.Request.URL.RawQuery = strings.Replace(v4.Query.Encode(), "+", "%20", -1)
uri := v4.Request.URL.Opaque
if uri != "" {
uri = "/" + strings.Join(strings.Split(uri, "/")[3:], "/")
} else {
uri = v4.Request.URL.Path
}
if uri == "" {
uri = "/"
}
if v4.ServiceName != "s3" {
uri = rest.EscapePath(uri, false)
}
v4.canonicalString = strings.Join([]string{
v4.Request.Method,
uri,
v4.Request.URL.RawQuery,
v4.canonicalHeaders + "\n",
v4.signedHeaders,
v4.bodyDigest(),
}, "\n")
}
func (v4 *signer) buildStringToSign() {
v4.stringToSign = strings.Join([]string{
authHeaderPrefix,
v4.formattedTime,
v4.credentialString,
hex.EncodeToString(makeSha256([]byte(v4.canonicalString))),
}, "\n")
}
func (v4 *signer) buildSignature() {
secret := v4.CredValues.SecretAccessKey
date := makeHmac([]byte("AWS4"+secret), []byte(v4.formattedShortTime))
region := makeHmac(date, []byte(v4.Region))
service := makeHmac(region, []byte(v4.ServiceName))
credentials := makeHmac(service, []byte("aws4_request"))
signature := makeHmac(credentials, []byte(v4.stringToSign))
v4.signature = hex.EncodeToString(signature)
}
func (v4 *signer) bodyDigest() string {
hash := v4.Request.Header.Get("X-Amz-Content-Sha256")
if hash == "" {
if v4.isPresign && v4.ServiceName == "s3" {
hash = "UNSIGNED-PAYLOAD"
} else if v4.Body == nil {
hash = hex.EncodeToString(makeSha256([]byte{}))
} else {
hash = hex.EncodeToString(makeSha256Reader(v4.Body))
}
v4.Request.Header.Add("X-Amz-Content-Sha256", hash)
}
return hash
}
// isRequestSigned returns if the request is currently signed or presigned
func (v4 *signer) isRequestSigned() bool {
if v4.isPresign && v4.Query.Get("X-Amz-Signature") != "" {
return true
}
if v4.Request.Header.Get("Authorization") != "" {
return true
}
return false
}
// unsign removes signing flags for both signed and presigned requests.
func (v4 *signer) removePresign() {
v4.Query.Del("X-Amz-Algorithm")
v4.Query.Del("X-Amz-Signature")
v4.Query.Del("X-Amz-Security-Token")
v4.Query.Del("X-Amz-Date")
v4.Query.Del("X-Amz-Expires")
v4.Query.Del("X-Amz-Credential")
v4.Query.Del("X-Amz-SignedHeaders")
}
func makeHmac(key []byte, data []byte) []byte {
hash := hmac.New(sha256.New, key)
hash.Write(data)
return hash.Sum(nil)
}
func makeSha256(data []byte) []byte {
hash := sha256.New()
hash.Write(data)
return hash.Sum(nil)
}
func makeSha256Reader(reader io.ReadSeeker) []byte {
hash := sha256.New()
start, _ := reader.Seek(0, 1)
defer reader.Seek(start, 0)
io.Copy(hash, reader)
return hash.Sum(nil)
}
@@ -1,245 +0,0 @@
package v4
import (
"net/http"
"strings"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/stretchr/testify/assert"
)
func buildSigner(serviceName string, region string, signTime time.Time, expireTime time.Duration, body string) signer {
endpoint := "https://" + serviceName + "." + region + ".amazonaws.com"
reader := strings.NewReader(body)
req, _ := http.NewRequest("POST", endpoint, reader)
req.URL.Opaque = "//example.org/bucket/key-._~,!@#$%^&*()"
req.Header.Add("X-Amz-Target", "prefix.Operation")
req.Header.Add("Content-Type", "application/x-amz-json-1.0")
req.Header.Add("Content-Length", string(len(body)))
req.Header.Add("X-Amz-Meta-Other-Header", "some-value=!@#$%^&* (+)")
return signer{
Request: req,
Time: signTime,
ExpireTime: expireTime,
Query: req.URL.Query(),
Body: reader,
ServiceName: serviceName,
Region: region,
Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"),
}
}
func removeWS(text string) string {
text = strings.Replace(text, " ", "", -1)
text = strings.Replace(text, "\n", "", -1)
text = strings.Replace(text, "\t", "", -1)
return text
}
func assertEqual(t *testing.T, expected, given string) {
if removeWS(expected) != removeWS(given) {
t.Errorf("\nExpected: %s\nGiven: %s", expected, given)
}
}
func TestPresignRequest(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Unix(0, 0), 300*time.Second, "{}")
signer.sign()
expectedDate := "19700101T000000Z"
expectedHeaders := "host;x-amz-meta-other-header;x-amz-target"
expectedSig := "5eeedebf6f995145ce56daa02902d10485246d3defb34f97b973c1f40ab82d36"
expectedCred := "AKID/19700101/us-east-1/dynamodb/aws4_request"
q := signer.Request.URL.Query()
assert.Equal(t, expectedSig, q.Get("X-Amz-Signature"))
assert.Equal(t, expectedCred, q.Get("X-Amz-Credential"))
assert.Equal(t, expectedHeaders, q.Get("X-Amz-SignedHeaders"))
assert.Equal(t, expectedDate, q.Get("X-Amz-Date"))
}
func TestSignRequest(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Unix(0, 0), 0, "{}")
signer.sign()
expectedDate := "19700101T000000Z"
expectedSig := "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/dynamodb/aws4_request, SignedHeaders=host;x-amz-date;x-amz-meta-other-header;x-amz-security-token;x-amz-target, Signature=69ada33fec48180dab153576e4dd80c4e04124f80dda3eccfed8a67c2b91ed5e"
q := signer.Request.Header
assert.Equal(t, expectedSig, q.Get("Authorization"))
assert.Equal(t, expectedDate, q.Get("X-Amz-Date"))
}
func TestSignEmptyBody(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "")
signer.Body = nil
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", hash)
}
func TestSignBody(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "hello")
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash)
}
func TestSignSeekedBody(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, " hello")
signer.Body.Read(make([]byte, 3)) // consume first 3 bytes so body is now "hello"
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash)
start, _ := signer.Body.Seek(0, 1)
assert.Equal(t, int64(3), start)
}
func TestPresignEmptyBodyS3(t *testing.T) {
signer := buildSigner("s3", "us-east-1", time.Now(), 5*time.Minute, "hello")
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "UNSIGNED-PAYLOAD", hash)
}
func TestSignPrecomputedBodyChecksum(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "hello")
signer.Request.Header.Set("X-Amz-Content-Sha256", "PRECOMPUTED")
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "PRECOMPUTED", hash)
}
func TestAnonymousCredentials(t *testing.T) {
r := aws.NewRequest(
aws.NewService(&aws.Config{Credentials: credentials.AnonymousCredentials}),
&aws.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
Sign(r)
urlQ := r.HTTPRequest.URL.Query()
assert.Empty(t, urlQ.Get("X-Amz-Signature"))
assert.Empty(t, urlQ.Get("X-Amz-Credential"))
assert.Empty(t, urlQ.Get("X-Amz-SignedHeaders"))
assert.Empty(t, urlQ.Get("X-Amz-Date"))
hQ := r.HTTPRequest.Header
assert.Empty(t, hQ.Get("Authorization"))
assert.Empty(t, hQ.Get("X-Amz-Date"))
}
func TestIgnoreResignRequestWithValidCreds(t *testing.T) {
r := aws.NewRequest(
aws.NewService(&aws.Config{
Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"),
Region: aws.String("us-west-2"),
}),
&aws.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
Sign(r)
sig := r.HTTPRequest.Header.Get("Authorization")
Sign(r)
assert.Equal(t, sig, r.HTTPRequest.Header.Get("Authorization"))
}
func TestIgnorePreResignRequestWithValidCreds(t *testing.T) {
r := aws.NewRequest(
aws.NewService(&aws.Config{
Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"),
Region: aws.String("us-west-2"),
}),
&aws.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
r.ExpireTime = time.Minute * 10
Sign(r)
sig := r.HTTPRequest.Header.Get("X-Amz-Signature")
Sign(r)
assert.Equal(t, sig, r.HTTPRequest.Header.Get("X-Amz-Signature"))
}
func TestResignRequestExpiredCreds(t *testing.T) {
creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION")
r := aws.NewRequest(
aws.NewService(&aws.Config{Credentials: creds}),
&aws.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
Sign(r)
querySig := r.HTTPRequest.Header.Get("Authorization")
creds.Expire()
Sign(r)
assert.NotEqual(t, querySig, r.HTTPRequest.Header.Get("Authorization"))
}
func TestPreResignRequestExpiredCreds(t *testing.T) {
provider := &credentials.StaticProvider{credentials.Value{"AKID", "SECRET", "SESSION"}}
creds := credentials.NewCredentials(provider)
r := aws.NewRequest(
aws.NewService(&aws.Config{Credentials: creds}),
&aws.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
r.ExpireTime = time.Minute * 10
Sign(r)
querySig := r.HTTPRequest.URL.Query().Get("X-Amz-Signature")
creds.Expire()
r.Time = time.Now().Add(time.Hour * 48)
Sign(r)
assert.NotEqual(t, querySig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature"))
}
func BenchmarkPresignRequest(b *testing.B) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 300*time.Second, "{}")
for i := 0; i < b.N; i++ {
signer.sign()
}
}
func BenchmarkSignRequest(b *testing.B) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "{}")
for i := 0; i < b.N; i++ {
signer.sign()
}
}
@@ -1,65 +0,0 @@
// Package endpoints validates regional endpoints for services.
package endpoints
//go:generate go run ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go
//go:generate gofmt -s -w endpoints_map.go
import (
"fmt"
"regexp"
"strings"
)
// NormalizeEndpoint takes and endpoint and service API information to return a
// normalized endpoint and signing region. If the endpoint is not an empty string
// the service name and region will be used to look up the service's API endpoint.
// If the endpoint is provided the scheme will be added if it is not present.
func NormalizeEndpoint(endpoint, serviceName, region string, disableSSL bool) (normEndpoint, signingRegion string) {
if endpoint == "" {
return EndpointForRegion(serviceName, region, disableSSL)
}
return AddScheme(endpoint, disableSSL), ""
}
// EndpointForRegion returns an endpoint and its signing region for a service and region.
// if the service and region pair are not found endpoint and signingRegion will be empty.
func EndpointForRegion(svcName, region string, disableSSL bool) (endpoint, signingRegion string) {
derivedKeys := []string{
region + "/" + svcName,
region + "/*",
"*/" + svcName,
"*/*",
}
for _, key := range derivedKeys {
if val, ok := endpointsMap.Endpoints[key]; ok {
ep := val.Endpoint
ep = strings.Replace(ep, "{region}", region, -1)
ep = strings.Replace(ep, "{service}", svcName, -1)
endpoint = ep
signingRegion = val.SigningRegion
break
}
}
return AddScheme(endpoint, disableSSL), signingRegion
}
// Regular expression to determine if the endpoint string is prefixed with a scheme.
var schemeRE = regexp.MustCompile("^([^:]+)://")
// AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no
// scheme. If disableSSL is true HTTP will be added instead of the default HTTPS.
func AddScheme(endpoint string, disableSSL bool) string {
if endpoint != "" && !schemeRE.MatchString(endpoint) {
scheme := "https"
if disableSSL {
scheme = "http"
}
endpoint = fmt.Sprintf("%s://%s", scheme, endpoint)
}
return endpoint
}
@@ -1,89 +0,0 @@
{
"version": 2,
"endpoints": {
"*/*": {
"endpoint": "{service}.{region}.amazonaws.com"
},
"cn-north-1/*": {
"endpoint": "{service}.{region}.amazonaws.com.cn",
"signatureVersion": "v4"
},
"us-gov-west-1/iam": {
"endpoint": "iam.us-gov.amazonaws.com"
},
"us-gov-west-1/sts": {
"endpoint": "sts.us-gov-west-1.amazonaws.com"
},
"us-gov-west-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"*/cloudfront": {
"endpoint": "cloudfront.amazonaws.com",
"signingRegion": "us-east-1"
},
"*/cloudsearchdomain": {
"endpoint": "",
"signingRegion": "us-east-1"
},
"*/data.iot": {
"endpoint": "",
"signingRegion": "us-east-1"
},
"*/ec2metadata": {
"endpoint": "http://169.254.169.254/latest",
"signingRegion": "us-east-1"
},
"*/iam": {
"endpoint": "iam.amazonaws.com",
"signingRegion": "us-east-1"
},
"*/importexport": {
"endpoint": "importexport.amazonaws.com",
"signingRegion": "us-east-1"
},
"*/route53": {
"endpoint": "route53.amazonaws.com",
"signingRegion": "us-east-1"
},
"*/sts": {
"endpoint": "sts.amazonaws.com",
"signingRegion": "us-east-1"
},
"*/waf": {
"endpoint": "waf.amazonaws.com",
"signingRegion": "us-east-1"
},
"us-east-1/sdb": {
"endpoint": "sdb.amazonaws.com",
"signingRegion": "us-east-1"
},
"us-east-1/s3": {
"endpoint": "s3.amazonaws.com"
},
"us-west-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"us-west-2/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"eu-west-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"ap-southeast-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"ap-southeast-2/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"ap-northeast-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"sa-east-1/s3": {
"endpoint": "s3-{region}.amazonaws.com"
},
"eu-central-1/s3": {
"endpoint": "{service}.{region}.amazonaws.com",
"signatureVersion": "v4"
}
}
}
@@ -1,101 +0,0 @@
package endpoints
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
type endpointStruct struct {
Version int
Endpoints map[string]endpointEntry
}
type endpointEntry struct {
Endpoint string
SigningRegion string
}
var endpointsMap = endpointStruct{
Version: 2,
Endpoints: map[string]endpointEntry{
"*/*": {
Endpoint: "{service}.{region}.amazonaws.com",
},
"*/cloudfront": {
Endpoint: "cloudfront.amazonaws.com",
SigningRegion: "us-east-1",
},
"*/cloudsearchdomain": {
Endpoint: "",
SigningRegion: "us-east-1",
},
"*/data.iot": {
Endpoint: "",
SigningRegion: "us-east-1",
},
"*/ec2metadata": {
Endpoint: "http://169.254.169.254/latest",
SigningRegion: "us-east-1",
},
"*/iam": {
Endpoint: "iam.amazonaws.com",
SigningRegion: "us-east-1",
},
"*/importexport": {
Endpoint: "importexport.amazonaws.com",
SigningRegion: "us-east-1",
},
"*/route53": {
Endpoint: "route53.amazonaws.com",
SigningRegion: "us-east-1",
},
"*/sts": {
Endpoint: "sts.amazonaws.com",
SigningRegion: "us-east-1",
},
"*/waf": {
Endpoint: "waf.amazonaws.com",
SigningRegion: "us-east-1",
},
"ap-northeast-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"ap-southeast-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"ap-southeast-2/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"cn-north-1/*": {
Endpoint: "{service}.{region}.amazonaws.com.cn",
},
"eu-central-1/s3": {
Endpoint: "{service}.{region}.amazonaws.com",
},
"eu-west-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"sa-east-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"us-east-1/s3": {
Endpoint: "s3.amazonaws.com",
},
"us-east-1/sdb": {
Endpoint: "sdb.amazonaws.com",
SigningRegion: "us-east-1",
},
"us-gov-west-1/iam": {
Endpoint: "iam.us-gov.amazonaws.com",
},
"us-gov-west-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"us-gov-west-1/sts": {
Endpoint: "sts.us-gov-west-1.amazonaws.com",
},
"us-west-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
"us-west-2/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
},
}
@@ -1,41 +0,0 @@
package endpoints_test
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/private/endpoints"
)
func TestGenericEndpoint(t *testing.T) {
name := "service"
region := "mock-region-1"
ep, sr := endpoints.EndpointForRegion(name, region, false)
assert.Equal(t, fmt.Sprintf("https://%s.%s.amazonaws.com", name, region), ep)
assert.Empty(t, sr)
}
func TestGlobalEndpoints(t *testing.T) {
region := "mock-region-1"
svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "waf"}
for _, name := range svcs {
ep, sr := endpoints.EndpointForRegion(name, region, false)
assert.Equal(t, fmt.Sprintf("https://%s.amazonaws.com", name), ep)
assert.Equal(t, "us-east-1", sr)
}
}
func TestServicesInCN(t *testing.T) {
region := "cn-north-1"
svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "s3", "waf"}
for _, name := range svcs {
ep, sr := endpoints.EndpointForRegion(name, region, false)
assert.Equal(t, fmt.Sprintf("https://%s.%s.amazonaws.com.cn", name, region), ep)
assert.Empty(t, sr)
}
}
@@ -1,85 +0,0 @@
// +build bench
package ec2query_test
import (
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting"
"github.com/aws/aws-sdk-go/private/protocol/ec2query"
"github.com/aws/aws-sdk-go/service/ec2"
)
func BenchmarkEC2QueryBuild_Complex_ec2AuthorizeSecurityGroupEgress(b *testing.B) {
params := &ec2.AuthorizeSecurityGroupEgressInput{
GroupId: aws.String("String"), // Required
CidrIp: aws.String("String"),
DryRun: aws.Bool(true),
FromPort: aws.Int64(1),
IpPermissions: []*ec2.IpPermission{
{ // Required
FromPort: aws.Int64(1),
IpProtocol: aws.String("String"),
IpRanges: []*ec2.IpRange{
{ // Required
CidrIp: aws.String("String"),
},
// More values...
},
PrefixListIds: []*ec2.PrefixListId{
{ // Required
PrefixListId: aws.String("String"),
},
// More values...
},
ToPort: aws.Int64(1),
UserIdGroupPairs: []*ec2.UserIdGroupPair{
{ // Required
GroupId: aws.String("String"),
GroupName: aws.String("String"),
UserId: aws.String("String"),
},
// More values...
},
},
// More values...
},
IpProtocol: aws.String("String"),
SourceSecurityGroupName: aws.String("String"),
SourceSecurityGroupOwnerId: aws.String("String"),
ToPort: aws.Int64(1),
}
benchEC2QueryBuild(b, "AuthorizeSecurityGroupEgress", params)
}
func BenchmarkEC2QueryBuild_Simple_ec2AttachNetworkInterface(b *testing.B) {
params := &ec2.AttachNetworkInterfaceInput{
DeviceIndex: aws.Int64(1), // Required
InstanceId: aws.String("String"), // Required
NetworkInterfaceId: aws.String("String"), // Required
DryRun: aws.Bool(true),
}
benchEC2QueryBuild(b, "AttachNetworkInterface", params)
}
func benchEC2QueryBuild(b *testing.B, opName string, params interface{}) {
svc := awstesting.NewClient()
svc.ServiceName = "ec2"
svc.APIVersion = "2015-04-15"
for i := 0; i < b.N; i++ {
r := svc.NewRequest(&request.Operation{
Name: opName,
HTTPMethod: "POST",
HTTPPath: "/",
}, params, nil)
ec2query.Build(r)
if r.Error != nil {
b.Fatal("Unexpected error", r.Error)
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,33 +0,0 @@
package query
import (
"encoding/xml"
"io"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
)
type xmlErrorResponse struct {
XMLName xml.Name `xml:"ErrorResponse"`
Code string `xml:"Error>Code"`
Message string `xml:"Error>Message"`
RequestID string `xml:"RequestId"`
}
// UnmarshalError unmarshals an error response for an AWS Query service.
func UnmarshalError(r *request.Request) {
defer r.HTTPResponse.Body.Close()
resp := &xmlErrorResponse{}
err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp)
if err != nil && err != io.EOF {
r.Error = awserr.New("SerializationError", "failed to decode query XML error response", err)
} else {
r.Error = awserr.NewRequestFailure(
awserr.New(resp.Code, resp.Message, nil),
r.HTTPResponse.StatusCode,
resp.RequestID,
)
}
}
File diff suppressed because it is too large Load Diff
@@ -1,45 +0,0 @@
package rest
import "reflect"
// PayloadMember returns the payload field member of i if there is one, or nil.
func PayloadMember(i interface{}) interface{} {
if i == nil {
return nil
}
v := reflect.ValueOf(i).Elem()
if !v.IsValid() {
return nil
}
if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok {
if payloadName := field.Tag.Get("payload"); payloadName != "" {
field, _ := v.Type().FieldByName(payloadName)
if field.Tag.Get("type") != "structure" {
return nil
}
payload := v.FieldByName(payloadName)
if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) {
return payload.Interface()
}
}
}
return nil
}
// PayloadType returns the type of a payload field member of i if there is one, or "".
func PayloadType(i interface{}) string {
v := reflect.Indirect(reflect.ValueOf(i))
if !v.IsValid() {
return ""
}
if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok {
if payloadName := field.Tag.Get("payload"); payloadName != "" {
if member, ok := v.Type().FieldByName(payloadName); ok {
return member.Tag.Get("type")
}
}
}
return ""
}
@@ -1,260 +0,0 @@
package xmlutil
import (
"encoding/base64"
"encoding/xml"
"fmt"
"io"
"reflect"
"strconv"
"strings"
"time"
)
// UnmarshalXML deserializes an xml.Decoder into the container v. V
// needs to match the shape of the XML expected to be decoded.
// If the shape doesn't match unmarshaling will fail.
func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error {
n, _ := XMLToStruct(d, nil)
if n.Children != nil {
for _, root := range n.Children {
for _, c := range root {
if wrappedChild, ok := c.Children[wrapper]; ok {
c = wrappedChild[0] // pull out wrapped element
}
err := parse(reflect.ValueOf(v), c, "")
if err != nil {
if err == io.EOF {
return nil
}
return err
}
}
}
return nil
}
return nil
}
// parse deserializes any value from the XMLNode. The type tag is used to infer the type, or reflect
// will be used to determine the type from r.
func parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
rtype := r.Type()
if rtype.Kind() == reflect.Ptr {
rtype = rtype.Elem() // check kind of actual element type
}
t := tag.Get("type")
if t == "" {
switch rtype.Kind() {
case reflect.Struct:
t = "structure"
case reflect.Slice:
t = "list"
case reflect.Map:
t = "map"
}
}
switch t {
case "structure":
if field, ok := rtype.FieldByName("SDKShapeTraits"); ok {
tag = field.Tag
}
return parseStruct(r, node, tag)
case "list":
return parseList(r, node, tag)
case "map":
return parseMap(r, node, tag)
default:
return parseScalar(r, node, tag)
}
}
// parseStruct deserializes a structure and its fields from an XMLNode. Any nested
// types in the structure will also be deserialized.
func parseStruct(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
t := r.Type()
if r.Kind() == reflect.Ptr {
if r.IsNil() { // create the structure if it's nil
s := reflect.New(r.Type().Elem())
r.Set(s)
r = s
}
r = r.Elem()
t = t.Elem()
}
// unwrap any payloads
if payload := tag.Get("payload"); payload != "" {
field, _ := t.FieldByName(payload)
return parseStruct(r.FieldByName(payload), node, field.Tag)
}
for i := 0; i < t.NumField(); i++ {
field := t.Field(i)
if c := field.Name[0:1]; strings.ToLower(c) == c {
continue // ignore unexported fields
}
// figure out what this field is called
name := field.Name
if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" {
name = field.Tag.Get("locationNameList")
} else if locName := field.Tag.Get("locationName"); locName != "" {
name = locName
}
// try to find the field by name in elements
elems := node.Children[name]
if elems == nil { // try to find the field in attributes
for _, a := range node.Attr {
if name == a.Name.Local {
// turn this into a text node for de-serializing
elems = []*XMLNode{{Text: a.Value}}
}
}
}
member := r.FieldByName(field.Name)
for _, elem := range elems {
err := parse(member, elem, field.Tag)
if err != nil {
return err
}
}
}
return nil
}
// parseList deserializes a list of values from an XML node. Each list entry
// will also be deserialized.
func parseList(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
t := r.Type()
if tag.Get("flattened") == "" { // look at all item entries
mname := "member"
if name := tag.Get("locationNameList"); name != "" {
mname = name
}
if Children, ok := node.Children[mname]; ok {
if r.IsNil() {
r.Set(reflect.MakeSlice(t, len(Children), len(Children)))
}
for i, c := range Children {
err := parse(r.Index(i), c, "")
if err != nil {
return err
}
}
}
} else { // flattened list means this is a single element
if r.IsNil() {
r.Set(reflect.MakeSlice(t, 0, 0))
}
childR := reflect.Zero(t.Elem())
r.Set(reflect.Append(r, childR))
err := parse(r.Index(r.Len()-1), node, "")
if err != nil {
return err
}
}
return nil
}
// parseMap deserializes a map from an XMLNode. The direct children of the XMLNode
// will also be deserialized as map entries.
func parseMap(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
if r.IsNil() {
r.Set(reflect.MakeMap(r.Type()))
}
if tag.Get("flattened") == "" { // look at all child entries
for _, entry := range node.Children["entry"] {
parseMapEntry(r, entry, tag)
}
} else { // this element is itself an entry
parseMapEntry(r, node, tag)
}
return nil
}
// parseMapEntry deserializes a map entry from a XML node.
func parseMapEntry(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
kname, vname := "key", "value"
if n := tag.Get("locationNameKey"); n != "" {
kname = n
}
if n := tag.Get("locationNameValue"); n != "" {
vname = n
}
keys, ok := node.Children[kname]
values := node.Children[vname]
if ok {
for i, key := range keys {
keyR := reflect.ValueOf(key.Text)
value := values[i]
valueR := reflect.New(r.Type().Elem()).Elem()
parse(valueR, value, "")
r.SetMapIndex(keyR, valueR)
}
}
return nil
}
// parseScaller deserializes an XMLNode value into a concrete type based on the
// interface type of r.
//
// Error is returned if the deserialization fails due to invalid type conversion,
// or unsupported interface type.
func parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
switch r.Interface().(type) {
case *string:
r.Set(reflect.ValueOf(&node.Text))
return nil
case []byte:
b, err := base64.StdEncoding.DecodeString(node.Text)
if err != nil {
return err
}
r.Set(reflect.ValueOf(b))
case *bool:
v, err := strconv.ParseBool(node.Text)
if err != nil {
return err
}
r.Set(reflect.ValueOf(&v))
case *int64:
v, err := strconv.ParseInt(node.Text, 10, 64)
if err != nil {
return err
}
r.Set(reflect.ValueOf(&v))
case *float64:
v, err := strconv.ParseFloat(node.Text, 64)
if err != nil {
return err
}
r.Set(reflect.ValueOf(&v))
case *time.Time:
const ISO8601UTC = "2006-01-02T15:04:05Z"
t, err := time.Parse(ISO8601UTC, node.Text)
if err != nil {
return err
}
r.Set(reflect.ValueOf(&t))
default:
return fmt.Errorf("unsupported value: %v (%s)", r.Interface(), r.Type())
}
return nil
}
@@ -1,42 +0,0 @@
package v4_test
import (
"net/url"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/awstesting/unit"
"github.com/aws/aws-sdk-go/service/s3"
)
func TestPresignHandler(t *testing.T) {
svc := s3.New(unit.Session)
req, _ := svc.PutObjectRequest(&s3.PutObjectInput{
Bucket: aws.String("bucket"),
Key: aws.String("key"),
ContentDisposition: aws.String("a+b c$d"),
ACL: aws.String("public-read"),
})
req.Time = time.Unix(0, 0)
urlstr, err := req.Presign(5 * time.Minute)
assert.NoError(t, err)
expectedDate := "19700101T000000Z"
expectedHeaders := "host;x-amz-acl"
expectedSig := "7edcb4e3a1bf12f4989018d75acbe3a7f03df24bd6f3112602d59fc551f0e4e2"
expectedCred := "AKID/19700101/mock-region/s3/aws4_request"
u, _ := url.Parse(urlstr)
urlQ := u.Query()
assert.Equal(t, expectedSig, urlQ.Get("X-Amz-Signature"))
assert.Equal(t, expectedCred, urlQ.Get("X-Amz-Credential"))
assert.Equal(t, expectedHeaders, urlQ.Get("X-Amz-SignedHeaders"))
assert.Equal(t, expectedDate, urlQ.Get("X-Amz-Date"))
assert.Equal(t, "300", urlQ.Get("X-Amz-Expires"))
assert.NotContains(t, urlstr, "+") // + encoded as %20
}
-365
View File
@@ -1,365 +0,0 @@
// Package v4 implements signing for AWS V4 signer
package v4
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"net/http"
"net/url"
"sort"
"strconv"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol/rest"
)
const (
authHeaderPrefix = "AWS4-HMAC-SHA256"
timeFormat = "20060102T150405Z"
shortTimeFormat = "20060102"
)
var ignoredHeaders = map[string]bool{
"Authorization": true,
"Content-Type": true,
"Content-Length": true,
"User-Agent": true,
}
type signer struct {
Request *http.Request
Time time.Time
ExpireTime time.Duration
ServiceName string
Region string
CredValues credentials.Value
Credentials *credentials.Credentials
Query url.Values
Body io.ReadSeeker
Debug aws.LogLevelType
Logger aws.Logger
isPresign bool
formattedTime string
formattedShortTime string
signedHeaders string
canonicalHeaders string
canonicalString string
credentialString string
stringToSign string
signature string
authorization string
}
// Sign requests with signature version 4.
//
// Will sign the requests with the service config's Credentials object
// Signing is skipped if the credentials is the credentials.AnonymousCredentials
// object.
func Sign(req *request.Request) {
// If the request does not need to be signed ignore the signing of the
// request if the AnonymousCredentials object is used.
if req.Config.Credentials == credentials.AnonymousCredentials {
return
}
region := req.ClientInfo.SigningRegion
if region == "" {
region = aws.StringValue(req.Config.Region)
}
name := req.ClientInfo.SigningName
if name == "" {
name = req.ClientInfo.ServiceName
}
s := signer{
Request: req.HTTPRequest,
Time: req.Time,
ExpireTime: req.ExpireTime,
Query: req.HTTPRequest.URL.Query(),
Body: req.Body,
ServiceName: name,
Region: region,
Credentials: req.Config.Credentials,
Debug: req.Config.LogLevel.Value(),
Logger: req.Config.Logger,
}
req.Error = s.sign()
}
func (v4 *signer) sign() error {
if v4.ExpireTime != 0 {
v4.isPresign = true
}
if v4.isRequestSigned() {
if !v4.Credentials.IsExpired() {
// If the request is already signed, and the credentials have not
// expired yet ignore the signing request.
return nil
}
// The credentials have expired for this request. The current signing
// is invalid, and needs to be request because the request will fail.
if v4.isPresign {
v4.removePresign()
// Update the request's query string to ensure the values stays in
// sync in the case retrieving the new credentials fails.
v4.Request.URL.RawQuery = v4.Query.Encode()
}
}
var err error
v4.CredValues, err = v4.Credentials.Get()
if err != nil {
return err
}
if v4.isPresign {
v4.Query.Set("X-Amz-Algorithm", authHeaderPrefix)
if v4.CredValues.SessionToken != "" {
v4.Query.Set("X-Amz-Security-Token", v4.CredValues.SessionToken)
} else {
v4.Query.Del("X-Amz-Security-Token")
}
} else if v4.CredValues.SessionToken != "" {
v4.Request.Header.Set("X-Amz-Security-Token", v4.CredValues.SessionToken)
}
v4.build()
if v4.Debug.Matches(aws.LogDebugWithSigning) {
v4.logSigningInfo()
}
return nil
}
const logSignInfoMsg = `DEBUG: Request Signiture:
---[ CANONICAL STRING ]-----------------------------
%s
---[ STRING TO SIGN ]--------------------------------
%s%s
-----------------------------------------------------`
const logSignedURLMsg = `
---[ SIGNED URL ]------------------------------------
%s`
func (v4 *signer) logSigningInfo() {
signedURLMsg := ""
if v4.isPresign {
signedURLMsg = fmt.Sprintf(logSignedURLMsg, v4.Request.URL.String())
}
msg := fmt.Sprintf(logSignInfoMsg, v4.canonicalString, v4.stringToSign, signedURLMsg)
v4.Logger.Log(msg)
}
func (v4 *signer) build() {
v4.buildTime() // no depends
v4.buildCredentialString() // no depends
if v4.isPresign {
v4.buildQuery() // no depends
}
v4.buildCanonicalHeaders() // depends on cred string
v4.buildCanonicalString() // depends on canon headers / signed headers
v4.buildStringToSign() // depends on canon string
v4.buildSignature() // depends on string to sign
if v4.isPresign {
v4.Request.URL.RawQuery += "&X-Amz-Signature=" + v4.signature
} else {
parts := []string{
authHeaderPrefix + " Credential=" + v4.CredValues.AccessKeyID + "/" + v4.credentialString,
"SignedHeaders=" + v4.signedHeaders,
"Signature=" + v4.signature,
}
v4.Request.Header.Set("Authorization", strings.Join(parts, ", "))
}
}
func (v4 *signer) buildTime() {
v4.formattedTime = v4.Time.UTC().Format(timeFormat)
v4.formattedShortTime = v4.Time.UTC().Format(shortTimeFormat)
if v4.isPresign {
duration := int64(v4.ExpireTime / time.Second)
v4.Query.Set("X-Amz-Date", v4.formattedTime)
v4.Query.Set("X-Amz-Expires", strconv.FormatInt(duration, 10))
} else {
v4.Request.Header.Set("X-Amz-Date", v4.formattedTime)
}
}
func (v4 *signer) buildCredentialString() {
v4.credentialString = strings.Join([]string{
v4.formattedShortTime,
v4.Region,
v4.ServiceName,
"aws4_request",
}, "/")
if v4.isPresign {
v4.Query.Set("X-Amz-Credential", v4.CredValues.AccessKeyID+"/"+v4.credentialString)
}
}
func (v4 *signer) buildQuery() {
for k, h := range v4.Request.Header {
if strings.HasPrefix(http.CanonicalHeaderKey(k), "X-Amz-") {
continue // never hoist x-amz-* headers, they must be signed
}
if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok {
continue // never hoist ignored headers
}
v4.Request.Header.Del(k)
v4.Query.Del(k)
for _, v := range h {
v4.Query.Add(k, v)
}
}
}
func (v4 *signer) buildCanonicalHeaders() {
var headers []string
headers = append(headers, "host")
for k := range v4.Request.Header {
if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok {
continue // ignored header
}
headers = append(headers, strings.ToLower(k))
}
sort.Strings(headers)
v4.signedHeaders = strings.Join(headers, ";")
if v4.isPresign {
v4.Query.Set("X-Amz-SignedHeaders", v4.signedHeaders)
}
headerValues := make([]string, len(headers))
for i, k := range headers {
if k == "host" {
headerValues[i] = "host:" + v4.Request.URL.Host
} else {
headerValues[i] = k + ":" +
strings.Join(v4.Request.Header[http.CanonicalHeaderKey(k)], ",")
}
}
v4.canonicalHeaders = strings.Join(headerValues, "\n")
}
func (v4 *signer) buildCanonicalString() {
v4.Request.URL.RawQuery = strings.Replace(v4.Query.Encode(), "+", "%20", -1)
uri := v4.Request.URL.Opaque
if uri != "" {
uri = "/" + strings.Join(strings.Split(uri, "/")[3:], "/")
} else {
uri = v4.Request.URL.Path
}
if uri == "" {
uri = "/"
}
if v4.ServiceName != "s3" {
uri = rest.EscapePath(uri, false)
}
v4.canonicalString = strings.Join([]string{
v4.Request.Method,
uri,
v4.Request.URL.RawQuery,
v4.canonicalHeaders + "\n",
v4.signedHeaders,
v4.bodyDigest(),
}, "\n")
}
func (v4 *signer) buildStringToSign() {
v4.stringToSign = strings.Join([]string{
authHeaderPrefix,
v4.formattedTime,
v4.credentialString,
hex.EncodeToString(makeSha256([]byte(v4.canonicalString))),
}, "\n")
}
func (v4 *signer) buildSignature() {
secret := v4.CredValues.SecretAccessKey
date := makeHmac([]byte("AWS4"+secret), []byte(v4.formattedShortTime))
region := makeHmac(date, []byte(v4.Region))
service := makeHmac(region, []byte(v4.ServiceName))
credentials := makeHmac(service, []byte("aws4_request"))
signature := makeHmac(credentials, []byte(v4.stringToSign))
v4.signature = hex.EncodeToString(signature)
}
func (v4 *signer) bodyDigest() string {
hash := v4.Request.Header.Get("X-Amz-Content-Sha256")
if hash == "" {
if v4.isPresign && v4.ServiceName == "s3" {
hash = "UNSIGNED-PAYLOAD"
} else if v4.Body == nil {
hash = hex.EncodeToString(makeSha256([]byte{}))
} else {
hash = hex.EncodeToString(makeSha256Reader(v4.Body))
}
v4.Request.Header.Add("X-Amz-Content-Sha256", hash)
}
return hash
}
// isRequestSigned returns if the request is currently signed or presigned
func (v4 *signer) isRequestSigned() bool {
if v4.isPresign && v4.Query.Get("X-Amz-Signature") != "" {
return true
}
if v4.Request.Header.Get("Authorization") != "" {
return true
}
return false
}
// unsign removes signing flags for both signed and presigned requests.
func (v4 *signer) removePresign() {
v4.Query.Del("X-Amz-Algorithm")
v4.Query.Del("X-Amz-Signature")
v4.Query.Del("X-Amz-Security-Token")
v4.Query.Del("X-Amz-Date")
v4.Query.Del("X-Amz-Expires")
v4.Query.Del("X-Amz-Credential")
v4.Query.Del("X-Amz-SignedHeaders")
}
func makeHmac(key []byte, data []byte) []byte {
hash := hmac.New(sha256.New, key)
hash.Write(data)
return hash.Sum(nil)
}
func makeSha256(data []byte) []byte {
hash := sha256.New()
hash.Write(data)
return hash.Sum(nil)
}
func makeSha256Reader(reader io.ReadSeeker) []byte {
hash := sha256.New()
start, _ := reader.Seek(0, 1)
defer reader.Seek(start, 0)
io.Copy(hash, reader)
return hash.Sum(nil)
}
@@ -1,252 +0,0 @@
package v4
import (
"net/http"
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting"
)
func buildSigner(serviceName string, region string, signTime time.Time, expireTime time.Duration, body string) signer {
endpoint := "https://" + serviceName + "." + region + ".amazonaws.com"
reader := strings.NewReader(body)
req, _ := http.NewRequest("POST", endpoint, reader)
req.URL.Opaque = "//example.org/bucket/key-._~,!@#$%^&*()"
req.Header.Add("X-Amz-Target", "prefix.Operation")
req.Header.Add("Content-Type", "application/x-amz-json-1.0")
req.Header.Add("Content-Length", string(len(body)))
req.Header.Add("X-Amz-Meta-Other-Header", "some-value=!@#$%^&* (+)")
return signer{
Request: req,
Time: signTime,
ExpireTime: expireTime,
Query: req.URL.Query(),
Body: reader,
ServiceName: serviceName,
Region: region,
Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"),
}
}
func removeWS(text string) string {
text = strings.Replace(text, " ", "", -1)
text = strings.Replace(text, "\n", "", -1)
text = strings.Replace(text, "\t", "", -1)
return text
}
func assertEqual(t *testing.T, expected, given string) {
if removeWS(expected) != removeWS(given) {
t.Errorf("\nExpected: %s\nGiven: %s", expected, given)
}
}
func TestPresignRequest(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Unix(0, 0), 300*time.Second, "{}")
signer.sign()
expectedDate := "19700101T000000Z"
expectedHeaders := "host;x-amz-meta-other-header;x-amz-target"
expectedSig := "5eeedebf6f995145ce56daa02902d10485246d3defb34f97b973c1f40ab82d36"
expectedCred := "AKID/19700101/us-east-1/dynamodb/aws4_request"
q := signer.Request.URL.Query()
assert.Equal(t, expectedSig, q.Get("X-Amz-Signature"))
assert.Equal(t, expectedCred, q.Get("X-Amz-Credential"))
assert.Equal(t, expectedHeaders, q.Get("X-Amz-SignedHeaders"))
assert.Equal(t, expectedDate, q.Get("X-Amz-Date"))
}
func TestSignRequest(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Unix(0, 0), 0, "{}")
signer.sign()
expectedDate := "19700101T000000Z"
expectedSig := "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/dynamodb/aws4_request, SignedHeaders=host;x-amz-date;x-amz-meta-other-header;x-amz-security-token;x-amz-target, Signature=69ada33fec48180dab153576e4dd80c4e04124f80dda3eccfed8a67c2b91ed5e"
q := signer.Request.Header
assert.Equal(t, expectedSig, q.Get("Authorization"))
assert.Equal(t, expectedDate, q.Get("X-Amz-Date"))
}
func TestSignEmptyBody(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "")
signer.Body = nil
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", hash)
}
func TestSignBody(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "hello")
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash)
}
func TestSignSeekedBody(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, " hello")
signer.Body.Read(make([]byte, 3)) // consume first 3 bytes so body is now "hello"
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash)
start, _ := signer.Body.Seek(0, 1)
assert.Equal(t, int64(3), start)
}
func TestPresignEmptyBodyS3(t *testing.T) {
signer := buildSigner("s3", "us-east-1", time.Now(), 5*time.Minute, "hello")
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "UNSIGNED-PAYLOAD", hash)
}
func TestSignPrecomputedBodyChecksum(t *testing.T) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "hello")
signer.Request.Header.Set("X-Amz-Content-Sha256", "PRECOMPUTED")
signer.sign()
hash := signer.Request.Header.Get("X-Amz-Content-Sha256")
assert.Equal(t, "PRECOMPUTED", hash)
}
func TestAnonymousCredentials(t *testing.T) {
svc := awstesting.NewClient(&aws.Config{Credentials: credentials.AnonymousCredentials})
r := svc.NewRequest(
&request.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
Sign(r)
urlQ := r.HTTPRequest.URL.Query()
assert.Empty(t, urlQ.Get("X-Amz-Signature"))
assert.Empty(t, urlQ.Get("X-Amz-Credential"))
assert.Empty(t, urlQ.Get("X-Amz-SignedHeaders"))
assert.Empty(t, urlQ.Get("X-Amz-Date"))
hQ := r.HTTPRequest.Header
assert.Empty(t, hQ.Get("Authorization"))
assert.Empty(t, hQ.Get("X-Amz-Date"))
}
func TestIgnoreResignRequestWithValidCreds(t *testing.T) {
svc := awstesting.NewClient(&aws.Config{
Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"),
Region: aws.String("us-west-2"),
})
r := svc.NewRequest(
&request.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
Sign(r)
sig := r.HTTPRequest.Header.Get("Authorization")
Sign(r)
assert.Equal(t, sig, r.HTTPRequest.Header.Get("Authorization"))
}
func TestIgnorePreResignRequestWithValidCreds(t *testing.T) {
svc := awstesting.NewClient(&aws.Config{
Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"),
Region: aws.String("us-west-2"),
})
r := svc.NewRequest(
&request.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
r.ExpireTime = time.Minute * 10
Sign(r)
sig := r.HTTPRequest.Header.Get("X-Amz-Signature")
Sign(r)
assert.Equal(t, sig, r.HTTPRequest.Header.Get("X-Amz-Signature"))
}
func TestResignRequestExpiredCreds(t *testing.T) {
creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION")
svc := awstesting.NewClient(&aws.Config{Credentials: creds})
r := svc.NewRequest(
&request.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
Sign(r)
querySig := r.HTTPRequest.Header.Get("Authorization")
creds.Expire()
Sign(r)
assert.NotEqual(t, querySig, r.HTTPRequest.Header.Get("Authorization"))
}
func TestPreResignRequestExpiredCreds(t *testing.T) {
provider := &credentials.StaticProvider{Value: credentials.Value{
AccessKeyID: "AKID",
SecretAccessKey: "SECRET",
SessionToken: "SESSION",
}}
creds := credentials.NewCredentials(provider)
svc := awstesting.NewClient(&aws.Config{Credentials: creds})
r := svc.NewRequest(
&request.Operation{
Name: "BatchGetItem",
HTTPMethod: "POST",
HTTPPath: "/",
},
nil,
nil,
)
r.ExpireTime = time.Minute * 10
Sign(r)
querySig := r.HTTPRequest.URL.Query().Get("X-Amz-Signature")
creds.Expire()
r.Time = time.Now().Add(time.Hour * 48)
Sign(r)
assert.NotEqual(t, querySig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature"))
}
func BenchmarkPresignRequest(b *testing.B) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 300*time.Second, "{}")
for i := 0; i < b.N; i++ {
signer.sign()
}
}
func BenchmarkSignRequest(b *testing.B) {
signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "{}")
for i := 0; i < b.N; i++ {
signer.sign()
}
}
@@ -1,136 +0,0 @@
package waiter
import (
"fmt"
"reflect"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
// A Config provides a collection of configuration values to setup a generated
// waiter code with.
type Config struct {
Name string
Delay int
MaxAttempts int
Operation string
Acceptors []WaitAcceptor
}
// A WaitAcceptor provides the information needed to wait for an API operation
// to complete.
type WaitAcceptor struct {
Expected interface{}
Matcher string
State string
Argument string
}
// A Waiter provides waiting for an operation to complete.
type Waiter struct {
Config
Client interface{}
Input interface{}
}
// Wait waits for an operation to complete, expire max attempts, or fail. Error
// is returned if the operation fails.
func (w *Waiter) Wait() error {
client := reflect.ValueOf(w.Client)
in := reflect.ValueOf(w.Input)
method := client.MethodByName(w.Config.Operation + "Request")
for i := 0; i < w.MaxAttempts; i++ {
res := method.Call([]reflect.Value{in})
req := res[0].Interface().(*request.Request)
req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Waiter"))
err := req.Send()
for _, a := range w.Acceptors {
if err != nil && a.Matcher != "error" {
// Only matcher error is valid if there is a request error
continue
}
result := false
var vals []interface{}
switch a.Matcher {
case "pathAll", "path":
// Require all matches to be equal for result to match
vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
result = true
for _, val := range vals {
if !awsutil.DeepEqual(val, a.Expected) {
result = false
break
}
}
case "pathAny":
// Only a single match needs to equal for the result to match
vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
for _, val := range vals {
if awsutil.DeepEqual(val, a.Expected) {
result = true
break
}
}
case "status":
s := a.Expected.(int)
result = s == req.HTTPResponse.StatusCode
case "error":
if aerr, ok := err.(awserr.Error); ok {
result = aerr.Code() == a.Expected.(string)
}
case "pathList":
// ignored matcher
default:
logf(client, "WARNING: Waiter for %s encountered unexpected matcher: %s",
w.Config.Operation, a.Matcher)
}
if !result {
// If there was no matching result found there is nothing more to do
// for this response, retry the request.
continue
}
switch a.State {
case "success":
// waiter completed
return nil
case "failure":
// Waiter failure state triggered
return awserr.New("ResourceNotReady",
fmt.Sprintf("failed waiting for successful resource state"), err)
case "retry":
// clear the error and retry the operation
err = nil
default:
logf(client, "WARNING: Waiter for %s encountered unexpected state: %s",
w.Config.Operation, a.State)
}
}
if err != nil {
return err
}
time.Sleep(time.Second * time.Duration(w.Delay))
}
return awserr.New("ResourceNotReady",
fmt.Sprintf("exceeded %d wait attempts", w.MaxAttempts), nil)
}
func logf(client reflect.Value, msg string, args ...interface{}) {
cfgVal := client.FieldByName("Config")
if !cfgVal.IsValid() {
return
}
if cfg, ok := cfgVal.Interface().(*aws.Config); ok && cfg.Logger != nil {
cfg.Logger.Log(fmt.Sprintf(msg, args...))
}
}
@@ -1,391 +0,0 @@
package waiter_test
import (
"bytes"
"io/ioutil"
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting"
"github.com/aws/aws-sdk-go/private/waiter"
)
type mockClient struct {
*client.Client
}
type MockInput struct{}
type MockOutput struct {
States []*MockState
}
type MockState struct {
State *string
}
func (c *mockClient) MockRequest(input *MockInput) (*request.Request, *MockOutput) {
op := &request.Operation{
Name: "Mock",
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &MockInput{}
}
output := &MockOutput{}
req := c.NewRequest(op, input, output)
req.Data = output
return req, output
}
func TestWaiterPathAll(t *testing.T) {
svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
Region: aws.String("mock-region"),
})}
svc.Handlers.Send.Clear() // mock sending
svc.Handlers.Unmarshal.Clear()
svc.Handlers.UnmarshalMeta.Clear()
svc.Handlers.ValidateResponse.Clear()
reqNum := 0
resps := []*MockOutput{
{ // Request 1
States: []*MockState{
{State: aws.String("pending")},
{State: aws.String("pending")},
},
},
{ // Request 2
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("pending")},
},
},
{ // Request 3
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("running")},
},
},
}
numBuiltReq := 0
svc.Handlers.Build.PushBack(func(r *request.Request) {
numBuiltReq++
})
svc.Handlers.Unmarshal.PushBack(func(r *request.Request) {
if reqNum >= len(resps) {
assert.Fail(t, "too many polling requests made")
return
}
r.Data = resps[reqNum]
reqNum++
})
waiterCfg := waiter.Config{
Operation: "Mock",
Delay: 0,
MaxAttempts: 10,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "States[].State",
Expected: "running",
},
},
}
w := waiter.Waiter{
Client: svc,
Input: &MockInput{},
Config: waiterCfg,
}
err := w.Wait()
assert.NoError(t, err)
assert.Equal(t, 3, numBuiltReq)
assert.Equal(t, 3, reqNum)
}
func TestWaiterPath(t *testing.T) {
svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
Region: aws.String("mock-region"),
})}
svc.Handlers.Send.Clear() // mock sending
svc.Handlers.Unmarshal.Clear()
svc.Handlers.UnmarshalMeta.Clear()
svc.Handlers.ValidateResponse.Clear()
reqNum := 0
resps := []*MockOutput{
{ // Request 1
States: []*MockState{
{State: aws.String("pending")},
{State: aws.String("pending")},
},
},
{ // Request 2
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("pending")},
},
},
{ // Request 3
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("running")},
},
},
}
numBuiltReq := 0
svc.Handlers.Build.PushBack(func(r *request.Request) {
numBuiltReq++
})
svc.Handlers.Unmarshal.PushBack(func(r *request.Request) {
if reqNum >= len(resps) {
assert.Fail(t, "too many polling requests made")
return
}
r.Data = resps[reqNum]
reqNum++
})
waiterCfg := waiter.Config{
Operation: "Mock",
Delay: 0,
MaxAttempts: 10,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "path",
Argument: "States[].State",
Expected: "running",
},
},
}
w := waiter.Waiter{
Client: svc,
Input: &MockInput{},
Config: waiterCfg,
}
err := w.Wait()
assert.NoError(t, err)
assert.Equal(t, 3, numBuiltReq)
assert.Equal(t, 3, reqNum)
}
func TestWaiterFailure(t *testing.T) {
svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
Region: aws.String("mock-region"),
})}
svc.Handlers.Send.Clear() // mock sending
svc.Handlers.Unmarshal.Clear()
svc.Handlers.UnmarshalMeta.Clear()
svc.Handlers.ValidateResponse.Clear()
reqNum := 0
resps := []*MockOutput{
{ // Request 1
States: []*MockState{
{State: aws.String("pending")},
{State: aws.String("pending")},
},
},
{ // Request 2
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("pending")},
},
},
{ // Request 3
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("stopping")},
},
},
}
numBuiltReq := 0
svc.Handlers.Build.PushBack(func(r *request.Request) {
numBuiltReq++
})
svc.Handlers.Unmarshal.PushBack(func(r *request.Request) {
if reqNum >= len(resps) {
assert.Fail(t, "too many polling requests made")
return
}
r.Data = resps[reqNum]
reqNum++
})
waiterCfg := waiter.Config{
Operation: "Mock",
Delay: 0,
MaxAttempts: 10,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "States[].State",
Expected: "running",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "States[].State",
Expected: "stopping",
},
},
}
w := waiter.Waiter{
Client: svc,
Input: &MockInput{},
Config: waiterCfg,
}
err := w.Wait().(awserr.Error)
assert.Error(t, err)
assert.Equal(t, "ResourceNotReady", err.Code())
assert.Equal(t, "failed waiting for successful resource state", err.Message())
assert.Equal(t, 3, numBuiltReq)
assert.Equal(t, 3, reqNum)
}
func TestWaiterError(t *testing.T) {
svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
Region: aws.String("mock-region"),
})}
svc.Handlers.Send.Clear() // mock sending
svc.Handlers.Unmarshal.Clear()
svc.Handlers.UnmarshalMeta.Clear()
svc.Handlers.ValidateResponse.Clear()
reqNum := 0
resps := []*MockOutput{
{ // Request 1
States: []*MockState{
{State: aws.String("pending")},
{State: aws.String("pending")},
},
},
{ // Request 2, error case
},
{ // Request 3
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("running")},
},
},
}
numBuiltReq := 0
svc.Handlers.Build.PushBack(func(r *request.Request) {
numBuiltReq++
})
svc.Handlers.Send.PushBack(func(r *request.Request) {
if reqNum == 1 {
r.Error = awserr.New("MockException", "mock exception message", nil)
r.HTTPResponse = &http.Response{
StatusCode: 400,
Status: http.StatusText(400),
Body: ioutil.NopCloser(bytes.NewReader([]byte{})),
}
reqNum++
}
})
svc.Handlers.Unmarshal.PushBack(func(r *request.Request) {
if reqNum >= len(resps) {
assert.Fail(t, "too many polling requests made")
return
}
r.Data = resps[reqNum]
reqNum++
})
waiterCfg := waiter.Config{
Operation: "Mock",
Delay: 0,
MaxAttempts: 10,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "States[].State",
Expected: "running",
},
{
State: "retry",
Matcher: "error",
Argument: "",
Expected: "MockException",
},
},
}
w := waiter.Waiter{
Client: svc,
Input: &MockInput{},
Config: waiterCfg,
}
err := w.Wait()
assert.NoError(t, err)
assert.Equal(t, 3, numBuiltReq)
assert.Equal(t, 3, reqNum)
}
func TestWaiterStatus(t *testing.T) {
svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
Region: aws.String("mock-region"),
})}
svc.Handlers.Send.Clear() // mock sending
svc.Handlers.Unmarshal.Clear()
svc.Handlers.UnmarshalMeta.Clear()
svc.Handlers.ValidateResponse.Clear()
reqNum := 0
svc.Handlers.Build.PushBack(func(r *request.Request) {
reqNum++
})
svc.Handlers.Send.PushBack(func(r *request.Request) {
code := 200
if reqNum == 3 {
code = 404
}
r.HTTPResponse = &http.Response{
StatusCode: code,
Status: http.StatusText(code),
Body: ioutil.NopCloser(bytes.NewReader([]byte{})),
}
})
waiterCfg := waiter.Config{
Operation: "Mock",
Delay: 0,
MaxAttempts: 10,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "status",
Argument: "",
Expected: 404,
},
},
}
w := waiter.Waiter{
Client: svc,
Input: &MockInput{},
Config: waiterCfg,
}
err := w.Wait()
assert.NoError(t, err)
assert.Equal(t, 3, reqNum)
}
File diff suppressed because it is too large Load Diff
@@ -1,64 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package cloudwatchiface provides an interface for the Amazon CloudWatch.
package cloudwatchiface
import (
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/cloudwatch"
)
// CloudWatchAPI is the interface type for cloudwatch.CloudWatch.
type CloudWatchAPI interface {
DeleteAlarmsRequest(*cloudwatch.DeleteAlarmsInput) (*request.Request, *cloudwatch.DeleteAlarmsOutput)
DeleteAlarms(*cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error)
DescribeAlarmHistoryRequest(*cloudwatch.DescribeAlarmHistoryInput) (*request.Request, *cloudwatch.DescribeAlarmHistoryOutput)
DescribeAlarmHistory(*cloudwatch.DescribeAlarmHistoryInput) (*cloudwatch.DescribeAlarmHistoryOutput, error)
DescribeAlarmHistoryPages(*cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool) error
DescribeAlarmsRequest(*cloudwatch.DescribeAlarmsInput) (*request.Request, *cloudwatch.DescribeAlarmsOutput)
DescribeAlarms(*cloudwatch.DescribeAlarmsInput) (*cloudwatch.DescribeAlarmsOutput, error)
DescribeAlarmsPages(*cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool) error
DescribeAlarmsForMetricRequest(*cloudwatch.DescribeAlarmsForMetricInput) (*request.Request, *cloudwatch.DescribeAlarmsForMetricOutput)
DescribeAlarmsForMetric(*cloudwatch.DescribeAlarmsForMetricInput) (*cloudwatch.DescribeAlarmsForMetricOutput, error)
DisableAlarmActionsRequest(*cloudwatch.DisableAlarmActionsInput) (*request.Request, *cloudwatch.DisableAlarmActionsOutput)
DisableAlarmActions(*cloudwatch.DisableAlarmActionsInput) (*cloudwatch.DisableAlarmActionsOutput, error)
EnableAlarmActionsRequest(*cloudwatch.EnableAlarmActionsInput) (*request.Request, *cloudwatch.EnableAlarmActionsOutput)
EnableAlarmActions(*cloudwatch.EnableAlarmActionsInput) (*cloudwatch.EnableAlarmActionsOutput, error)
GetMetricStatisticsRequest(*cloudwatch.GetMetricStatisticsInput) (*request.Request, *cloudwatch.GetMetricStatisticsOutput)
GetMetricStatistics(*cloudwatch.GetMetricStatisticsInput) (*cloudwatch.GetMetricStatisticsOutput, error)
ListMetricsRequest(*cloudwatch.ListMetricsInput) (*request.Request, *cloudwatch.ListMetricsOutput)
ListMetrics(*cloudwatch.ListMetricsInput) (*cloudwatch.ListMetricsOutput, error)
ListMetricsPages(*cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool) error
PutMetricAlarmRequest(*cloudwatch.PutMetricAlarmInput) (*request.Request, *cloudwatch.PutMetricAlarmOutput)
PutMetricAlarm(*cloudwatch.PutMetricAlarmInput) (*cloudwatch.PutMetricAlarmOutput, error)
PutMetricDataRequest(*cloudwatch.PutMetricDataInput) (*request.Request, *cloudwatch.PutMetricDataOutput)
PutMetricData(*cloudwatch.PutMetricDataInput) (*cloudwatch.PutMetricDataOutput, error)
SetAlarmStateRequest(*cloudwatch.SetAlarmStateInput) (*request.Request, *cloudwatch.SetAlarmStateOutput)
SetAlarmState(*cloudwatch.SetAlarmStateInput) (*cloudwatch.SetAlarmStateOutput, error)
}
var _ CloudWatchAPI = (*cloudwatch.CloudWatch)(nil)

Some files were not shown because too many files have changed in this diff Show More