Skip to content

observeco/context

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Observe Context

API service for storing and querying observability context

Status: v0.1.0 (Alpha)


Overview

Observe Context is a centralized API service that stores, indexes, and serves observability metrics, logs, and traces.

Features

  • ✅ RESTful API for metrics ingestion
  • ✅ Query language for complex filtering
  • ✅ Time-series data storage
  • ✅ Integration with Observe Pulse
  • ✅ GraphQL API for flexible queries
  • ✅ Rate limiting and authentication
  • ✅ Scalable architecture

Architecture

┌─────────────┐
│   Pulse     │
│  (Metrics)  │
└──────┬──────┘
       │
       ▼
┌─────────────┐
│   Context   │
│   (API)     │
└──────┬──────┘
       │
       ▼
┌─────────────┐
│  Database   │
│ (TimeSeries)│
└─────────────┘

Quick Start

Using Docker (Recommended)

# Clone the repository
git clone https://github.com/observeco/context.git
cd context

# Start with Docker Compose
docker-compose up -d

# API available at http://localhost:8080
# GraphQL at http://localhost:8080/graphql

From Source

# Install dependencies
go mod download

# Run the server
go run cmd/server/main.go

# Server starts on http://localhost:8080

API Endpoints

Health Check

GET /health

Ingest Metrics

POST /api/v1/metrics
Content-Type: application/json

{
  "name": "cpu_usage",
  "value": 45.2,
  "timestamp": "2026-05-21T14:30:00Z",
  "labels": {
    "host": "server-1",
    "region": "us-east"
  }
}

Query Metrics

GET /api/v1/metrics?name=cpu_usage&host=server-1&from=1h

GraphQL Query

query GetMetrics($name: String!, $from: String!) {
  metrics(name: $name, from: $from) {
    timestamp
    value
    labels
  }
}

Configuration

Create .env file:

# Server
PORT=8080
HOST=0.0.0.0

# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=observe_context
DB_USER=postgres
DB_PASSWORD=your_password

# Redis (for caching)
REDIS_HOST=localhost
REDIS_PORT=6379

# Auth
JWT_SECRET=your-secret-key

# Rate Limiting
RATE_LIMIT=1000
RATE_WINDOW=1m

Development

# Run tests
go test ./...

# Run with hot reload (using air)
air

# Generate GraphQL schema
go run cmd/generate/main.go

# Build binary
go build -o context-server cmd/server/main.go

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Open a Pull Request

License

MIT License - see LICENSE for details.


Support


ObservecO - Context for your observability.

About

API service for storing and querying observability context

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages