Skip to content

Commit

Permalink
Add jvm observ lib (grafana#1220)
Browse files Browse the repository at this point in the history
* Add process lib

* Add jvm-observ-lib

* Update jvm-mixin

* Remove empty rules file

* Update spring boot mixin

* Update jvm mixin

* Conditional rows inclusing

* Update README

* Fix otel uptime signal query

* Move panels inside rows.
Use resolveCollapsedFlagOnRows

* Update lib

* Fix commonlib(in case of stub type)

* Update deps

* Remove collapsed rows
  • Loading branch information
v-zhuravlev authored Jul 29, 2024
1 parent aa29d29 commit c66541c
Show file tree
Hide file tree
Showing 48 changed files with 2,101 additions and 4,532 deletions.
2 changes: 1 addition & 1 deletion common-lib/common/signal/signal.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ local stub = import './stub.libsonnet';
)
else if type == 'stub' then
stub.new(
name=name,
signalName=name,
type=type,
),
},
Expand Down
10 changes: 5 additions & 5 deletions common-lib/common/signal/stub.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local signalUtils = import './utils.libsonnet';

{
new(
name,
signalName,
type,
): {

Expand All @@ -18,21 +18,21 @@ local signalUtils = import './utils.libsonnet';
//Return query, usable in alerts/recording rules. No aggregation is applied.
asRuleExpression():: {},
//Return as timeSeriesPanel
asTimeSeries(name)::
asTimeSeries(name=signalName)::
g.panel.text.new('')
+ g.panel.text.panelOptions.withTransparent(true)
+ g.panel.text.panelOptions.withDescription(name + ': Signal not found.')
+ g.panel.text.options.withContent(''),

//Return as statPanel
asStat(name)::
asStat(name=signalName)::
self.asTimeSeries(),

asTable(name, format)::
asTable(name=signalName, format)::
self.asTimeSeries(),

//Return as timeSeriesPanel
asGauge(name)::
asGauge(name=signalName)::
self.asTimeSeries(),
asTableColumn(override, format):: {},
},
Expand Down
8 changes: 8 additions & 0 deletions jvm-mixin/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lint:
mixtool lint mixin.libsonnet

build:
mixtool generate all mixin.libsonnet

clean:
rm -rf dashboards_out alerts.yaml rules.yaml
8 changes: 3 additions & 5 deletions jvm-mixin/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# JVM Integration

This integration works with the [Java client](https://github.com/prometheus/client_java). It requires each JVM application to export the metrics with the client.

The dashboard is a fork of [Joel Takvorian's design](https://grafana.com/grafana/dashboards/3066).
# JVM integration

This integration works with the [Java client](https://prometheus.github.io/client_java/instrumentation/jvm/). It requires each JVM application to export the metrics with the client.
Uses [JVM observability lib](../jvm-observ-lib/).
23 changes: 0 additions & 23 deletions jvm-mixin/alerts.libsonnet

This file was deleted.

10 changes: 10 additions & 0 deletions jvm-mixin/config.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
filteringSelector: 'job!=""',
groupLabels: ['job'],
instanceLabels: ['instance'],
uid: 'jvm',
dashboardNamePrefix: '',
dashboardTags: ['java', 'jvm', 'prometheus_client'],
metricsSource: 'prometheus',
alertHeapWarning: 80, // %
}
7 changes: 0 additions & 7 deletions jvm-mixin/dashboards.libsonnet

This file was deleted.

22 changes: 22 additions & 0 deletions jvm-mixin/jsonnetfile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": 1,
"dependencies": [
{
"source": {
"local": {
"directory": "../common-lib"
}
},
"version": ""
},
{
"source": {
"local": {
"directory": "../jvm-observ-lib"
}
},
"version": ""
}
],
"legacyImports": true
}
Loading

0 comments on commit c66541c

Please sign in to comment.