Skip to content
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

[LMI-0001] Add Component-Based Metrics & Dynamic Label Support #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tommynguyen-vungle
Copy link

@tommynguyen-vungle tommynguyen-vungle commented Feb 3, 2025

This PR introduces the ability to track metric by component (e.g., Kafka, Prometheus). It replaces static metrics with dynamic labels, enabling granular insights into trends across different components.

Key Changes

  1. New Feature: Dynamic Prometheus labels based on Jira components.
    • Metrics now include a component label (e.g., jira_deployments_weekly{component="Kafka"}).
  2. Code Refactoring:
    • Introduced GaugeVec to support dynamic labels.
    • Added Jira API response types (Issue, Component, JiraResponse) for structured data handling.
  3. Error Handling: Removed goto statements and improved error logging.
  4. Configuration Update:
    • Added support for dynamic labels in config.yaml (set component: "" to enable).
    • Example JQL now filters by component.

Usage Example

After deploying, the following metrics will be exposed:

# HELP jira_deployments_weekly Weekly deployments count by component  
# TYPE jira_deployments_weekly gauge  
jira_foo{component="Kafka"} 12  
jira_foo{component="Prometheus"} 7  

@tommynguyen-vungle tommynguyen-vungle changed the title [LMI-0001] Add Dynamic Component [LMI-0001] Add Component-Based Metrics & Dynamic Label Support Feb 3, 2025
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.

2 participants