palantir-observability
Set up observability for Palantir Foundry integrations with metrics, logging, and alerts. Use when implementing monitoring for Foundry API calls, setting up dashboards, or configuring alerting for Foundry integration health. Trigger with phrases like "palantir monitoring", "foundry metrics", "palantir observability", "monitor foundry", "foundry alerts".
Best use case
palantir-observability is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Set up observability for Palantir Foundry integrations with metrics, logging, and alerts. Use when implementing monitoring for Foundry API calls, setting up dashboards, or configuring alerting for Foundry integration health. Trigger with phrases like "palantir monitoring", "foundry metrics", "palantir observability", "monitor foundry", "foundry alerts".
Teams using palantir-observability should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/palantir-observability/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How palantir-observability Compares
| Feature / Agent | palantir-observability | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Set up observability for Palantir Foundry integrations with metrics, logging, and alerts. Use when implementing monitoring for Foundry API calls, setting up dashboards, or configuring alerting for Foundry integration health. Trigger with phrases like "palantir monitoring", "foundry metrics", "palantir observability", "monitor foundry", "foundry alerts".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Palantir Observability
## Overview
Set up comprehensive observability for Foundry integrations: structured logging with request IDs, Prometheus metrics for API latency/errors, health check endpoints, and alert rules.
## Prerequisites
- Working Foundry integration
- Prometheus + Grafana (or equivalent monitoring stack)
- Familiarity with `palantir-prod-checklist`
## Instructions
### Step 1: Structured Logging
```python
import logging, json, time, uuid
class FoundryLogger:
def __init__(self):
self.logger = logging.getLogger("foundry")
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(message)s"))
self.logger.addHandler(handler)
self.logger.setLevel(logging.INFO)
def log_api_call(self, method: str, endpoint: str, status: int, duration_ms: float):
self.logger.info(json.dumps({
"timestamp": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),
"request_id": str(uuid.uuid4())[:8],
"service": "foundry",
"method": method,
"endpoint": endpoint,
"status": status,
"duration_ms": round(duration_ms, 2),
"level": "error" if status >= 400 else "info",
}))
```
### Step 2: Prometheus Metrics
```python
from prometheus_client import Counter, Histogram, Gauge
foundry_requests = Counter(
"foundry_api_requests_total",
"Total Foundry API requests",
["method", "endpoint", "status"],
)
foundry_latency = Histogram(
"foundry_api_latency_seconds",
"Foundry API request latency",
["endpoint"],
buckets=[0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0],
)
foundry_health = Gauge(
"foundry_api_healthy",
"1 if Foundry API is reachable, 0 otherwise",
)
def instrumented_call(client, method, *args, **kwargs):
endpoint = method.__qualname__
start = time.monotonic()
try:
result = method(*args, **kwargs)
status = 200
return result
except foundry.ApiError as e:
status = e.status_code
raise
finally:
duration = time.monotonic() - start
foundry_requests.labels(method="API", endpoint=endpoint, status=str(status)).inc()
foundry_latency.labels(endpoint=endpoint).observe(duration)
```
### Step 3: Health Check with Metrics
```python
import time
async def foundry_health_check():
start = time.monotonic()
try:
list(client.ontologies.Ontology.list())
latency = (time.monotonic() - start) * 1000
foundry_health.set(1)
return {"status": "healthy", "latency_ms": round(latency, 1)}
except Exception as e:
foundry_health.set(0)
return {"status": "unhealthy", "error": str(e)}
```
### Step 4: Alert Rules (Prometheus)
```yaml
groups:
- name: foundry
rules:
- alert: FoundryAPIDown
expr: foundry_api_healthy == 0
for: 2m
labels:
severity: critical
annotations:
summary: "Foundry API unreachable for 2+ minutes"
- alert: FoundryHighErrorRate
expr: rate(foundry_api_requests_total{status=~"5.."}[5m]) > 0.05
for: 5m
labels:
severity: warning
- alert: FoundryHighLatency
expr: histogram_quantile(0.99, foundry_api_latency_seconds_bucket) > 10
for: 10m
labels:
severity: warning
```
### Step 5: Dashboard Queries (Grafana)
```
# Request rate by status
rate(foundry_api_requests_total[5m])
# P99 latency
histogram_quantile(0.99, rate(foundry_api_latency_seconds_bucket[5m]))
# Error ratio
sum(rate(foundry_api_requests_total{status=~"[45].."}[5m]))
/ sum(rate(foundry_api_requests_total[5m]))
```
## Output
- Structured JSON logging with request IDs
- Prometheus metrics for requests, latency, and health
- Alert rules for API downtime, error rate, and latency
- Grafana dashboard queries
## Error Handling
| Alert | Threshold | Action |
|-------|-----------|--------|
| API Down | Health check fails 2min | Page on-call, check `palantir-incident-runbook` |
| High Error Rate | 5xx > 5% for 5min | Check Foundry status, review logs |
| High Latency | p99 > 10s for 10min | Review query complexity, check Foundry load |
| Rate Limited | 429 count spike | Tune rate limiter settings |
## Resources
- [Prometheus Python Client](https://github.com/prometheus/client_python)
- [Foundry API Reference](https://www.palantir.com/docs/foundry/api/general/overview/introduction)
## Next Steps
For multi-environment setup, see `palantir-multi-env-setup`.Related Skills
windsurf-observability
Monitor Windsurf AI adoption, feature usage, and team productivity metrics. Use when tracking AI feature usage, measuring ROI, setting up dashboards, or analyzing Cascade effectiveness across your team. Trigger with phrases like "windsurf monitoring", "windsurf metrics", "windsurf analytics", "windsurf usage", "windsurf adoption".
webflow-observability
Set up observability for Webflow integrations — Prometheus metrics for API calls, OpenTelemetry tracing, structured logging with pino, Grafana dashboards, and alerting for rate limits, errors, and latency. Trigger with phrases like "webflow monitoring", "webflow metrics", "webflow observability", "monitor webflow", "webflow alerts", "webflow tracing".
vercel-observability
Set up Vercel observability with runtime logs, analytics, log drains, and OpenTelemetry tracing. Use when implementing monitoring for Vercel deployments, setting up log drains, or configuring alerting for function errors and performance. Trigger with phrases like "vercel monitoring", "vercel metrics", "vercel observability", "vercel logs", "vercel alerts", "vercel tracing".
veeva-observability
Veeva Vault observability for enterprise operations. Use when implementing advanced Veeva Vault patterns. Trigger: "veeva observability".
vastai-observability
Monitor Vast.ai GPU instance health, utilization, and costs. Use when setting up monitoring dashboards, configuring alerts, or tracking GPU utilization and spending. Trigger with phrases like "vastai monitoring", "vastai metrics", "vastai observability", "monitor vastai", "vastai alerts".
twinmind-observability
Monitor TwinMind transcription quality, meeting coverage, action item extraction rates, and memory vault health. Use when implementing observability, or managing TwinMind meeting AI operations. Trigger with phrases like "twinmind observability", "twinmind observability".
speak-observability
Monitor Speak API health, assessment latency, session metrics, and pronunciation score distributions. Use when implementing observability, or managing Speak language learning platform operations. Trigger with phrases like "speak observability", "speak observability".
snowflake-observability
Set up Snowflake observability using ACCOUNT_USAGE views, alerts, and external monitoring. Use when implementing Snowflake monitoring dashboards, setting up query performance tracking, or configuring alerting for warehouse and pipeline health. Trigger with phrases like "snowflake monitoring", "snowflake metrics", "snowflake observability", "snowflake dashboard", "snowflake alerts".
shopify-observability
Set up observability for Shopify app integrations with query cost tracking, rate limit monitoring, webhook delivery metrics, and structured logging. Trigger with phrases like "shopify monitoring", "shopify metrics", "shopify observability", "monitor shopify API", "shopify alerts", "shopify dashboard".
salesforce-observability
Set up observability for Salesforce integrations with API limit monitoring, error tracking, and alerting. Use when implementing monitoring for Salesforce operations, tracking API consumption, or configuring alerting for Salesforce integration health. Trigger with phrases like "salesforce monitoring", "salesforce metrics", "salesforce observability", "monitor salesforce", "salesforce alerts", "salesforce API usage dashboard".
retellai-observability
Retell AI observability — AI voice agent and phone call automation. Use when working with Retell AI for voice agents, phone calls, or telephony. Trigger with phrases like "retell observability", "retellai-observability", "voice agent".
replit-observability
Monitor Replit deployments with health checks, uptime tracking, resource usage, and alerting. Use when setting up monitoring for Replit apps, building health dashboards, or configuring alerting for deployment health and performance. Trigger with phrases like "replit monitoring", "replit metrics", "replit observability", "monitor replit", "replit alerts", "replit uptime".