Skip to content

Changelog: New Metrics API Endpoint Added #1511

@ellipsis-dev

Description

@ellipsis-dev

A new larger feature has been merged into the main langfuse repository: a comprehensive public metrics API endpoint.

Feature Summary:

  • Introduced a new GET /api/public/metrics endpoint to fetch metrics with flexible query parameters.
  • Query parameters include: view, dimensions, metrics, filters, timeDimension, fromTimestamp, toTimestamp, and orderBy.
  • Added schema validation for queries and structured response types.
  • Comprehensive tests for valid/invalid queries, authentication, and error handling.
  • Documentation updated in openapi.yml and Postman collection.

Files changed:

  • API definition: fern/apis/server/definition/metrics.yml
  • OpenAPI spec: web/public/generated/api/openapi.yml
  • Postman collection: web/public/generated/postman/collection.json
  • Endpoint implementation: web/src/pages/api/public/metrics/index.ts
  • Query/response types: web/src/features/public-api/types/metrics.ts
  • Tests: web/src/__tests__/async/metrics-api.servertest.ts

Impact:

  • Enables users to programmatically fetch metrics with custom queries.
  • Ensures robust validation and error handling for API consumers.
  • Improves documentation and testing coverage for public API endpoints.

Please refer to the changelog post guidelines for formatting and publishing this changelog entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions