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

github_exporter: fields mismatch between exporter and dashboards #5579

Closed
ahpook opened this issue Oct 24, 2023 · 2 comments · Fixed by #5600
Closed

github_exporter: fields mismatch between exporter and dashboards #5579

ahpook opened this issue Oct 24, 2023 · 2 comments · Fixed by #5600
Labels
bug Something isn't working frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. upstream An issue that must be fixed upstream

Comments

@ahpook
Copy link

ahpook commented Oct 24, 2023

What's wrong?

When adding the github_exporter integration to the agent and installing the bundled dashboards, the Open Pull Requests dashboard is empty. This is because the query for the metrics is filtering on fields user and repo (i.e. github_repo_pull_request_count{user="grafana",repo="agent"}) but the metric is not exported into prometheus with a user field.

It looks like the dashboard end of things expects the change in this PR to exist in the data model, but the exporter is not updated to add that key. Maybe this is a result of #5289 ?

Steps to reproduce

  • Install the GitHub integration as described in the docs
  • Note the Open Pull Requests table is empty
  • Edit the dashboard and using the data explorer, browse to the github_repo_pull_request_count metric, and note the only filterable field on it is repo.
  • Remove the user=$user filter from the query and note the data now shows up correctly.

As an aside there are additional metrics that would be great to have in this integration (as #1845 mentioned), but it's very unclear where to put a PR right now

System information

No response

Software version

grafana-agent-0.37.2-1

Configuration

integrations:
  prometheus_remote_write:
  - basic_auth:
      password: glc_XXX
      username: 111
    url: https://prometheus-prod-36-prod-us-west-0.grafana.net/api/prom/push
  agent:
    enabled: true
    relabel_configs:
    - action: replace
      source_labels:
      - agent_hostname
      target_label: instance
    - action: replace
      target_label: job
      replacement: "integrations/agent-check"
    metric_relabel_configs:
    - action: keep
      regex: (prometheus_target_.*|prometheus_sd_discovered_targets|agent_build.*|agent_wal_samples_appended_total|process_start_time_seconds)
      source_labels:
      - __name__
  github_exporter:
    enabled: true
    api_token: 'github_pat_XXX'
    repositories:
    - cli/cli
    relabel_configs:
    - replacement: 'ahpook-test'
      target_label: instance
    metric_relabel_configs:
    - action: keep
      regex: github_rate_limit|github_rate_remaining|github_repo_forks|github_repo_open_issues|github_repo_pull_request_count|github_repo_size_kb|github_repo_stars|github_repo_watchers
      source_labels:
      - __name__

Logs

No response

@marctc
Copy link
Contributor

marctc commented Oct 24, 2023

@ahpook thanks for reporting! Indeed this is a problem after switching to the original fork. I pinged the maintainer of the repo to see if we can merge that PR.

@ahpook
Copy link
Author

ahpook commented Oct 26, 2023

@marctc thanks for the quick turnaround on this!

@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. upstream An issue that must be fixed upstream
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants