Yes it is possible.
Logs as a dataset for analysis
A few components and things are needed.
1. The streaming dataset of logs of the functions
You can setup a stream dataset to receive the logs of all functions executed in a particular scope (e.g. a project).
This stream dataset should be created by organization administrator, and is per caller organization (who queries the functions) not per space (whenever this function is called, regardless of the source).
Given this can contain sensitive data (inputs/outputs of the calls) this is highly recommended to add security Markings to it.
Streaming dataset logging, see: https://www.palantir.com/docs/foundry/administration/configure-logging
2. Add logging to your functions
Logging, see: https://www.palantir.com/docs/foundry/aip-observability/service-logs-and-debugging/#permission-required
For typescript v1, any “console.log” will be visible in the logs/logging-dataset.
For typescript v2, you need to use a logger, like:
import { logs } from "@opentelemetry/api-logs";
const logger = logs.getLogger("helloWorld_loggintest");
function helloWorld_loggintest(): string {
console.log("This is some log I would like to see in the datasets of logs ! SEARCHFORME")
// TypeScript v2 example - Good logging practices
logger.emit({
severityText: "INFO",
attributes: { LOG_MESSAGE: "ter This is some log I would like to see in the datasets of logs ! SEARCHFORME" }, // Include relevant IDs
body: { },
});
return "Hello World!";
}
export default helloWorld_loggintest;
For Python, this is not yet (but should be soon) available.
From there, you will see the logs, including the custom logging, in the streaming dataset.
Example contour analysis on this dataset
Alternative - Workflow Lineage
Note that you can see the logs of your functions directly in Workflow Lineage:
You might want to configure the logs-access in Control Panel to allow all users to access all logs.
See https://palantir.com/docs/foundry/administration/configure-logging/#in-platform-log-access-for-ontology-and-aip-workflows and https://www.palantir.com/docs/foundry/aip-observability/log-permissioning