flexport-observability
Set up observability for Flexport logistics integrations with metrics, structured logging, distributed tracing, and alerting dashboards. Trigger: "flexport monitoring", "flexport observability", "flexport metrics", "flexport alerts".
What this skill does
# Flexport Observability
## Overview
Full observability stack for Flexport integrations: Prometheus metrics for API health, pino structured logging for debugging, OpenTelemetry tracing for latency analysis, and Grafana dashboards for monitoring.
## Instructions
### Step 1: Prometheus Metrics
```typescript
import { Counter, Histogram, Gauge, register } from 'prom-client';
const flexportRequests = new Counter({
name: 'flexport_api_requests_total',
help: 'Total Flexport API requests',
labelNames: ['method', 'endpoint', 'status'],
});
const flexportLatency = new Histogram({
name: 'flexport_api_latency_seconds',
help: 'Flexport API response time',
labelNames: ['endpoint'],
buckets: [0.1, 0.25, 0.5, 1, 2.5, 5, 10],
});
const flexportRateLimit = new Gauge({
name: 'flexport_rate_limit_remaining',
help: 'Remaining API calls in current window',
});
// Instrumented fetch wrapper
async function instrumentedFlexport(path: string, options: RequestInit = {}) {
const endpoint = path.split('?')[0];
const timer = flexportLatency.startTimer({ endpoint });
try {
const res = await fetch(`https://api.flexport.com${path}`, { ...options, headers: { ...headers, ...options.headers } });
flexportRequests.inc({ method: options.method || 'GET', endpoint, status: res.status.toString() });
const remaining = res.headers.get('X-RateLimit-Remaining');
if (remaining) flexportRateLimit.set(parseInt(remaining));
timer();
return res;
} catch (err) {
flexportRequests.inc({ method: options.method || 'GET', endpoint, status: 'error' });
timer();
throw err;
}
}
```
### Step 2: Structured Logging
```typescript
import pino from 'pino';
const logger = pino({
name: 'flexport-integration',
level: process.env.LOG_LEVEL || 'info',
redact: ['headers.Authorization', 'apiKey'],
});
// Log every API call with context
async function loggedFlexport(path: string, options: RequestInit = {}) {
const start = Date.now();
const res = await instrumentedFlexport(path, options);
logger.info({
service: 'flexport',
path,
method: options.method || 'GET',
status: res.status,
latencyMs: Date.now() - start,
rateRemaining: res.headers.get('X-RateLimit-Remaining'),
}, 'Flexport API call');
return res;
}
```
### Step 3: Alert Rules
```yaml
# prometheus-alerts.yml
groups:
- name: flexport
rules:
- alert: FlexportAPIErrors
expr: rate(flexport_api_requests_total{status=~"5.."}[5m]) > 0.1
for: 5m
labels: { severity: critical }
annotations:
summary: "Flexport API error rate elevated"
- alert: FlexportRateLimitLow
expr: flexport_rate_limit_remaining < 10
for: 1m
labels: { severity: warning }
annotations:
summary: "Flexport rate limit nearly exhausted"
- alert: FlexportHighLatency
expr: histogram_quantile(0.99, flexport_api_latency_seconds_bucket) > 5
for: 5m
labels: { severity: warning }
```
### Grafana Dashboard Panels
| Panel | Query | Purpose |
|-------|-------|---------|
| Request rate | `rate(flexport_api_requests_total[5m])` | Throughput |
| Error rate | `rate(flexport_api_requests_total{status=~"4..\|5.."}[5m])` | Reliability |
| p99 latency | `histogram_quantile(0.99, rate(flexport_api_latency_seconds_bucket[5m]))` | Performance |
| Rate limit headroom | `flexport_rate_limit_remaining` | Quota |
## Resources
- [prom-client](https://github.com/siimon/prom-client)
- [pino](https://github.com/pinojs/pino)
- [Flexport Status](https://status.flexport.com)
## Next Steps
For incident response, see `flexport-incident-runbook`.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.