diff --git a/components/inspectit-ocelot-configurationserver-ui/src/components/views/configuration/ConfigurationView.js b/components/inspectit-ocelot-configurationserver-ui/src/components/views/configuration/ConfigurationView.js
index 1a3498059d..5a44cd26b4 100644
--- a/components/inspectit-ocelot-configurationserver-ui/src/components/views/configuration/ConfigurationView.js
+++ b/components/inspectit-ocelot-configurationserver-ui/src/components/views/configuration/ConfigurationView.js
@@ -165,7 +165,7 @@ class ConfigurationView extends React.Component {
* If no version is specified, the latest version will be selected.
*/
openFile = (filename, versionId = null) => {
- if (this.props.selectedVersion != versionId) {
+ if (this.props.selectedVersion !== versionId) {
this.props.selectVersion(versionId, false);
}
this.props.selectFile(filename);
@@ -191,7 +191,6 @@ class ConfigurationView extends React.Component {
canWrite,
} = this.props;
const showEditor = (selection || selectedDefaultConfigFile) && !isDirectory;
-
const { path, name } = this.parsePath(selection, selectedDefaultConfigFile);
const icon = 'pi-' + (isDirectory ? 'folder' : 'file');
const showHeader = !!name;
@@ -199,7 +198,6 @@ class ConfigurationView extends React.Component {
const readOnly = !canWrite || !!selectedDefaultConfigFile || !isLatestVersion;
const fileContentWithoutFirstLine = fileContent ? fileContent.split('\n').slice(1).join('\n') : '';
-
return (
+ }
+ >
+ {error ? (
+
+ ) : (
+ <>
+
+
+ The agent is in an
+ {healthInfo}
+ state
+
+
+ {latestIncidentElement}
+ {historyElements}
+ >
+ )}
+
+ >
+ );
+};
+
+AgentHealthStateDialogue.propTypes = {
+ /** Whether a error is thrown */
+ error: PropTypes.bool,
+ /** Whether the dialog is visible */
+ visible: PropTypes.bool,
+ /** Callback on dialog hide */
+ onHide: PropTypes.func,
+ /** The string value being displayed. E.g. the logs.*/
+ contentValue: PropTypes.string,
+ /** The type of content. E.g. config or log.*/
+ contentType: PropTypes.string,
+ /** The name of the data's context. E.g. the agent whose logs are being shown.*/
+ contextName: PropTypes.string,
+};
+
+AgentHealthStateDialogue.defaultProps = {
+ error: false,
+ visible: true,
+ onHide: () => {},
+ contentValue: 'No content found',
+ contentType: '',
+};
+
+const resolveHealthState = (health) => {
+ switch (health) {
+ case 'OK':
+ return {
+ healthInfo: ' OK ',
+ iconClass: 'pi-check-circle',
+ iconColor: '#0abd04',
+ };
+ case 'WARNING':
+ return {
+ healthInfo: ' Warning ',
+ iconClass: 'pi-minus-circle',
+ iconColor: '#e8c413',
+ };
+ }
+ return {
+ healthInfo: ' Error ',
+ iconClass: 'pi-times-circle',
+ iconColor: 'red',
+ };
+};
+
+export default AgentHealthStateDialogue;
diff --git a/components/inspectit-ocelot-configurationserver-ui/src/lib/axios-api.js b/components/inspectit-ocelot-configurationserver-ui/src/lib/axios-api.js
index 0bff230596..3b4830d162 100644
--- a/components/inspectit-ocelot-configurationserver-ui/src/lib/axios-api.js
+++ b/components/inspectit-ocelot-configurationserver-ui/src/lib/axios-api.js
@@ -18,7 +18,7 @@ const axiosBearer = axios.create(commonConfiguration);
// Request Interceptors
/**
- * Ensures requres are authenticated using the bearer token.
+ * Ensures requests are authenticated using the bearer token.
*/
axiosBearer.interceptors.request.use(
function (config) {
diff --git a/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/agentstatus/AgentStatus.java b/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/agentstatus/AgentStatus.java
index 59a52df5a8..7469207d7e 100644
--- a/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/agentstatus/AgentStatus.java
+++ b/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/agentstatus/AgentStatus.java
@@ -4,7 +4,7 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
-import rocks.inspectit.ocelot.commons.models.health.AgentHealth;
+import rocks.inspectit.ocelot.commons.models.health.AgentHealthState;
import java.util.Date;
import java.util.Map;
@@ -47,5 +47,5 @@ public class AgentStatus {
/**
* The health status of the agent.
*/
- private AgentHealth health;
+ private AgentHealthState healthState;
}
diff --git a/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/agentstatus/AgentStatusManager.java b/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/agentstatus/AgentStatusManager.java
index 6c556e7106..259ffeea81 100644
--- a/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/agentstatus/AgentStatusManager.java
+++ b/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/agentstatus/AgentStatusManager.java
@@ -1,5 +1,8 @@
package rocks.inspectit.ocelot.agentstatus;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectReader;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
@@ -8,6 +11,7 @@
import org.springframework.stereotype.Component;
import rocks.inspectit.ocelot.agentconfiguration.AgentConfiguration;
import rocks.inspectit.ocelot.commons.models.health.AgentHealth;
+import rocks.inspectit.ocelot.commons.models.health.AgentHealthState;
import rocks.inspectit.ocelot.config.model.InspectitServerSettings;
import javax.annotation.PostConstruct;
@@ -79,19 +83,28 @@ public void notifyAgentConfigurationFetched(Map agentAttributes,
}
if (headers.containsKey(HEADER_AGENT_HEALTH)) {
- AgentHealth agentHealth = AgentHealth.valueOf(headers.get(HEADER_AGENT_HEALTH));
- agentStatus.setHealth(agentHealth);
- logHealthIfChanged(statusKey, agentHealth);
+ ObjectReader objectReader = new ObjectMapper().reader().forType(AgentHealthState.class);
+
+ AgentHealthState agentHealthState = null;
+ try {
+ agentHealthState = objectReader.readValue(headers.get(HEADER_AGENT_HEALTH));
+ } catch (JsonProcessingException e) { //If this exception occurs we assume the corresponding agent uses the legacy health indicator.
+ AgentHealth agentHealth = AgentHealth.valueOf(headers.get(HEADER_AGENT_HEALTH));
+ agentHealthState = AgentHealthState.defaultState();
+ agentHealthState.setHealth(agentHealth);
+ }
+ agentStatus.setHealthState(agentHealthState);
+ logHealthIfChanged(statusKey, agentHealthState);
}
attributesToAgentStatusCache.put(statusKey, agentStatus);
}
- private void logHealthIfChanged(Object statusKey, AgentHealth agentHealth) {
+ private void logHealthIfChanged(Object statusKey, AgentHealthState agentHealthState) {
AgentStatus lastStatus = attributesToAgentStatusCache.getIfPresent(statusKey);
- if (lastStatus == null || lastStatus.getHealth() != agentHealth) {
- log.info("Health of agent {} changed to {}.", statusKey, agentHealth);
+ if (lastStatus == null || lastStatus.getHealthState().getHealth() != agentHealthState.getHealth()) {
+ log.info("Health of agent {} changed to {}.", statusKey, agentHealthState);
}
}
diff --git a/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/rest/yamlhighlighter/HighlightRulesMapController.java b/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/rest/yamlhighlighter/HighlightRulesMapController.java
index a5c925ea91..a93ba4f4a4 100644
--- a/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/rest/yamlhighlighter/HighlightRulesMapController.java
+++ b/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/rest/yamlhighlighter/HighlightRulesMapController.java
@@ -9,11 +9,9 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import rocks.inspectit.ocelot.config.model.InspectitConfig;
-import rocks.inspectit.ocelot.config.model.exporters.TransportProtocol;
import rocks.inspectit.ocelot.config.model.instrumentation.actions.GenericActionSettings;
import rocks.inspectit.ocelot.rest.AbstractBaseController;
-import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.util.*;
diff --git a/components/inspectit-ocelot-configurationserver/src/main/resources/application.yml b/components/inspectit-ocelot-configurationserver/src/main/resources/application.yml
index 91aa4402e6..20b5b0640e 100644
--- a/components/inspectit-ocelot-configurationserver/src/main/resources/application.yml
+++ b/components/inspectit-ocelot-configurationserver/src/main/resources/application.yml
@@ -22,6 +22,7 @@ spring:
# server properties - see https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#server-properties
server:
port: 8090
+ max-http-header-size: 1MB
inspectit-config-server:
# the directory which is used as working directory
diff --git a/components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/rest/yamlhighlighter/HighlightRulesMapControllerIntTest.java b/components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/rest/yamlhighlighter/HighlightRulesMapControllerIntTest.java
index dd42c06432..5c7de942a1 100644
--- a/components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/rest/yamlhighlighter/HighlightRulesMapControllerIntTest.java
+++ b/components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/rest/yamlhighlighter/HighlightRulesMapControllerIntTest.java
@@ -16,7 +16,6 @@
import rocks.inspectit.ocelot.config.model.instrumentation.data.PropagationMode;
import rocks.inspectit.ocelot.config.model.instrumentation.scope.AdvancedScopeSettings;
-
import java.util.List;
import java.util.Map;
diff --git a/inspectit-ocelot-config/build.gradle b/inspectit-ocelot-config/build.gradle
index 7edbeee095..7b3508ea94 100644
--- a/inspectit-ocelot-config/build.gradle
+++ b/inspectit-ocelot-config/build.gradle
@@ -38,7 +38,6 @@ dependencies {
libs.orgApacheCommonsCommonsLang3,
libs.commonsIo,
libs.comFasterxmlJacksonCoreJacksonDatabind,
-
// logging
libs.chQosLogbackLogbackClassic,
)
diff --git a/inspectit-ocelot-config/src/main/java/rocks/inspectit/ocelot/commons/models/health/AgentHealthIncident.java b/inspectit-ocelot-config/src/main/java/rocks/inspectit/ocelot/commons/models/health/AgentHealthIncident.java
new file mode 100644
index 0000000000..2a55d81948
--- /dev/null
+++ b/inspectit-ocelot-config/src/main/java/rocks/inspectit/ocelot/commons/models/health/AgentHealthIncident.java
@@ -0,0 +1,28 @@
+package rocks.inspectit.ocelot.commons.models.health;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class AgentHealthIncident implements Comparable