Skip to content

feat: Add Metrics to SharpHound to be collected - BED-7080#2510

Open
mykeelium wants to merge 5 commits intomainfrom
mcuomo/BED-7080
Open

feat: Add Metrics to SharpHound to be collected - BED-7080#2510
mykeelium wants to merge 5 commits intomainfrom
mcuomo/BED-7080

Conversation

@mykeelium
Copy link
Contributor

@mykeelium mykeelium commented Mar 16, 2026

Description

Extends out the metric functionality in BloodHound to allow metrics to be collected from SharpHound Enterprise. Update Metrics logic to extend out the type of metrics that can be collected.

Motivation and Context

Resolves BED-7080

Why is this change required? What problem does it solve?

How Has This Been Tested?

This has been tested by running the application and ingesting metrics as they come in. In addition, a prometheus instance was connected to ensure the metrics are being passed on to prometheus.

Screenshots (optional):

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Database Migrations

Checklist:

Summary by CodeRabbit

  • New Features

    • Added query parameters for label-based filtering and a pipeline client metrics configuration parameter.
  • Style

    • Removed or trimmed license/header comments and normalized whitespace/formatting across multiple files and SQL migration scripts.

@mykeelium mykeelium self-assigned this Mar 16, 2026
@mykeelium mykeelium added the infrastructure A pull request containing changes affecting the infrastructure code. label Mar 16, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 227ef41d-e457-42ff-b357-03b9fa700c56

📥 Commits

Reviewing files that changed from the base of the PR and between 908dd98 and 4e66604.

📒 Files selected for processing (12)
  • cmd/api/src/database/assetgrouptags.go
  • cmd/api/src/database/auth.go
  • cmd/api/src/database/customnode.go
  • cmd/api/src/database/migration/extensions/ad_graph_schema.sql
  • cmd/api/src/database/migration/extensions/az_graph_schema.sql
  • cmd/ui/public/mockServiceWorker.js
  • packages/csharp/graphschema/PropertyNames.cs
  • packages/go/graphschema/ad/ad.go
  • packages/go/graphschema/azure/azure.go
  • packages/go/graphschema/common/common.go
  • packages/go/graphschema/graph.go
  • packages/javascript/bh-shared-ui/src/graphSchema.ts
💤 Files with no reviewable changes (5)
  • cmd/ui/public/mockServiceWorker.js
  • packages/go/graphschema/ad/ad.go
  • packages/go/graphschema/azure/azure.go
  • packages/go/graphschema/common/common.go
  • packages/go/graphschema/graph.go
✅ Files skipped from review due to trivial changes (5)
  • cmd/api/src/database/customnode.go
  • cmd/api/src/database/auth.go
  • cmd/api/src/database/assetgrouptags.go
  • cmd/api/src/database/migration/extensions/ad_graph_schema.sql
  • cmd/api/src/database/migration/extensions/az_graph_schema.sql

📝 Walkthrough

Walkthrough

Adds two new API query parameter constants (labels[], label_values[]) and a new pipeline configuration parameter (pipeline.client_metrics) with its parameter type and accessor; also includes multiple non-functional formatting and license/header removals across various files.

Changes

Cohort / File(s) Summary
Query Parameter Constants
cmd/api/src/api/constant.go
Added two new public string constants: QueryParameterLabels = "labels[]" and QueryParameterLabelValues = "label_values[]".
Configuration Parameter System
cmd/api/src/model/appcfg/parameter.go
Added ClientMetricsKey = "pipeline.client_metrics", extended IsValidKey() to include it, introduced ClientMetricsParameter { Enabled bool }, and added GetClientMetricsParameter(ctx, service) accessor with defaulting and warning logs.
Database whitespace/formatting
cmd/api/src/database/assetgrouptags.go, cmd/api/src/database/auth.go, cmd/api/src/database/customnode.go, cmd/api/src/database/migration/extensions/...
Whitespace/indentation formatting edits in DB-related files and migration SQLs; no logic or control-flow changes.
License/header and formatting cleanup
cmd/ui/public/mockServiceWorker.js, packages/csharp/graphschema/PropertyNames.cs, packages/go/graphschema/...
Removed license/header blocks and minor EOF/formatting edits across JS, C#, and Go graphschema files; no functional changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description covers the main change and includes testing details, but lacks specific explanations for why this change is required beyond stating the ticket reference, and does not adequately document the code changes made. Add more detail on the motivation (why SharpHound metrics are needed), and provide a brief summary of the technical implementation details or architectural changes introduced.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding metrics collection capability from SharpHound, which aligns with the PR's primary objective of extending metric functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mcuomo/BED-7080
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mykeelium mykeelium force-pushed the mcuomo/BED-7080 branch 3 times, most recently from 2c29fa8 to fa5f062 Compare March 23, 2026 17:42
@github-actions
Copy link

github-actions bot commented Mar 24, 2026

Howdy! Thank you for opening this pull request 🙇

Your title is formatted correctly but we did not find a matching issue reference.
Please verify that the reference is correct and available in Jira or GitHub issues.

Details:

Issue request error: Invalid Jira issue

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

Labels

infrastructure A pull request containing changes affecting the infrastructure code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant