profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/sh0rez/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
sh0rez sh0rez @Grafana Germany https://shorez.de Cargo ship pilot at Grafana Labs. Creator of Tanka

grafana/tanka 1450

Flexible, reusable and concise configuration for Kubernetes

jsonnet-bundler/jsonnet-bundler 325

A jsonnet package manager.

grafana/grizzly 185

A utility for managing Jsonnet dashboards against the Grafana API

monitoring-mixins/mixtool 53

mixtool is a helper for easily working with jsonnet mixins.

sh0rez/kubectl-neat-diff 40

De-clutter your kubectl diff output using kubectl-neat

jsonnet-libs/docsonnet 21

Experimental Jsonnet docs generator

grafana/cuetsy 19

Experimental CUE->TypeScript exporter

sh0rez/awesome-libsonnet 19

Curated list of Kubernetes focused Jsonnet resources

sh0rez/promqtt 10

Generic Prometheus ⟷ MQTT Bridge

sh0rez/asciimatrix 3

golang library to plot ascii text to a coordinate matrix in the terminal

push eventgrafana/tanka

Iain Lane

commit sha 7ac9484486a879e1725f9b46cdef4d19408b89e3

Bump `cli` to 0.2.0 (#611) In particular, this contains a fix to not output an error message when running `tk` with no args, or `tk --help`.

view details

push time in 3 days

PR merged grafana/tanka

Bump `cli` to 0.2.0

In particular, this contains a fix to not output an error message when running tk with no args, or tk --help.

I was seeing:

laney@sherwood (main|✚2)> tk --help
Error: tanka <3 jsonnet

[ help output here ]

which made me think that jsonnet was missing or something. Actually I think it's a fix which is in cli 0.2.0: https://github.com/go-clix/cli/commit/6e2d8d038d677555eaebe90a1db2951aed61ad40. When building with this version, that error message isn't shown any more.

+3 -1

0 comment

2 changed files

iainlane

pr closed time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

PR opened pollypkg/polly

Reviewers
Interactive Editing

Rather large PR implementing a (very basic) interactive editing flow.

Usage:

# run Grafana locally
$ docker run -p 3000:3000 grafana/grafana
$ export GRAFANA_URL=http://localhost:3000
$ export GRAFANA_TOKEN=<token>

# start the react ui (currently standalone)
$ cd pkg/edit/ui && yarn start

# interactively edit the 'cert-manager' pop:
$ go run ./cmd/pop edit ./examples/cert-manager

Then visit http://localhost:3001 and edit the one dashboard. Changes made in Grafana will be reflected on disk.

Packages

  • pkg/api/grafana: intermediary Grafana client (wrapping https://github.com/grafana/grafana-api-golang-client) until we actually have a stable API client. Adds grafana.Watcher type for subscribing to change events
  • pkg/coord: utility package for coordinating shutdown of components using a context.Context.
  • pkg/edit: Editing in general
    • edit.Editor, edit.Grafana: Go structs performing editing sessions (e.g. subscribing to events, plumbing, etc)
    • edit.Server: gRPC-web server to expose edit.Editor capabilities to the frontend
    • edit.Check(): enforces dashboards are in their separate files, so that they can safely be replaced
  • pkg/edit/ui: React UI using gRPC-web to communicate with the Go server

Internals

Grafana pushes notifications over a special WebSocket API using centrifuge, when dashboards are saved. edit.Grafana uses a grafana.Watcher to be notified by that, queries the current dashboard model using the deprecated (but only) API client and saves it to disk.

edit.Server and edit.DashboardService implement a gRPC (and gRPC-web) server for interacting with this exact edit.Grafana, allowing easy control of the edit session.

Both the frontend and the backend use strongly typed gRPC messages, which fits nicely with the overall schema awareness of Polly

+17678 -1123

0 comment

52 changed files

pr created time in a month

push eventpollypkg/polly

sam boyer

commit sha 9ab7ea1360a379c65df6199539f97ba3ca92bce1

Copy over new and updated Grafana schema (#32)

view details

sh0rez

commit sha 33cde00eebcce3df112d82f7dd0f89e96f1489bb

merge 'main' to resolve conflicts

view details

push time in a month

Pull request review commentpollypkg/polly

cli: convert pop to mixin

+import "encoding/json"++// TODO: include full schema?+// TODO: figure out why it stops working when uncommented (cue eval works tho)+// prometheusAlerts: v0: {...}+// prometheusRules: v0: {...}+// grafanaDashboards: v0: {...}++// TODO: handle different versions, deal with migrations, etc, etc+mixin: {

done!

sh0rez

comment created time in a month

PullRequestReviewEvent

Pull request review commentpollypkg/polly

cli: convert pop to mixin

+import "encoding/json"++// TODO: include full schema?+// TODO: figure out why it stops working when uncommented (cue eval works tho)+// prometheusAlerts: v0: {...}+// prometheusRules: v0: {...}+// grafanaDashboards: v0: {...}++// TODO: handle different versions, deal with migrations, etc, etc+mixin: {+    // TODO: change to ruleConvert() once syntax sugar is available+    _alerts: #ruleConvert&{_, #rules: prometheusAlerts.v0}+    _rules: #ruleConvert&{_, #rules: prometheusRules.v0}+    _dashboards: #dashboardConvert&{#dashboards: grafanaDashboards.v0}++    {+        prometheusAlerts: _alerts+        prometheusRules: _rules+        grafanaDashboards: _dashboards+    }+}++#ruleConvert: {+    #rules: [string]: {group: string, alert: {...}, ...}++    [for n, r in (#flattenAlerts & {arg: #rules}).out {+        name: n, rules: r+    }]+}++#dashboardConvert: {+    #dashboards: [string]: _++    for k, v in #dashboards {+        "\(k).json": json.Indent(json.Marshal(v), "", "  ")+    }+}++#flattenAlerts: {

I agree. Let's address this in a future PR

sh0rez

comment created time in a month

PullRequestReviewEvent

push eventpollypkg/polly

sh0rez

commit sha a0d7c9b761bdb59f0cebb7b14b246b24f8dbc958

api: add basic test

view details

sh0rez

commit sha b7b3f3807cdcdbc23573c29229f3643afbd3dacc

merge 'cli' to resolve conflicts

view details

push time in a month

push eventpollypkg/polly

sh0rez

commit sha a0d7c9b761bdb59f0cebb7b14b246b24f8dbc958

api: add basic test

view details

push time in a month

push eventpollypkg/polly

sh0rez

commit sha 38986fa31518d9525da58851daab7eb30d085613

schema: prometheus rules adds actually usable support for prometheus rules

view details

push time in a month

push eventpollypkg/polly

sh0rez

commit sha 829578d9b3d058f8fc33894e852277a3c9013cea

edit: stylistic refactors

view details

push time in a month

push eventpollypkg/polly

sh0rez

commit sha 012b77cf03decd5eafb40d323e607d9bdf5fe1b2

edit: stylistic refactors

view details

push time in a month

push eventpollypkg/polly

sh0rez

commit sha e56a66ae4fe3fb26554a2dd689ad8777281f6f3c

edit: trim nulls

view details

sh0rez

commit sha 1b04c8e1b249ca101c8510bbf7990f5fd4196133

edit: use gRPC-web

view details

push time in a month

startedmarceloprates/prettymaps

started time in a month

PullRequestReviewEvent

push eventpollypkg/polly

sh0rez

commit sha 6601020c690a5f8199fa1fd16616aa473f197708

edit: retain package name

view details

push time in a month

push eventpollypkg/polly

sh0rez

commit sha 7944ef69725b435aeab3ebcd458d17420f8ddf61

coord: context based shutdown Adds pkg/coord for coordinating graceful shutdown of components (including cleanup) on actions like CTRL-C (SIGINT)

view details

sh0rez

commit sha 8b919bfaad006c0d59ad9fbb096ec5e1a4349a2d

edit: http api adds a http based interface to the edit package, so that a browser UI can perform those actions

view details

sh0rez

commit sha b91124b3c1ca908fc8e1b9d0eacf39284e8cd82c

edit/ui: list dashboards initially bootstraps a react based UI that lists the dashboards in the Polly package and displays a respective Edit link (which actually works) for each.

view details

push time in a month

push eventpollypkg/polly

sh0rez

commit sha 666f66bdacd1256f0958e2f055449d34ddbb023a

edit: create and watch Makes `pop edit` create the (currently one and only) dashboard on some Grafana instance (using a temp uid) and subscribes for change events. Once exited (SIGINT), all temporary dashboards are cleaned up

view details

push time in a month

PullRequestReviewEvent

create barnchpollypkg/polly

branch : grafana-edit

created branch time in a month

PullRequestReviewEvent

pull request commentpollypkg/polly

cli: convert pop to mixin

@talentedmrjones:

@sh0rez just curious, what had you choose go-clix/cli over spf13/cobra? While go-clix/cli is based on cobra its stats are concerning: 10 stars, last commit 7 months ago, vs 22k stars last commit yesterday.

go-clix/cli was created by me and my team at Grafana Labs while working on Tanka, mostly as an experiment whether we could reduce the dependency surface of our cli library (which indeed worked out). We also performed certain modifications to the API we considered a convenience of which built-in argument parsing and suggesting is the biggest one (we can suggest CLI completions directly from Go).

Also for whatever it's worth, cue and some other tooling I'm seeing in the community are all using cobra. If you have specific reasons for continuing with go-clix I would love to hear them otherwise I would vote to switch to cobra before more of us start contributing. Thanks for considering my thoughts!

That's a fair point, looking at the ecosystem is important! I wouldn't be too worried personally, given we can (1) change go-clix at will and (2) the API is very similar, so a migration at a later point likely won't hurt us much.

What do you think?

sh0rez

comment created time in a month

push eventpollypkg/polly

sam boyer

commit sha ea2711e2694b6e58dd93f32e8bcf3ad3d5ad196a

Add rudimentary Prometheus rule and alert scuemata (#28)

view details

sh0rez

commit sha d4d119a5cfa93adde745d11720ff303610796bb1

cli: convert pop to mixin Adds initial and highly experimental support for converting pops to mixins for somewhat easy integration into current pipelines. Usage: $ pop mix ./path/to/pop [-o yaml|json] [-s alerts|rules|grafana]

view details

sh0rez

commit sha cf782e45238837ac748f4d01a05b05d3e1cd86e0

cli: add comments to exported api

view details

sh0rez

commit sha a53dfe6b2f3f58b9f8fd14f69828f9c608a915f5

cli: use prometheus compatible structure When invoked with `-s rules|alerts` we now include the `groups:` prefix so that the output can directly be piped into Prometheus rule files

view details

push time in 2 months

push eventpollypkg/polly

sh0rez

commit sha c72ee3e7bcf070e7df597dcc8bdfadc3dd5f1df4

cli: use prometheus compatible structure When invoked with `-s rules|alerts` we now include the `groups:` prefix so that the output can directly be piped into Prometheus rule files

view details

push time in 2 months

Pull request review commentpollypkg/polly

cli: convert pop to mixin

+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=

not sure what you mean, running go mod tidy yields no changes

sh0rez

comment created time in 2 months

PullRequestReviewEvent

push eventpollypkg/polly

sh0rez

commit sha b77200b47763358aa0c4c9181a0bc979821a6928

cli: add comments to exported api

view details

push time in 2 months