Skip to content

Commit

Permalink
Extend logging (#1645)
Browse files Browse the repository at this point in the history
* extend logging

* extend logback

* extend ui logs

* extend fetch logging
  • Loading branch information
EddeCCC authored Jan 30, 2024
1 parent 7edf559 commit 05e1683
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,19 @@ class StatusTable extends React.Component {

agentHealthTemplate = (rowData) => {
const { onShowHealthStateDialog } = this.props;
const { healthState, metaInformation } = rowData;
const { health } = healthState;
const { agentId } = metaInformation;
const { onShowDownloadDialog } = this.props;
const { metaInformation } = rowData;
const { agentId } = metaInformation;
// TODO Remove console.error() after agent health issues are solved
let health;
let healthState;
try {
healthState = rowData['healthState'];
health = healthState['health'];
} catch (error) {
console.error(`Could not read agent health from ${agentId}`, error);
console.error(rowData);
}

let { agentCommandsEnabled, supportArchiveAvailable } = this.resolveServiceAvailability(metaInformation);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ private synchronized void reloadConfigurationAsync() {
*/
public AgentConfiguration getConfiguration(Map<String, String> agentAttributes) {
AgentConfiguration myConfig = attributesToConfigurationCache.getUnchecked(agentAttributes);
log.debug("Found agent configuration: {}", myConfig != NO_MATCHING_MAPPING);
return myConfig == NO_MATCHING_MAPPING ? null : myConfig;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public void notifyAgentConfigurationFetched(Map<String, String> agentAttributes,
logHealthIfChanged(statusKey, agentHealthState);
}

log.debug("Storing agent status of {}: ({})", statusKey, agentStatus);
attributesToAgentStatusCache.put(statusKey, agentStatus);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public void e(Exception e) {
@GetMapping(value = {"agent/configuration", "agent/configuration/"}, produces = "application/x-yaml")
public ResponseEntity<String> fetchConfiguration(@Parameter(description = "The agent attributes used to select the correct mapping") @RequestParam Map<String, String> attributes, @RequestHeader Map<String, String> headers) {
log.debug("Fetching the agent configuration for agent ({})", attributes.toString());
log.debug("Receiving agent headers ({})", headers.toString());
AgentConfiguration configuration = configManager.getConfiguration(attributes);
statusManager.notifyAgentConfigurationFetched(attributes, headers, configuration);
if (configuration == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
<logger name="rocks.inspectit.ocelot.rest.agent" level="debug">
<appender-ref ref="accessFile"/>
</logger>
<!-- Additional configuration fetch debugging -->
<logger name="rocks.inspectit.ocelot.agentstatus" level="debug">
<appender-ref ref="accessFile"/>
</logger>
<logger name="rocks.inspectit.ocelot.agentconfiguration" level="debug">
<appender-ref ref="accessFile"/>
</logger>

<!-- User access logger -->
<logger name="rocks.inspectit.ocelot.filters.AccessLogFilter">
Expand All @@ -68,4 +75,4 @@
<appender-ref ref="comFile"/>
</root>

</configuration>
</configuration>

0 comments on commit 05e1683

Please sign in to comment.