Skip to content

add Prometheus query client, move Loki client, expose base obs URLs #1994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 28, 2025

Conversation

skudasov
Copy link
Collaborator

@skudasov skudasov commented Jul 28, 2025


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes introduce and enhance observability functionalities within the framework by adding support for querying Loki and Prometheus directly through newly created clients. The Loki client facilitates querying logs, while the Prometheus client enables querying metrics, including support for range queries. Additionally, exposing base URLs as constants simplifies configuration and usage across the framework. These enhancements aim to provide better insights into the system's behavior and performance by leveraging the capabilities of Loki and Prometheus for monitoring and debugging purposes.

What

  • framework/.changeset/v0.10.8.md

    • New file outlining the changes in version 0.10.8, including moving Loki client to framework, adding Prometheus Query/QueryRange client, and exposing base obs URLs as constants.
  • framework/loki/loki.go

    • New file introducing the Loki client with functionalities to query logs, handle API errors, and support basic authentication. It includes methods for initializing the client, querying Loki with specific parameters, and processing responses to extract log entries.
  • framework/loki/loki_test.go

    • New file providing tests for the Loki client, ensuring it handles successful queries, authentication failures, server errors, and debug mode activation correctly.
  • framework/observability.go

    • Added constants LocalGrafanaBaseURL, LocalLokiBaseURL, and LocalPrometheusBaseURL to expose the base URLs for Grafana, Loki, and Prometheus, facilitating easier access and configuration within the framework.
  • framework/prometheus/prometheus.go

    • New file introducing the Prometheus client for querying metrics, including instant and range queries. It supports initializing the client, executing queries with specific parameters, and processing responses into structured data.
  • framework/prometheus/prometheus_test.go

    • New file providing tests for the Prometheus client, validating its ability to handle various types of queries, including error scenarios and network issues, effectively.

@skudasov skudasov marked this pull request as ready for review July 28, 2025 21:30
@skudasov skudasov requested a review from a team as a code owner July 28, 2025 21:30
@skudasov skudasov force-pushed the move-loki-client branch 3 times, most recently from dc9df6a to ffc7599 Compare July 28, 2025 22:17
@skudasov skudasov merged commit 2ffe949 into main Jul 28, 2025
87 of 90 checks passed
@skudasov skudasov deleted the move-loki-client branch July 28, 2025 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant