Skip to content

Commit a17ed03

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # .github/workflows/on_release.yml
2 parents bd2a857 + a337025 commit a17ed03

File tree

44 files changed

+1512
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1512
-85
lines changed

.github/workflows/on_push.yml

+17
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
java-version: '11'
4747
distribution: 'temurin'
4848
cache: 'maven'
49+
4950
- name: Check Formatting
5051
run: make lint
5152

@@ -60,6 +61,7 @@ jobs:
6061
java-version: '11'
6162
distribution: 'temurin'
6263
cache: 'maven'
64+
6365
- name: Run PMD check
6466
run: make pmd
6567

@@ -75,6 +77,21 @@ jobs:
7577
java-version: '11'
7678
distribution: 'temurin'
7779
cache: 'maven'
80+
7881
- name: Run docs check
7982
run: make docs
8083

84+
compile:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v3
88+
89+
- name: Set up JDK 11
90+
uses: actions/setup-java@v3
91+
with:
92+
java-version: '11'
93+
distribution: 'temurin'
94+
cache: 'maven'
95+
96+
- name: Run compile check
97+
run: make compile

.idea/encodings.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sdkman

-1
This file was deleted.

.sdkmanrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Enable auto-env through the sdkman_auto_env config
22
# Add key=value pairs of SDKs to use below
33
java=13.0.2-open
4+
maven=3.9.6

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 1.2.0 (xx/xx/2023)
2+
- **[CHANGE]**: update: Update deep proto to 1.0.3 [#74](https://github.com/intergral/deep/pull/74) [@Umaaz](https://github.com/Umaaz)
23
- **[CHANGE]**: plugin: Change the plugins to use SPI to load [#77](https://github.com/intergral/deep/pull/77) [@Umaaz](https://github.com/Umaaz)
4+
- **[FEATURE]**: metrics: Add support for metrics from tracepoints [#74](https://github.com/intergral/deep/pull/74) [@Umaaz](https://github.com/Umaaz)
35

46
# 1.1.2 (29/09/2023)
57
- **[CHANGE]**: version: Override grpc-netty dependencies to remove CVE [#44](https://github.com/intergral/deep/pull/44) [@LMarkie](https://github.com/LMarkie)

Makefile

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,61 @@
1+
# This file just contains shortcuts for dev, as there are a lot of options for different builds
12

2-
3+
# Run the PMD check - while skipping tests
4+
# Doesn't run PMD on it tests or examples
35
.PHONY: pmd
46
pmd:
57
mvn -U -B verify -Ppmd -DskipTests $(MVN_ARGS)
68

9+
# Run lint on all code
710
,PHONY: lint
811
lint:
912
mvn -U -B validate -Plint,examples,cf-it-tests $(MVN_ARGS)
1013

14+
# Package and verify all code expect cf-tests and examples
1115
.PHONY: test
1216
test:
1317
mvn -U -B clean verify $(MVN_ARGS)
1418

19+
# Generate documentation from source
1520
.PHONY: docs
1621
docs:
1722
mvn -s .ci-settings.xml clean package javadoc:jar -DskipTests -P release-ossrh -B -U -pl agent,deep --also-make $(MVN_ARGS)
1823

24+
# Generate the agent and rebuild all the dependant modules
1925
.PHONY: package-agent
2026
package:
2127
mvn package -U -B -pl agent --also-make -DskipTests $(MVN_ARGS)
2228

29+
# Run the CF it tests
2330
.PHONY: cf-tests
2431
cf-tests: package
2532
mvn verify -U -B -P cf-it-tests -pl it-tests/cf-tests --also-make $(MVN_ARGS)
26-
# This file just contains shortcuts for dev, as there are a lot of options for different builds
2733

34+
# Build the agent and deep, also rebuild all dependant modules
2835
.PHONY: build
2936
build:
3037
mvn clean package -U -B -pl agent,deep --also-make $(MVN_ARGS)
3138

32-
39+
# Install the agent and deep into the local repo (~/.m2)
3340
.PHONY: install
3441
install:
3542
mvn clean install -U -B -pl agent,deep --also-make $(MVN_ARGS)
3643

44+
# Run the coverage checks
3745
.PHONY: coverage
3846
coverage:
3947
mvn clean verify -U -B -P coverage -pl '!it-tests/java-tests,!it-tests'
4048

49+
# Compile all modules
50+
.PHONY: compile
51+
compile:
52+
mvn clean compile -U -B -P cf-it-tests,coverage,docs,examples,lint,pmd
53+
54+
# Combine a few common checks in a single task
4155
.PHONY: precommit
4256
precommit:
4357
$(MAKE) lint
4458
$(MAKE) pmd
4559
$(MAKE) coverage
46-
$(MAKE) docs
60+
$(MAKE) docs
61+
$(MAKE) compile

agent-api/src/main/java/com/intergral/deep/agent/api/IDeep.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.intergral.deep.agent.api;
1919

20+
import com.intergral.deep.agent.api.plugin.MetricDefinition;
2021
import com.intergral.deep.agent.api.tracepoint.ITracepoint.ITracepointRegistration;
2122
import java.util.Collection;
2223
import java.util.Map;
@@ -70,8 +71,9 @@ public interface IDeep {
7071
* @param line the line number
7172
* @param args the key value pairs that further define the tracepoint
7273
* @param watches the list of watch expressions
74+
* @param metrics the list of metric expressions
7375
* @return a {@link ITracepointRegistration} that can be used to remove the tracepoint
7476
*/
7577
ITracepointRegistration registerTracepoint(final String path, final int line, final Map<String, String> args,
76-
final Collection<String> watches);
78+
final Collection<String> watches, final Collection<MetricDefinition> metrics);
7779
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* Copyright (C) 2023 Intergral GmbH
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Affero General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.intergral.deep.agent.api.plugin;
19+
20+
import java.util.Map;
21+
22+
/**
23+
* This type defines a processor for metrics. This type can be added to plugins to allow metric generated by tracepoints to be attached to
24+
* various metric engines.
25+
*/
26+
public interface IMetricProcessor {
27+
28+
/**
29+
* Process a counter type metric.
30+
*
31+
* @param name the name of the metric
32+
* @param labels the labels attached to the metric
33+
* @param namespace the namespace the metric should be in
34+
* @param help the help statement for the metric
35+
* @param unit the unit for the metric
36+
* @param value the value to post to the metric
37+
*/
38+
void counter(final String name, final Map<String, Object> labels, final String namespace, final String help, final String unit,
39+
final Double value);
40+
41+
/**
42+
* Process a gauge type metric.
43+
*
44+
* @param name the name of the metric
45+
* @param labels the labels attached to the metric
46+
* @param namespace the namespace the metric should be in
47+
* @param help the help statement for the metric
48+
* @param unit the unit for the metric
49+
* @param value the value to post to the metric
50+
*/
51+
void gauge(final String name, final Map<String, Object> labels, final String namespace, final String help, final String unit,
52+
final Double value);
53+
54+
/**
55+
* Process a histogram type metric.
56+
*
57+
* @param name the name of the metric
58+
* @param labels the labels attached to the metric
59+
* @param namespace the namespace the metric should be in
60+
* @param help the help statement for the metric
61+
* @param unit the unit for the metric
62+
* @param value the value to post to the metric
63+
*/
64+
void histogram(final String name, final Map<String, Object> labels, final String namespace, final String help, final String unit,
65+
final Double value);
66+
67+
/**
68+
* Process a summary type metric.
69+
*
70+
* @param name the name of the metric
71+
* @param labels the labels attached to the metric
72+
* @param namespace the namespace the metric should be in
73+
* @param help the help statement for the metric
74+
* @param unit the unit for the metric
75+
* @param value the value to post to the metric
76+
*/
77+
void summary(final String name, final Map<String, Object> labels, final String namespace, final String help, final String unit,
78+
final Double value);
79+
}

0 commit comments

Comments
 (0)