Observability#

Colectica Portal supports observability using structured logs, OpenTelemetry, and a health check endpoint. Structured log events are written for all REST API requests, page loads, MCP tool calls, and other user activities. Structured logs and OpenTelemetry can be imported into various log analysis systems.

Collect OpenTelemetry#

OpenTelemetry reporting can be enabled by setting the OpenTelemetry:Enabled settings in appsettings.json. The Colectica Repository will report OpenTelemetry traces for all HTTP client calls, Elasticsearch integration, database access, and individual web requests. OpenTelemetry exporter options are controlled via the standard environmental variables. For more details on editing these settings, see Configuration.

Structured Logs#

Log files are written to the directory named by the Serilog:DiskLocation setting, which defaults to the logs directory inside the application directory. Structured logs can additionally be written to disk as JSON or POSTed to an HTTP end point. To configure where structured logs are written, use the Serilog:StructuredDiskLocation and Serilog:HttpLocation settings in appsettings.json. For more details on editing these settings, see Configuration.

Health Checks#

The endpoint https://{example.org}/healthz returns the plain text Healthy or Unhealthy for use by load balancers and monitoring systems. It checks the connection to the portal database, the connection to Elasticsearch when Elasticsearch is enabled, and the free disk space on the cache and log drives. The disk space thresholds are set with the RepositorySettings:HealthChecks settings.

External Log Dashboards#

If your logs are ingested into a log analysis system that provides a dashboard, you can link to that dashboard from the Colectica Portal administration dashboard. Use the Admin:ExternalDashboardUrl setting in appsettings.json to configure this. For more details on editing these settings, see Configuration.

Elasticsearch, Logstash, and Kibana#

One commonly used platform for ingesting, storing, and analyzing log files is the ELK stack: Elasticsearch, Logstash, and Kibana.

A sample Kibana dashboard configuration is included with the Colectica Portal package. It can be found at PortalDir/Config.dist/kibana-dashboard.json.

For more information, see https://www.elastic.co/what-is/elk-stack.