Skip to content

feat: implement ow-exporter for Overwatch 2 profile statistics #439

@lexfrei

Description

@lexfrei

Implement ow-exporter for Overwatch 2 Profile Statistics

Overview

Create a new Overwatch 2 statistics exporter that scrapes player profiles and exposes metrics via Prometheus. This replaces the old OW1 exporter that was removed.

Analysis Completed ✅

  • Downloaded and analyzed two sample profiles
  • Identified platform separation (PC/Console)
  • Found game mode separation (Quick Play/Competitive)
  • Mapped 15 core metrics with CSS selectors
  • Confirmed HTML parsing approach (no headless browser needed)

Technical Requirements

Architecture

cmd/ow-exporter/
├── main.go                    # HTTP server + CLI
├── api/                      # REST API for user management
├── scraper/                  # HTML parsing and HTTP client  
├── storage/                  # SQLite for users, memory cache for stats
├── metrics/                  # Prometheus exporter
├── models/                   # Data structures
└── config/                   # Configuration

Features

  • Platform support (PC/Console)
  • Game mode support (Quick Play/Competitive)
  • 15 hardcoded metrics (time played, win rate, etc.)
  • REST API for user management
  • SQLite storage for persistence
  • Prometheus metrics export
  • Background scheduler (5min intervals)
  • Rate limiting and error handling

Prometheus Labels

ow_hero_time_played_seconds{
    username="player1",
    hero="mercy", 
    platform="pc",        # "pc" | "console"
    gamemode="competitive" # "quickplay" | "competitive"
}

API Endpoints

  • GET /api/users - list users
  • POST /api/users - add user (username + profile_id)
  • PUT /api/users/{username} - update user
  • DELETE /api/users/{username} - remove user
  • GET /metrics - Prometheus metrics
  • GET /health - health check

Implementation Plan

  1. Create basic project structure
  2. Implement HTML parser with platform support
  3. Add SQLite storage for user management
  4. Create REST API endpoints
  5. Implement Prometheus metrics exporter
  6. Add background scheduler
  7. Add error handling and rate limiting
  8. Update container build configuration
  9. Add documentation and examples

Success Criteria

  • Can add users via REST API
  • Automatically scrapes profiles every 5 minutes
  • Exports Prometheus metrics with platform/gamemode labels
  • Handles both PC and Console statistics
  • Supports Quick Play and Competitive modes
  • Works with current Overwatch 2 profile URLs

Test Profile URLs

  • https://overwatch.blizzard.com/en-us/career/de5bb4aca17492e0bba120a1d1%7Ca92a11ef8d304356fccfff8df12e1dc6/
  • https://overwatch.blizzard.com/en-us/career/c14aad9eba729abefdf565bdd606a600%7C20e30637fb9054272d5bf9529de8bc70/

This issue will track the complete implementation of the new ow-exporter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions