Skip to content

Add functionality to collect metrics from commit server for argocd #20412

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

steveny91
Copy link
Contributor

What does this PR do?

Added functionality to collect metrics from another component that was introduced in argocd.

Copy link

codecov bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.19%. Comparing base (306681b) to head (2000169).
Report is 2 commits behind head on master.

Additional details and impacted files
Flag Coverage Δ
activemq ?
argocd 87.93% <100.00%> (+0.70%) ⬆️
cassandra ?
confluent_platform ?
hive ?
hivemq ?
hudi ?
ignite ?
jboss_wildfly ?
kafka ?
presto ?
solr ?
tomcat ?
weblogic ?

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@AAraKKe AAraKKe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have a question for my understanding and a comment to simplify the number of places we need to modify when adding more config options.

EDIT: Just noticed it is in draft, I was curious about how the metrics were being added and reviewed it 😅 . Let me know when it is out of draft and I can approve again if it is not kept.

Comment on lines 88 to +94
NOTIFICATIONS_CONTROLLER_METRICS,
)
)
if commit_server_endpoint:
self.scraper_configs.append(
self.generate_config(commit_server_endpoint, COMMIT_SERVER_NAMESPACE, COMMIT_SERVER_METRICS)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Re: lines +44 to +94]

nit: wdyt about simplifying this with a config setup and a dynamic block?

    def parse_config(self):
        configs_per_endpoint = {
            "app_controller_endpoint": {
                "namespace": APP_CONTROLLER_NAMESPACE,
                "metrics": APPLICATION_CONTROLLER_METRICS,
            },
            "appset_controller_endpoint": {
                "namespace": APPSET_CONTROLLER_NAMESPACE,
                "metrics": APPSET_CONTROLLER_METRICS,
            },
            "api_server_endpoint": {
                "namespace": API_SERVER_NAMESPACE,
                "metrics": API_SERVER_METRICS,
            },
            "repo_server_endpoint": {
                "namespace": REPO_SERVER_NAMESPACE,
                "metrics": REPO_SERVER_METRICS,
            },
            "notifications_controller_endpoint": {
                "namespace": NOTIFICATIONS_CONTROLLER_NAMESPACE,
                "metrics": NOTIFICATIONS_CONTROLLER_METRICS,
            },
            "commit_server_endpoint": {
                "namespace": COMMIT_SERVER_NAMESPACE,
                "metrics": COMMIT_SERVER_METRICS,
            },
        }

        self.scraper_configs = [
            self.generate_config(
                endpoint,
                configs_per_endpoint[endpoint]["namespace"],
                configs_per_endpoint[endpoint]["metrics"],
            )
            for endpoint_str in configs_per_endpoint
            if (endpoint := self.instance.get(endpoint_str))
        ]

        if not self.scraper_configs:
            expected_endpoints_str = "`, `".join(configs_per_endpoint.keys())
            raise ConfigurationError(
                f"Must specify at least one of the following: `{expected_endpoints_str}`"
            )

See this comment inline on Graphite.

metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric,sample_tags
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question, is this change because there was a different metadata.csv format before?

@@ -0,0 +1 @@
Add functionality to collect metrics from commit server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Forgot to mention this. Would it be good to add here a link to the ArgoDC commit server feature we are adding support for? Both for future team members that might want to know what this is as well as customers that read about the release where this feature was added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants