Skip to content
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

Introduce packaging to Docker Mixin #998

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

malcolmholmes
Copy link
Contributor

A proposal for a packaging format for observability packages that is back-compatible with
Jsonnet Mixins.

@malcolmholmes
Copy link
Contributor Author

to test, render this:

  • First, create a file, m.jsonnet that makes the hidden elements in a mixin visible:
local mixin = import 'mixin.libsonnet';
{
  grafanaDashboards: {
    [key]: mixin.grafanaDashboards[key]
    for key in std.objectFields(mixin.grafanaDashboards)
  }
}
  • Next, execute: jsonnet -J vendor m.jsonnet
  • This will give you the json output from the mixin.
  • Alternatively, execute: jsonnet -J vendor polly.libsonnet to get the package contents.

spec: grafana.template.new(
'instance',
'$prometheus_datasource',
'label_values(machine_scrape_error{job=~"$job"}, instance)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes variables depend on config (instead of hardcoded job=~"$job" it could be dynamic label selector). Does this packaging provide a way to provide custom labelsSelector from config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is entirely up to us to define, so I'm sure it can!

@@ -0,0 +1,45 @@
local host_matcher = 'job=~"$job", instance=~"$instance"';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite common that query selectors depend on config (instead of hardcoded job=~"$job" it could be user provided label selector). Does this packaging provide a way to provide custom host_matcher from config?

@v-zhuravlev
Copy link
Contributor

I think queries are better packed as targets (query + legend)

Copy link
Member

@Duologic Duologic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to see a more abstract description of the format, it's hard to untangle the format from the data in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants