-
Notifications
You must be signed in to change notification settings - Fork 176
Integrations common lib #1028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Integrations common lib #1028
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
3430ad1
Init lib
v-zhuravlev 5b574af
add grafonnet import
v-zhuravlev aac4467
Add panels in common lib
v-zhuravlev 6e6a921
Update Makefile
v-zhuravlev baf69ab
Add entrypoint for panels
v-zhuravlev e42c21b
Fix to v10.0.0
v-zhuravlev d7c45aa
Switch from function() to new()
v-zhuravlev 148a906
jsonnetfmt
v-zhuravlev 5e93a5f
Update stat panels
v-zhuravlev 947e73d
Drop fixed interval for all intervals
v-zhuravlev a775ca1
Shuffle lib structure and add comments
v-zhuravlev 2f4d4df
Update common-lib/common/panels.libsonnet
v-zhuravlev 853b407
Add cpu usage stat
v-zhuravlev 7fcb5f1
Add stylize function
v-zhuravlev ec9c420
Add cpu percentage
v-zhuravlev 3e4b5d0
Fix tooltip and legend
v-zhuravlev a2edc2e
Network base: withAxisCenteredZero when withNegateOutPackets
v-zhuravlev 7e9f32f
Fix timeSeries style
v-zhuravlev 5d48a2e
Fix reduceOptions:
v-zhuravlev b533802
DROP grafonnet inheritance for basic panels
v-zhuravlev 7966cdf
Add filesystem usage table
v-zhuravlev b1d644a
Add common annotation
v-zhuravlev 781c316
Add filesystem table with input validtion
v-zhuravlev 28b1fa9
Add threshold
v-zhuravlev e6a73d5
Add gradient 'scheme' to percentage
v-zhuravlev 1a95561
Add cpu.stat
v-zhuravlev 07c9360
update cpu.timeSeries
v-zhuravlev cc295d5
Add filesystems.stat
v-zhuravlev d4083ad
Upate network.timeSeries
v-zhuravlev 53493ed
Update disk.timeSeries
v-zhuravlev 90739d9
Update panels
v-zhuravlev bf5ac34
Add topkPercentage
v-zhuravlev 12e239e
Add table panels
v-zhuravlev 73d7cc0
Update to work with latest mixin
v-zhuravlev e0d04c3
Remove duplicated
v-zhuravlev c54fa7b
add panel wide datasource
v-zhuravlev 52a4583
add serviceFailed annotation
v-zhuravlev d8203a1
Add new annotations
v-zhuravlev 7570070
Add datalink to topk_percentage
v-zhuravlev 88a38dd
Update topk
v-zhuravlev 883e6f5
Fix 'all' panel
v-zhuravlev e18b1f6
Add util by mode
v-zhuravlev 643747a
switch to bytes from decbytes
v-zhuravlev ad669a8
Add statusHistory panel
v-zhuravlev 0e23766
Add disk panels
v-zhuravlev 382d45d
Add default descriptions
v-zhuravlev 974ff27
Merge disk and filesystem
v-zhuravlev fe90390
Remove bigger text in stat panels
v-zhuravlev 5a6d0b2
Fix disks styles
v-zhuravlev dd0e353
Remove unused
v-zhuravlev fb90335
Update memory panels
v-zhuravlev d1f4cc7
Fix disk usage table
v-zhuravlev f695413
Add utils (from windows lib)
v-zhuravlev 994137f
Add link to utils
v-zhuravlev f6758a1
Update panels
v-zhuravlev 6d3a42d
Add contrib
v-zhuravlev 7247c57
Rename 'all' to 'generic'
v-zhuravlev 2c9bbf5
Update panels
v-zhuravlev bc0fa62
Update ts stylize
v-zhuravlev ef263c4
Update stat panels stylize
v-zhuravlev 83b36a8
Fix ts stylize
v-zhuravlev cb1fb97
Add table
v-zhuravlev dede26b
Update status-history
v-zhuravlev 869f93d
Update README
v-zhuravlev b9aa2f1
lint-fmt
v-zhuravlev 6d776a3
Drop title from base class args
v-zhuravlev e1aa770
Update common-lib/common/panels/generic/base.libsonnet
v-zhuravlev cb079c6
Update common-lib/common/panels/generic/timeSeries/percentage.libsonnet
v-zhuravlev cfc250f
Remove comments
v-zhuravlev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Init lib
- Loading branch information
commit 3430ad1c2b56b774ab2fad7e39f5cf6c8faaa3f8
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 1 --string-style s --comment-style s | ||
|
|
||
| .PHONY: all | ||
| all: build dashboards_out | ||
|
|
||
| vendor: jsonnetfile.json | ||
| jb install | ||
|
|
||
| .PHONY: build | ||
| build: vendor | ||
|
|
||
| .PHONY: fmt | ||
| fmt: | ||
| find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ | ||
| xargs -n 1 -- $(JSONNET_FMT) -i | ||
|
|
||
| .PHONY: lint | ||
| lint: build | ||
| find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ | ||
| while read f; do \ | ||
| $(JSONNET_FMT) "$$f" | diff -u "$$f" -; \ | ||
| done | ||
| mixtool lint mixin.libsonnet | ||
|
|
||
| dashboards_out: mixin.libsonnet $(wildcard dashboards/*) | ||
| @mkdir -p dashboards_out | ||
| mixtool generate dashboards -J lib -J vendor mixin.libsonnet -d dashboards_out | ||
|
|
||
| .PHONY: clean | ||
| clean: | ||
| rm -rf dashboards_out prometheus_alerts.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Common lib | ||
|
|
||
| This logs lib can be used to generate dashboards using [grafonnet](https://github.com/grafana/grafonnet). | ||
|
|
||
| This enforces 'common style' to different panels. | ||
|
|
||
| ## Import | ||
|
|
||
| ```sh | ||
| jb init | ||
| jb install https://github.com/grafana/jsonnet-libs/common-lib | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| local g = import 'g.libsonnet'; | ||
|
|
||
| { | ||
| stat: { | ||
| local stat = g.panel.stat, | ||
| base(title, targets): | ||
| stat.new(title) | ||
| + stat.queryOptions.withTargets(targets) | ||
| + stat.queryOptions.withInterval('1m') | ||
| + stat.options.text.withValueSize(20), | ||
|
|
||
| // up (availability) panel | ||
| up(title, targets): | ||
| self.base(title, targets) | ||
| + stat.options.withColorMode('none') | ||
| + stat.options.withGraphMode('none') | ||
| + stat.options.reduceOptions.withCalcs([ | ||
| 'lastNotNull', | ||
| ]), | ||
|
|
||
| //uptime panel. expects duration in seconds as input | ||
| uptime(title, targets): | ||
| self.base(title, targets) | ||
| + stat.standardOptions.withDecimals(1) | ||
| + stat.standardOptions.withUnit('dtdurations') | ||
| + stat.options.withColorMode('thresholds') | ||
| + stat.options.withGraphMode('none') | ||
| + stat.standardOptions.thresholds.withMode('absolute') | ||
| + stat.standardOptions.thresholds.withSteps( | ||
| [ | ||
| stat.options.thresholdStep.withColor('text') | ||
| + stat.options.thresholdStep.withValue(null), | ||
| // warn with orange color when uptime resets (5 minutes) | ||
| stat.options.thresholdStep.withColor('orange') | ||
| + stat.options.thresholdStep.withValue(300), | ||
| ] | ||
| ) | ||
| + stat.options.reduceOptions.withCalcs([ | ||
| 'lastNotNull', | ||
| ]), | ||
| }, | ||
| timeSeries: { | ||
| local timeSeries = g.panel.timeSeries, | ||
| local fieldOverride = g.panel.timeSeries.fieldOverride, | ||
| local custom = timeSeries.fieldConfig.defaults.custom, | ||
| local defaults = timeSeries.fieldConfig.defaults, | ||
| local options = timeSeries.options, | ||
|
|
||
|
|
||
| base(title, targets): | ||
| timeSeries.new(title) | ||
| + timeSeries.queryOptions.withTargets(targets) | ||
| + timeSeries.queryOptions.withInterval('1m') | ||
| + custom.withLineWidth(2) | ||
| + custom.withFillOpacity(0) | ||
| + custom.withShowPoints('never'), | ||
|
|
||
| rpcRate(title, targets): | ||
| self.base(title, targets) | ||
| + timeSeries.standardOptions.withUnit('ops'), | ||
| activeStreams(title, targets): | ||
| self.base(title, targets), | ||
| dbSize(title, targets): | ||
| self.base(title, targets) | ||
| + timeSeries.standardOptions.withUnit('bytes'), | ||
| diskSync(title, targets): | ||
| self.base(title, targets) | ||
| + timeSeries.standardOptions.withUnit('s'), | ||
| memory(title, targets): | ||
| self.base(title, targets) | ||
| + timeSeries.standardOptions.withUnit('bytes'), | ||
| traffic(title, targets): | ||
| self.base(title, targets) | ||
| + timeSeries.standardOptions.withUnit('Bps'), | ||
| raftProposals(title, targets): | ||
| self.base(title, targets), | ||
| leaderElections(title, targets): | ||
| self.base(title, targets), | ||
| peerRtt(title, targets): | ||
| self.base(title, targets) | ||
| + timeSeries.standardOptions.withUnit('s'), | ||
| }, | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "version": 1, | ||
| "dependencies": [ | ||
| { | ||
| "source": { | ||
| "git": { | ||
| "remote": "https://github.com/grafana/grafonnet.git", | ||
| "subdir": "gen/grafonnet-latest" | ||
| } | ||
| }, | ||
| "version": "main" | ||
| } | ||
| ], | ||
| "legacyImports": true | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.