Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EddeCCC committed Oct 10, 2024
1 parent b194fc6 commit 0b5f2ac
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ inspectIT Gepard is the further development of [inspectIT Ocelot](https://github
While the inspectIT Ocelot Java agent is self-made, inspectIT Gepard uses the OpenTelemetry Java agent as basis
and extends it with features from inspectIT Ocelot.

## Main Features

We want to enable **dynamic instrumentation** with the OpenTelemetry agent.
This means, that you can change your instrumentation **during runtime**.
For example, you can add new methods to your tracing or record data for new metrics, everything without restarting your application!

The instrumentation configuration will be fetched from a remote server regularly.
The server's url is configurable via the property `inspectit.config.http.url`

We are also developing our own [configuration server](https://github.com/inspectIT/inspectit-gepard-agentmanager).

## Installation

To build this extension project, run `./gradlew build` or `./gradlew extendedAgent` (no tests).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public AgentBuilder extend(AgentBuilder agentBuilder, ConfigProperties config) {
NotificationManager notificationManager = NotificationManager.create();
notificationManager.sendStartNotification();

// Set our the global OpenTelemetry instance. For now, we use the Agent SDK
// Set our global OpenTelemetry instance. For now, we use the Agent SDK
OpenTelemetryAccessor.setOpenTelemetry(GlobalOpenTelemetry.get());

// Set up methods hooks to execute inspectIT code inside target applications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public SpanAction() {
* @return the scope of the started span
*/
public AutoCloseable startSpan(String spanName) {
Span.current().getSpanContext();

Tracer tracer = openTelemetry.getTracer(INSTRUMENTATION_SCOPE_NAME);
Span span = tracer.spanBuilder(spanName).setParent(Context.current()).startSpan();
return span.makeCurrent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public class LogUtils {
* @param times the amount of times "HELLO GEPARD" and "BYE GEPARD" should be present in the logs
*/
public static void assertLogs(String logs, int times) {
boolean loggedHelloGepardTwice = containsTimes(logs, "HELLO GEPARD", times);
boolean loggedByeGepardTwice = containsTimes(logs, "BYE GEPARD", times);
boolean loggedHelloGepard = containsTimes(logs, "HELLO GEPARD", times);
boolean loggedByeGepard = containsTimes(logs, "BYE GEPARD", times);

assertTrue(loggedHelloGepardTwice);
assertTrue(loggedByeGepardTwice);
assertTrue(loggedHelloGepard);
assertTrue(loggedByeGepard);
}

/**
Expand Down

0 comments on commit 0b5f2ac

Please sign in to comment.